You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jo...@knowledgehouse.net on 2000/05/02 20:18:36 UTC

JSPs, Servlets, Tomcat, IE and evil page caching behavior

Hi all,

Thought I would pass this on in case it isn't obvious to anyone else.

I have a JSP that produces data from a session bean, and uses a servlet to
adjust the state of the bean for navigation purposes.  The servlet either
returns an error page or returns the original JSP page.

Some combination of IE and Tomcat is causing some interesting page cacheing
behavior.  I had IE set to check for a new version of a page automatically.
When my session timed out, the button (i.e. URL) that triggered the error
message (generated from the servlet for the moment) produced a page that
did not have the no-cache meta tag (<META HTTP-EQUIV="Pragma" CONTENT
="no-cache">).   Reloading the JSP that starts the sequence caused a new
bean to be created, but the fact that that URL produced that piece of HTML
was locked into the IE cache, and it either did not check for new content,
or did and didn't seem to find it.

When I clicked the button which directed the browswer to run my navigation
servlet, I automatically got the error page, and the request was never sent
to the servlet itself.  Since the error page says it can't find the session
bean, you can imagine the results were a bit misleading...

I now have expired IE's cache and set it to always check for new content.
My example is working again. :)

I don't know if this is a bug with IE, a bug with Tomcat, both or neither.


John Robinson
Technical Architect
Knowledge House Inc.
5670 Spring Garden Road
Suite 200
Halifax, Nova Scotia
Canada B3J 1H6
902.429.1375 Tel
902.429.2858 Fax
902.490.2936 Direct
www.knowledgehouse.net




Re: Still no luck

Posted by Luis Andrei Cobo <va...@megapathdsl.com>.
THANKS! that worked perfectly...both logfile and console are being used =)

thanks.

Luis
----- Original Message -----
From: "Craig McClanahan" <Cr...@eng.sun.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, May 02, 2000 8:36 PM
Subject: Re: Still no luck


> Luis Andrei Cobo wrote:
>
> > although someone offered a suggestion to my problem of having
> > System.err.println show up on my screen, there is no mechanism right now
> > thats accomplishing this, and the suggestion $TOMCAT_HOME; ./startup.sh
>
> > log 2>&1 did not work....ran the command and nothing happened at all,
just
> > got another prompt...
> >
>
> I think it has to go the other way around:
>
>     cd $TOMCAT_HOME
>     ./bin/startup.sh 2>&1 > logfile
>
> and you should get both standard error and standard output logged to
> $TOMCAT_HOME/logfile.  Check to see if there's an error message in the
logfile
> itself if all you get is a prompt.
>
> If you don't do any redirection, both standard error and standard output
really
> do go to your console window.
>
> Craig McClanahan
>
>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>


Re: Still no luck

Posted by Craig McClanahan <Cr...@eng.sun.com>.
Luis Andrei Cobo wrote:

> although someone offered a suggestion to my problem of having
> System.err.println show up on my screen, there is no mechanism right now
> thats accomplishing this, and the suggestion $TOMCAT_HOME; ./startup.sh >
> log 2>&1 did not work....ran the command and nothing happened at all, just
> got another prompt...
>

I think it has to go the other way around:

    cd $TOMCAT_HOME
    ./bin/startup.sh 2>&1 > logfile

and you should get both standard error and standard output logged to
$TOMCAT_HOME/logfile.  Check to see if there's an error message in the logfile
itself if all you get is a prompt.

If you don't do any redirection, both standard error and standard output really
do go to your console window.

Craig McClanahan



Still no luck

Posted by Luis Andrei Cobo <va...@megapathdsl.com>.
although someone offered a suggestion to my problem of having
System.err.println show up on my screen, there is no mechanism right now
thats accomplishing this, and the suggestion $TOMCAT_HOME; ./startup.sh >
log 2>&1 did not work....ran the command and nothing happened at all, just
got another prompt...

hmmm

running tomcat on linuxppc, I set up a package of servlets as background
applications for my JSP pages...in the servlets are System.err.println and
System.out.println calls at various points for debugging. The servlet runs,
having one of its methods called from a JSP page. I have no idea where ANY
of the system.out, or System.err messages are going. they certainly arent
going into alog file because I was looking around for one and well it doesnt
exist on my machine.

is there something I can do to ensure A: that All system.err. and System.out
messages are logged to a file, or B printed to my console somehow? I need
these messages to be there....

Please help

Luis Andrei Cobo


More Wierdness

Posted by Alec Cove <co...@kpe.com>.
If I replace webserver.jar from 3.1 with webserver.jar from 3.1beta, I can
start tomcat, otherwise I get:

java.lang.ClassNotFoundException:
org/apache/tomcat/service/http/HttpConnectionHandler

???


Re: JSPs, Servlets, Tomcat, IE and evil page caching behavior

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
John.Robinson@knowledgehouse.net wrote:

> Hi all,
>
> Thought I would pass this on in case it isn't obvious to anyone else.
>
> I have a JSP that produces data from a session bean, and uses a servlet to
> adjust the state of the bean for navigation purposes.  The servlet either
> returns an error page or returns the original JSP page.
>
> Some combination of IE and Tomcat is causing some interesting page cacheing
> behavior.  I had IE set to check for a new version of a page automatically.
> When my session timed out, the button (i.e. URL) that triggered the error
> message (generated from the servlet for the moment) produced a page that
> did not have the no-cache meta tag (<META HTTP-EQUIV="Pragma" CONTENT
> ="no-cache">).   Reloading the JSP that starts the sequence caused a new
> bean to be created, but the fact that that URL produced that piece of HTML
> was locked into the IE cache, and it either did not check for new content,
> or did and didn't seem to find it.
>
> When I clicked the button which directed the browswer to run my navigation
> servlet, I automatically got the error page, and the request was never sent
> to the servlet itself.  Since the error page says it can't find the session
> bean, you can imagine the results were a bit misleading...
>
> I now have expired IE's cache and set it to always check for new content.
> My example is working again. :)
>
> I don't know if this is a bug with IE, a bug with Tomcat, both or neither.
>

If you need a no-cache header in your error page, the servlet or JSP that
creates that page needs to include it.  The container (Tomcat in this case) has
no responsibility to manage these headers for you.

>
> John Robinson

Craig McClanahan



Re: java.lang.ClassNotFoundException?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.

David Rodriguez Gonzalez wrote:

> "Craig R. McClanahan" wrote:
>
> >
> > I don't know if this contributed to your particular problems, but I have heard
> > reports that downloading Netscape's 6.0 alpha release and installing it will
> > downgrade your JDK from 1.2.2 to 1.2.0 -- and among other problems this
> > causes,Tomcat won't start any more.  Re-installing JDK 1.2.2 seems to clean
> > things up again.
> >
> > I haven't done this myself so I can't verify it -- but it's something to be
> > aware of.
> >
> >
> > Craig McClanahan
> >
>
> I have  installed Netscape 6 Preview Release 1 (Red Hat 6.1) , and have no
> problems restarting TomCat.  No reinstallation of JDK was needed. That problem
> may happen in Windows platforms only.
>

