Results 1 to 2 of 2
  1. #1
    StewS is offline Member
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Default Servlet - apache tomcat/glassfish server shuts down on servlet usage

    Hi,

    I'm running netbeans 6.0.1, and trying to create a java servlet to handle various functions such as user login and database search on a website.

    The html form code calls as its action my servlet's name (Search) and uses POST as the method to parse parameters.

    Everything is all wonderful with the code, it does what it needs to do. My problem is as soon as the servlet finishes executing - the apache tomcat or glassfish web server dies / is shut down. I do not want this as I want my user to continue browsing the site and the servlet to be executed multiple times to perform various functions. Unless I have misunderstood what a servlet could and should be used for I assume this should be possible.

    I have tried altering the server properties, and changing the shutdown port and command in the apache tomcat server.xml config file (so that whatever is calling it will not be able to) But this has no effect, and I've spent lots of time researching would could be a very simple problem I believe. So can anyone help me?

    (PS I've also posted this question on the sun forums, I'm just frustrated with the problem and looking for a swift answer).

  2. #2
    StewS is offline Member
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Default

    just to update - i've solved the problem.

    I was calling system.exit() to close the servlet as I assumed this was necessary from my standard java knowledge. I replaced system.exit with a simple class that records whether exiting due to a successful run or an error occured.

Similar Threads

  1. Run servlet in HTTP server
    By jithan in forum New To Java
    Replies: 25
    Last Post: 10-16-2008, 10:10 AM
  2. Replies: 0
    Last Post: 08-30-2008, 11:52 AM
  3. Start a servlet when Tomcat Starts
    By sandeepkk2005 in forum Advanced Java
    Replies: 1
    Last Post: 12-03-2007, 02:04 PM
  4. Replies: 1
    Last Post: 08-07-2007, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •