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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

tomcat always use old JSP data error

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello all:
I am having problem with tomcat 3.3/Linux server.
Strangely, I find that no matter how I change the data and DB, the tomcat always return me the JSP which shows the old data. And my browser can automatically login into my webapplication, without doing the authentification, (even if I restart the computer).
I do not think those are caused by my codes, because my codes work fine on my own test server. So I wonder what could be the possible reason for the above error?
I remember when I restart the Tomcat server, an error message indicating the port address is busy came out. I have seen an message here which says this could be caused by another instance of Tomcat running on port 8080 from a previous execution, maybe an orphan. What does this mean? How do I check what is running on port 8080, how do I kill those instances?
Any hints is appreciated, thanks!
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Use
telnet host 8080
to check whether some server is running on that port..
host is the ip address where your sevrer is running
Also it may be neccessary to check up your class files which Tomcat is using.
Napa
 
Stephen Wei
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi:
I try telnet xxx.xx.xxx.xx 8080
but I received no response, does this mean no server is actually running on the port? If Tomcat is running, do I see a login prompt or what?
When I restart the Tomcat, I remember an error message came out, saying that address is busy, socket binding exception etc, does this mean I did not restart my Tomcat server?
How do I see and kill all the instances/sessions running on port 8080? (after becoming root of the server). After I restart the Tomcat, all the old sessions should be automatically deleted by the server?
Also still, I do not know about the reason why my JSP keeps using the old DB data only, even after I update all DB successfully, what might be a cause? I fear it will come out again in the future.
Please help, thanks.
 
Napa Sreedhar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
1. Telnet is a tcp/ip client program which connects to your server on the port that you issued.
<telnet serverip port>
After running telnet if you get the output
Escape Character is [<control-character>]... that means you are able to connect to the server.
<optional> After that you can issue GET requests to your server.
Make sure you kill the telnet client !!
2. You can also check for the port status etc...on a Unix box using netstat -nr, netstat -nl commands ! You can try this also!!

Hope this helps
Napa
 
Stephen Wei
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello Napa:
thanks for the advice. I tried it, now I think I know what is wrong, but not why.
I think the problem is that I can not shutdown my tomcat server now for some reason. I use ./shutdown.sh command in the /bin directory. But it gives me the following message..
Using classpath: ./../lib/tomcat.jar
Using JAVA_HOME: /usr/java/jdk1.3.1_01
Using TOMCAT_HOME: /usr/local/tomcat3.3
Stopping Tomcat.
Can't read /usr/local/tomcat3.3/conf/ajp12.id
What does the above mean? It means shutdown fails right? How to solve?
Now I point my browser to tomcat top page, I can still see the welcome page and link through them, so I suppose tomcat is still running after I tried to shut it down. Why?
Please help! Thanks!
 
Napa Sreedhar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I try telnet xxx.xx.xxx.xx 8080
but I received no response, does this mean no server is actually running on the port? If Tomcat is running,
do I see a login prompt or what?
Ans) You dont see a login prompt if you are able to connect to the server. If the execution of telenet displays (Escape character is <control char> as said in my previous post), you can be sure some application is using port 8080.
When I restart the Tomcat, I remember an error message came out, saying that address is busy, socket binding
exception etc, does this mean I did not restart my Tomcat server?
Ans) An instance of Tomcat may be already running or some application is using the server port 8080.
Kill that application using <kill -9 pid> and restart Tomcat.

How do I see and kill all the instances/sessions running on port 8080? (after becoming root of the server).
After I restart the Tomcat, all the old sessions should be automatically deleted by the server?
Also still, I do not know about the reason why my JSP keeps using the old DB data only, even after I update
all DB successfully, what might be a cause? I fear it will come out again in the future.
Ans) JSPs compile and produce class files usually in _directoryname. This is done for faster access of the pages. After changes are made to the previous JSP pages the WebServer may not replace the previously compiled class files stored in _directoryname.. It should actually and logically overwrite the old class files using time stamps. But to be sure that you use the latest pages you can delete the previously compiled class files and start your application.
Please help, thanks.
 
Napa Sreedhar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Using classpath: ./../lib/tomcat.jar
Using JAVA_HOME: /usr/java/jdk1.3.1_01
Using TOMCAT_HOME: /usr/local/tomcat3.3
Stopping Tomcat.
Can't read /usr/local/tomcat3.3/conf/ajp12.id

This should be obvioulsy because of the permissions to /usr/local/tomcat3.3/conf/ajp12.id
Check the ownner and permissions to the /usr/local/tomcat3.3/conf/ajp12.id
file and better kill the server using the normal kill command in Unix... Also you may need to check how your server is started up .. I mean as which user ??
Hope this helps
Napa
 
Stephen Wei
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello, thank for all the help!
with the help, now I found out the error why I can not restart my Tomcat. This is because I started my Tomcat 2 times yesterday!
This gives a strange bug, which the first instance of tomcat can not shutdown, because it can not find ajp12.id file. So I created the file manually, then the tomcat rebooted ok.
But for the JSP keeps using old DB Data problem, I tried to delete all the temp class files in the /work directory under tomcat, but the problem is not solved. I try to research a little more...
THanks
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
It didn't start out that way, but this became a duplicate post. Closed, and moved to Tomcat.
 
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic