my dog learned polymorphism*
The moose likes JSP and the fly likes Tomcat only serves one page at the same time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Tomcat only serves one page at the same time" Watch "Tomcat only serves one page at the same time" New topic
Author

Tomcat only serves one page at the same time

Robert Jaeger
Ranch Hand

Joined: Apr 29, 2002
Posts: 62
Hi!
I have configured succesfully a WinNT/Apache1.3/Tomcat4/MySQL/Cocoon architecture.
Well, there�s only one problem.
When I try to request a *.jsp from 2 browsers at the same time, Tomcat doesn�t return results (loads forever). I think that happens only during the first request, when Tomcat generates the servlets. However, I am not sure and worried about Tomcat�s performance.
Is this just a problem at the first request when I try to access the same jsp?
Is there a software that checks and reports server performance (e.g. by sending a lot of random requests)?
Maybe someone has an idea,
Robito.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Why don't you verify that it happens the first time the JSP is accessed. This si normal because that's the time when the servletis being generated. On subsequent requests it should not take longer, regardless of how many requests are coming in, unless you have synchronized some of your code, or implemented the "SingleThreadModel" interface.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Robert Jaeger
Ranch Hand

Joined: Apr 29, 2002
Posts: 62
If it works fine after the first servlet-generation until the next jsp-changes then it�s ok for me.
I just wondered about the problems with the first request.
Thanks,
Robert.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

Depnding on the speed of your server, the first hit on a JSP can take an incredibly long time as it has to compile the JSP into a servlet (usually) and then compile the servlet into Java bytecodes, plus run the init code for the servlet.
For this reason a lot of people prefer to precompile their JSPs. The exact method for doing that depends on your appserver, so you'll have to RTFM. For testing purposes, I just live with the rotten performance, though, since a precompiled JSP is worthless once I've updated the page.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: Tomcat only serves one page at the same time
 
Similar Threads
changes in jsp not reflecting immediately
object instance solved, but...
object instance
changes in jsp not reflecting immediately
mvc model with jsp, servlet