Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-01-2008, 05:04 PM
Member
 
Join Date: Dec 2008
Posts: 2
Rep Power: 0
StewS is on a distinguished road
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).
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 12-02-2008, 01:23 AM
Member
 
Join Date: Dec 2008
Posts: 2
Rep Power: 0
StewS is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run servlet in HTTP server jithan New To Java 25 10-16-2008 11:10 AM
Is there any way to transfer the file Streams from one servlet to another servlet . HenaPriyadarsini Java Servlet 0 08-30-2008 12:52 PM
Start a servlet when Tomcat Starts sandeepkk2005 Advanced Java 1 12-03-2007 03:04 PM
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2 osval Advanced Java 1 08-07-2007 04:47 PM


All times are GMT +2. The time now is 02:54 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org