Sorry, I should have been more specific -- I've heard about this only from Windows
users.  It wouldn't affect Linux users because there's no Java support in the Linux
version yet :-(.

>
>     David Rodriguez
>

Craig



Re: java.lang.ClassNotFoundException?

Posted by David Rodriguez Gonzalez <dr...@ifca.unican.es>.
"Craig R. McClanahan" wrote:

>
> I don't know if this contributed to your particular problems, but I have heard
> reports that downloading Netscape's 6.0 alpha release and installing it will
> downgrade your JDK from 1.2.2 to 1.2.0 -- and among other problems this
> causes,Tomcat won't start any more.  Re-installing JDK 1.2.2 seems to clean
> things up again.
>
> I haven't done this myself so I can't verify it -- but it's something to be
> aware of.
>
>
> Craig McClanahan
>

I have  installed Netscape 6 Preview Release 1 (Red Hat 6.1) , and have no
problems restarting TomCat.  No reinstallation of JDK was needed. That problem
may happen in Windows platforms only.

    David Rodriguez


Re: java.lang.ClassNotFoundException?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Alec Cove wrote:

> sorry, should have given the platform. Im on NT. After reinstalling jdk1.2.2
> and tomcat3.1 it worked. I dont know if they updated any of the jar files
> while I was in the process of doing this. I had 3.1beta working fine, when I
> initially tried 3.1 release I started getting the ClassNotFoundException.
>

I don't know if this contributed to your particular problems, but I have heard
reports that downloading Netscape's 6.0 alpha release and installing it will
downgrade your JDK from 1.2.2 to 1.2.0 -- and among other problems this
causes,Tomcat won't start any more.  Re-installing JDK 1.2.2 seems to clean
things up again.

I haven't done this myself so I can't verify it -- but it's something to be
aware of.

>
> thanks
> Alec
>

Craig McClanahan



RE: java.lang.ClassNotFoundException?

Posted by Alec Cove <co...@kpe.com>.
sorry, should have given the platform. Im on NT. After reinstalling jdk1.2.2
and tomcat3.1 it worked. I dont know if they updated any of the jar files
while I was in the process of doing this. I had 3.1beta working fine, when I
initially tried 3.1 release I started getting the ClassNotFoundException.

thanks
Alec

-----Original Message-----
From: Aleksander Grzebyta [mailto:olekg@talex.com.pl]
Sent: Wednesday, May 03, 2000 9:11 AM
To: tomcat-user@jakarta.apache.org
Subject: Odp: java.lang.ClassNotFoundException?


If your platform (you should give that info) is win95/98 your problems could
be similar to mine:
http://jakarta.apache.org/bugs/show_bug.cgi?id=251

Try to run Tomcat with JDK 1.1.7 to make sure the problem is exactly the
same. It looks like some JARs were compiled with 1.1.* and will not load
with 1.2.2.

sincerely Olek

----- Original Message -----
From: Alec Cove <co...@kpe.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, May 02, 2000 8:47 PM
Subject: java.lang.ClassNotFoundException?


> Im getting these errors:
> java.lang.ClassNotFoundException:
> org/apache/tomcat/service/http/HttpConnectionHandler
>
> and
>
> FATAL:java.lang.Exception: Invalid ConnectionHandler
>
> when I try to start up tomcat. Any ideas why this would come up? The
> classpath seems right. HttpConnectionHandler is in webserver.jar, which
> seems to be correct in the classpath.
>
> below is the entire:
> ----------------------------------
> H:\desktop\tomcat\bin>tomcat run
> Using classpath:
> h:\desktop\tomcat\classes;h:\desktop\tomcat\lib\webserver.jar;h
>
:\desktop\tomcat\lib\jasper.jar;h:\desktop\tomcat\lib\xml.jar;h:\desktop\tom
> cat\
> lib\servlet.jar;H:\jdk1.2.2\lib\tools.jar;h:\jdk1.2.2\lib\servlet.jar
> java.lang.ClassNotFoundException:
> org/apache/tomcat/service/http/HttpConnectionH
> andler
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Compiled Code)
>         at
> org.apache.tomcat.service.SimpleTcpConnector.setProperty(SimpleTcpCon
> nector.java:180)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at org.apache.tomcat.util.xml.MethodSetter.end(Compiled Code)
>         at org.apache.tomcat.util.xml.XmlMapper.matchEnd(Compiled Code)
>         at
> org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:96)
>         at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
>         at com.sun.xml.parser.Parser.content(Compiled Code)
>         at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
>         at com.sun.xml.parser.Parser.content(Compiled Code)
>         at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
>         at com.sun.xml.parser.Parser.content(Compiled Code)
>         at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
>         at com.sun.xml.parser.Parser.parseInternal(Compiled Code)
>         at com.sun.xml.parser.Parser.parse(Parser.java:283)
>         at
org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:198)
>         at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:143)
>         at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
> Context log: path="/examples" Adding context path="/examples"
> docBase="webapps/
> examples"
> Context log: path="" Adding context path=""  docBase="webapps/ROOT"
> Context log: path="/test" Adding context path="/test"
> docBase="webapps/test"
> Starting tomcat. Check logs/tomcat.log for error messages
> Starting tomcat install="h:\desktop\tomcat" home="H:\desktop\tomcat"
> classPath="
>
h:\desktop\tomcat\classes;h:\desktop\tomcat\lib\webserver.jar;h:\desktop\tom
> cat\
>
lib\jasper.jar;h:\desktop\tomcat\lib\xml.jar;h:\desktop\tomcat\lib\servlet.j
> ar;H
> :\jdk1.2.2\lib\tools.jar;h:\jdk1.2.2\lib\servlet.jar"
> Context log: path="/admin" Automatic context load
> docBase="H:\desktop\tomcat\web
> apps\admin"
> Context log: path="/admin" Adding context path="/admin"
> docBase="H:\desktop\tom
> cat\webapps\admin"
> FATAL:java.lang.Exception: Invalid ConnectionHandler
> java.lang.Exception: Invalid ConnectionHandler
>         at
> org.apache.tomcat.service.SimpleTcpConnector.start(SimpleTcpConnector
> .java:133)
>         at org.apache.tomcat.core.ContextManager.start(Compiled Code)
>         at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:157)
>         at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org


