Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Interesting problem with Apache/Tomcat

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm running Apache/Tomcat on XP. I am having trouble serving a certain page when I becomes too large. I am pulling my hair out trying to figure out why.
It occurs on a JSP page. the page works fantastic when I remove a few random bytes from the HTML code, but when I put them back in, strange, random results occur. To see it, do the following:
1. go to www.subsgalore.com
2. click on online ordering (middle of page)
3. click on Order now (link at the bottom)
4. Keep refreshing this page, and notice the random results.
Is this some sort of timeout? When serving the page from localhost, the error does not occur, only when it is served from the internet.
Could it be my ISP? Any suggestions?
-Jason
 
Jason Kiefer
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update - I do not have any problem accessing the page straight through tomcat (8080), but only when I go through apache/tomcat. I am using ajp13 for the worker connection. The setup file for ajp13 is as follows:
# Start setup file
#
workers.tomcat_home=C:\\Program Files\\Apache Group\Tomcat 4.1
workers.java_home=C:\\java\\jdk1.3.1
ps=\\
worker.list=ajp12, ajp13
# Definition for Ajp13 worker
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
#
worker.ajp13.socket_keepalive=0
worker.ajp13.socket_timeout=300
# End setup file
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only way I could get the "order now" to load up was to put in :8080 for port.
Since I didn't have anything in my "cart" it was the same every time. I didn't try it with something in my cart tho.
 
Jason Kiefer
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for looking. I have since changed the described link to point to 8080. But, when I access the link on port 80 and continue to refresh, different parts of the same page show up. Sometimes the whole page will show correctly, other times 404 will show, and still other times half the page will show up.
The strangest part is that I have been able to make it work perfectly when I comment out a certain amount of any part of the jsp page. I have even been able to get it to work perfectly, then add 1 byte, and have it fail as described.
Does anybody else have any ideas?
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jason
I'm looking at http://www.subsgalore.com:8080/subsgalore/OrderInit.do page in IE 6.0 ...
it appears the same everytime I refresh (and I've deleted temp internet files between refreshes).
so it appears I cannot duplicate your indications ...
question: can you tell us which code you are editing out? is it simple html you're deleting or jsp syntax?
[ March 23, 2003: Message edited by: david eberhardt ]
 
david eberhardt
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may want to review this article:
Demystifying Tomcat 4's server.xml File
see page 2 - maybe the following settings make a difference?;

The <Context> Element
reloadable: If set to true, causes Tomcat to check for class changes in the WEB-INF/classes/ and WEB-INF/lib directories. If these classes have changed, the application owning these classes will automatically be reloaded. This feature should only be used during development. This setting will cause severe performance degradation, and therefore should be set to false when in a production environment.


The HTTP Connector
bufferSize: Specifies the size, in bytes, of the buffer to be provided for use by input streams created by this connector. Increasing the buffer size can improve performance, at the expense of higher memory usage. The default value is 2048 bytes.


The article seems to suggest some changes are in order going from (development - localhost) to (production - your web host server) ???
let me know.
 
Jason Kiefer
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David -
You will only see the problem on http://www.subsgalore.com/subsgalore/OrderInit.do
. (notice the hardcoded port 8080 is missing). One thing I should also mention is that the problem only happens on the page that is displayed during open busines hours (pst). You will know the page becuase the hours of the shop will not display, but an online ordering screen will instead appear.
Anyway, I tried your suggestions to no avail. I still think it has to do with some sort of timeout or space issue, either within tomcat, or between tomcat/apache.
And to answer your other query, it does not matter which part of the jsp page is deleted out. I even found that if rather than deleting out code, I could comment out with jsp comments (<%-- --%> and it would work fine, but with regular html comments (<!-- --> it would still be screwy.
At this point Im wondering if I should just forget about running the whole thing through apache, and just keeping it set up how it is currently (hardcoded 8080 port for the jsp portion of the website).
I'm still open to any help though! You guys rock!!
-Jason
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question regarding the hard-coded port. This is only when you're testing through the address bar, right? I mean: no where in your code (JSP or servlets) do you actually construct a URL with the "http://www.domain.com/foo" in it?

If you are, why?

As a general hint on why a single page might appear different on multiple refreshes... consider that you might have a threading problem.

any non-local variables? For JSP those would be ones declared within <%! %>
 
Jason Kiefer
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike -
I use struts as the framwork for this web application. I only put the :8080 in the url (using html:link tag from struts) on the introductory page to the application (non static) part of the website. From there, the :8080 is automatically reconstructed, mostly by using relative paths for navigation. I only used the :8080 becuase this is currently the only way the page works correctly (going around Apache, straight to tomcat).
Regarding the use of global variables, I have used none. In fact, I tried to stay away from any JSP code in the paged, instead I mostly use custom tags. There were a few places I used local variables to construct tables though . . (very minor code).
Please tell me more about threading. . .again, this page works perfectly when executing only through tomcat. The only time it has troubles is when it is accessed through apache.
 
Jason Kiefer
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to move this up, but I am still very confused about this issue. . .I still think that it is some kind of timeout or something. My problem is that I am not a server expert like you kind people out there, and I just can't figure out the problem on my own. Please Help!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic