Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Calling a servlet from within a Server-Side plugin

 I have a server-side plugin Participant which I am trying to get to call a Servlet using a URLConnection.

I am able to deploy it with Jetty (localhost), and it triggers correctly, and I get the request into my Servlet.
I then packaged it, deployed to my standalone test server on the same laptop.  The SSP gets the trigger and attempts to send the request, but fails.

It uses this code:
    URL myurl = new URL("http://myserver.com:9080/MyServlet/Servlet?command=create");
URLConnection myURLConnection = myurl.openConnection();
myURLConnection.setConnectTimeout(2000);
myURLConnection.setReadTimeout(2000);
   myURLConnection.connect();
   BufferedReader in = new BufferedReader(new InputStreamReader(
    myURLConnection.getInputStream()));
String inputLine;
String comment="";
while ((inputLine = in.readLine()) != null) {
comment=comment + " " + inputLine;
}
in.close();

So...
Works from an SSP deployed to Jetty 4.0.5
Works in standalone java program (going to servlet)
Works if I copy/paste the URL into a browser
FAILS from an SSP deployed to an RTC 4.0.5 server

Any Ideas??

1 vote



One answer

Permanent link
did u start the server in debug mode?  if so you could connect from eclipse to the server and then put a breakpoint on your plugin entrypoint. and debug it from there.. I never use Jetty, always debug on a full deployment of the rtc server.

if you have any extra jars needed, you put them in the plugins libs folder too, right?

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Nov 11 '14, 12:08 p.m.

Question was seen: 3,666 times

Last updated: Nov 11 '14, 4:17 p.m.

Confirmation Cancel Confirm