Menu

#65 Problems setting up ServerSocket Web Service

v3.1.0
closed
5
2004-06-15
2004-05-22
scottcs8877
No

Hello all,

I'm trying to use the Java Wrapper to set up a simple
Web Service using the ServetSocket Java library. I'm
having trouble configuring the Java Wrapper to work
with this.

The basic structure of the code is:

===============
ServerSocket server = new ServerSocket(port);
while(true) {
Socket s = server.accept();
// Perform actions based on input
}
===============

If I set it up as above and follow the tutorial, the
Wrapper restarts the web service every 30 seconds
giving a message like at the bottom of the
Troubleshooting page:

wrapper | 2001/12/01 12:23:44 | Startup failed: Timed
out waiting for signal from JVM.

My indication is that because the server pauses to wait
for a connection in the server.accept() line inside an
infinite loop, it is unable to properly exit. Alternately,
I've set up program without the while loop and run it
once but then I get the opposite error that the program
has terminated unexpectedly.

Whats the correct way to implement a web service like
this using the wrapper?

Thanks!
-Scott

Discussion

  • Leif Mortenson

    Leif Mortenson - 2004-05-24

    Logged In: YES
    user_id=228081

    The message you are getting is because the Java component of
    the Wrapper is never being initialized. Could you attach
    your wrapper.conf file? I need more info to help you. Make
    sure that you have read through the integration section of
    the docs.

    Cheers,
    Leif

     
  • Leif Mortenson

    Leif Mortenson - 2004-05-24
    • assigned_to: nobody --> mortenson
     
  • scottcs8877

    scottcs8877 - 2004-05-24
     
  • scottcs8877

    scottcs8877 - 2004-05-24

    Logged In: YES
    user_id=1047638

    I Attached the wrapper.conf file that I used. It's very
    muched based off the example wrapper.conf. The only major
    change being the wrapper.java.mainclass.
    -Scott

     
  • Leif Mortenson

    Leif Mortenson - 2004-05-25

    Logged In: YES
    user_id=228081

    Scott,
    Thanks for the conf file. The problem was as I had
    expected. You my friend have not read the documentation.
    As I said in the last message. Please read the integration
    section of the documention. All I could do here is to
    repeat what is already written down there. Most likely
    integration method #1 will work for you.
    http://wrapper.tanukisoftware.org/doc/english/integrate.html

    Also what version of the Wrapper are you using? 3.1.0
    should have been kicking out a nice informative message
    informing you of this mistake...

    Let me know whether or not you get things working or if you
    encounter any other problems after looking over the
    integration docs.

    Cheers,
    Leif

     
  • Leif Mortenson

    Leif Mortenson - 2004-06-15

    Logged In: YES
    user_id=228081

    I assume you have things working. Closing this issue off.

     
  • Leif Mortenson

    Leif Mortenson - 2004-06-15
    • status: open --> closed
     

Log in to post a comment.