Odp: java.lang.ClassNotFoundException?

Posted by Aleksander Grzebyta <ol...@talex.com.pl>.
If your platform (you should give that info) is win95/98 your problems could
be similar to mine:
http://jakarta.apache.org/bugs/show_bug.cgi?id=251

Try to run Tomcat with JDK 1.1.7 to make sure the problem is exactly the
same. It looks like some JARs were compiled with 1.1.* and will not load
with 1.2.2.

sincerely Olek

----- Original Message -----
From: Alec Cove <co...@kpe.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, May 02, 2000 8:47 PM
Subject: java.lang.ClassNotFoundException?


> Im getting these errors:
> java.lang.ClassNotFoundException:
> org/apache/tomcat/service/http/HttpConnectionHandler
>
> and
>
> FATAL:java.lang.Exception: Invalid ConnectionHandler
>
> when I try to start up tomcat. Any ideas why this would come up? The
> classpath seems right. HttpConnectionHandler is in webserver.jar, which
> seems to be correct in the classpath.
>
> below is the entire:
> ----------------------------------
> H:\desktop\tomcat\bin>tomcat run
> Using classpath:
> h:\desktop\tomcat\classes;h:\desktop\tomcat\lib\webserver.jar;h
>
:\desktop\tomcat\lib\jasper.jar;h:\desktop\tomcat\lib\xml.jar;h:\desktop\tom
> cat\
> lib\servlet.jar;H:\jdk1.2.2\lib\tools.jar;h:\jdk1.2.2\lib\servlet.jar
> java.lang.ClassNotFoundException:
> org/apache/tomcat/service/http/HttpConnectionH
> andler
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Compiled Code)
>         at
> org.apache.tomcat.service.SimpleTcpConnector.setProperty(SimpleTcpCon
> nector.java:180)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at org.apache.tomcat.util.xml.MethodSetter.end(Compiled Code)
>         at org.apache.tomcat.util.xml.XmlMapper.matchEnd(Compiled Code)
>         at
> org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:96)
>         at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
>         at com.sun.xml.parser.Parser.content(Compiled Code)
>         at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
>         at com.sun.xml.parser.Parser.content(Compiled Code)
>         at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
>         at com.sun.xml.parser.Parser.content(Compiled Code)
>         at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
>         at com.sun.xml.parser.Parser.parseInternal(Compiled Code)
>         at com.sun.xml.parser.Parser.parse(Parser.java:283)
>         at
org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:198)
>         at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:143)
>         at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
> Context log: path="/examples" Adding context path="/examples"
> docBase="webapps/
> examples"
> Context log: path="" Adding context path=""  docBase="webapps/ROOT"
> Context log: path="/test" Adding context path="/test"
> docBase="webapps/test"
> Starting tomcat. Check logs/tomcat.log for error messages
> Starting tomcat install="h:\desktop\tomcat" home="H:\desktop\tomcat"
> classPath="
>
h:\desktop\tomcat\classes;h:\desktop\tomcat\lib\webserver.jar;h:\desktop\tom
> cat\
>
lib\jasper.jar;h:\desktop\tomcat\lib\xml.jar;h:\desktop\tomcat\lib\servlet.j
> ar;H
> :\jdk1.2.2\lib\tools.jar;h:\jdk1.2.2\lib\servlet.jar"
> Context log: path="/admin" Automatic context load
> docBase="H:\desktop\tomcat\web
> apps\admin"
> Context log: path="/admin" Adding context path="/admin"
> docBase="H:\desktop\tom
> cat\webapps\admin"
> FATAL:java.lang.Exception: Invalid ConnectionHandler
> java.lang.Exception: Invalid ConnectionHandler
>         at
> org.apache.tomcat.service.SimpleTcpConnector.start(SimpleTcpConnector
> .java:133)
>         at org.apache.tomcat.core.ContextManager.start(Compiled Code)
>         at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:157)
>         at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>


