It's all about the answers!

Ask a question

Calling a servlet from within a Server-Side plugin


Susan Hanson (1.6k2190193) | asked Nov 11 '14, 12:08 p.m.
 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??

One answer



permanent link
sam detweiler (12.5k6189201) | answered Nov 11 '14, 4:17 p.m.
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?

Your answer


Register or to post your answer.