java.lang.ClassNotFoundException?

Posted by Alec Cove <co...@kpe.com>.
Im getting these errors:
java.lang.ClassNotFoundException:
org/apache/tomcat/service/http/HttpConnectionHandler

and

FATAL:java.lang.Exception: Invalid ConnectionHandler

when I try to start up tomcat. Any ideas why this would come up? The
classpath seems right. HttpConnectionHandler is in webserver.jar, which
seems to be correct in the classpath.

below is the entire:
----------------------------------
H:\desktop\tomcat\bin>tomcat run
Using classpath:
h:\desktop\tomcat\classes;h:\desktop\tomcat\lib\webserver.jar;h
:\desktop\tomcat\lib\jasper.jar;h:\desktop\tomcat\lib\xml.jar;h:\desktop\tom
cat\
lib\servlet.jar;H:\jdk1.2.2\lib\tools.jar;h:\jdk1.2.2\lib\servlet.jar
java.lang.ClassNotFoundException:
org/apache/tomcat/service/http/HttpConnectionH
andler
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Compiled Code)
        at
org.apache.tomcat.service.SimpleTcpConnector.setProperty(SimpleTcpCon
nector.java:180)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.tomcat.util.xml.MethodSetter.end(Compiled Code)
        at org.apache.tomcat.util.xml.XmlMapper.matchEnd(Compiled Code)
        at
org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:96)
        at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
        at com.sun.xml.parser.Parser.content(Compiled Code)
        at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
        at com.sun.xml.parser.Parser.content(Compiled Code)
        at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
        at com.sun.xml.parser.Parser.content(Compiled Code)
        at com.sun.xml.parser.Parser.maybeElement(Compiled Code)
        at com.sun.xml.parser.Parser.parseInternal(Compiled Code)
        at com.sun.xml.parser.Parser.parse(Parser.java:283)
        at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:198)
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:143)
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
Context log: path="/examples" Adding context path="/examples"
docBase="webapps/
examples"
Context log: path="" Adding context path=""  docBase="webapps/ROOT"
Context log: path="/test" Adding context path="/test"
docBase="webapps/test"
Starting tomcat. Check logs/tomcat.log for error messages
Starting tomcat install="h:\desktop\tomcat" home="H:\desktop\tomcat"
classPath="
h:\desktop\tomcat\classes;h:\desktop\tomcat\lib\webserver.jar;h:\desktop\tom
cat\
lib\jasper.jar;h:\desktop\tomcat\lib\xml.jar;h:\desktop\tomcat\lib\servlet.j
ar;H
:\jdk1.2.2\lib\tools.jar;h:\jdk1.2.2\lib\servlet.jar"
Context log: path="/admin" Automatic context load
docBase="H:\desktop\tomcat\web
apps\admin"
Context log: path="/admin" Adding context path="/admin"
docBase="H:\desktop\tom
cat\webapps\admin"
FATAL:java.lang.Exception: Invalid ConnectionHandler
java.lang.Exception: Invalid ConnectionHandler
        at
org.apache.tomcat.service.SimpleTcpConnector.start(SimpleTcpConnector
.java:133)
        at org.apache.tomcat.core.ContextManager.start(Compiled Code)
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:157)
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)