You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alexandre Victoor <av...@prisma-presse.com> on 2001/10/18 13:17:52 UTC
Problem with sessions and SSL
Hello
I have a tomcat-cocoon site that is working well with http. Now this same
website is under sll and the session cookies seem to expire very fast.
Some images in my pages come from unsecured location. Does anyone knows if
these two thinks are linked ?
Is it normal that session cookies doesn't work the same way with or without
ssl ?
Thanks
Alex
Re: update: Tomcat 4.0.1 IllegalStateException (was NOT in 4.0 final)
Posted by Remy Maucherat <rm...@home.com>.
> Hi,
>
> I found out that this happens mostly when using pageContext.forward(). I
use
> this method before writing any html-code and I do a return; afterwards.
>
> Has anybody any clue?
After a forward, the response is not modifiable anymore by the application.
One modification which was added between 4.0 and 4.0.1 is that it will throw
an ISE on most accesses, which on second thought may not be that good an
idea, since that's not specified anywhere in the spec.
In that particular case, Jasper would get a writer, but any attempt to write
to it would result in an IOException.
That problem did not appear in my testing. How do you reproduce the problem
?
Remy
update: Tomcat 4.0.1 IllegalStateException (was NOT in 4.0 final)
Posted by pero <pe...@antaramusic.de>.
Hi,
I found out that this happens mostly when using pageContext.forward(). I use
this method before writing any html-code and I do a return; afterwards.
Has anybody any clue?
cheers,
pero
> -----Original Message-----
> From: pero [mailto:pero@antaramusic.de]
> Sent: Thursday, October 18, 2001 1:45 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat 4.0.1 IllegalStateException (was NOT in 4.0 final)
>
>
> Hi,
>
> after updating to TC 4.0.1 I occasionally get the following exception:
>
> StandardWrapperValve[jsp]: Servlet.service() for servlet jsp
> threw exception
> java.lang.IllegalStateException
> at
> org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFac
> ade.java:1
> 59)
> at
> org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:166)
> at
> org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.
> java:158)
> at
> org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:205)
> at
> org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.
> java:176)
> at
> org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContex
> t(JspFacto
> ryImpl.java:198)
> at
> org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFac
> toryImpl.j
> ava:193)
> at org.apache.jsp.page3$jsp._jspService(page3$jsp.java:3393)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Jsp
> Servlet.ja
> va:202)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(A
> pplication
> FilterChain.java:247)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicati
> onFilterCh
> ain.java:193)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapp
> erValve.ja
> va:243)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 66)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardConte
> xtValve.ja
> va:201)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 66)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authent
> icatorBase
> .java:472)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 64)
> at
> org.apache.catalina.valves.CertificatesValve.invoke(CertificatesVa
> lve.java:2
> 46)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 64)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValv
> e.java:164
> )
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 66)
> at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispat
> cherValve.
> java:170)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 64)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValv
> e.java:170
> )
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 64)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 64)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngine
> Valve.java
> :163)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:5
> 66)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProce
> ssor.java:
> 1011)
> at
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor
> .java:1106
> )
> at java.lang.Thread.run(Thread.java:484)
>
> It is not bound to a specific page (even if I reload the page
> that cause the
> "error" the exception does not reoccur) and the page is executed normally
> even if that exception occurs.
> In TC4.0 final I never got such an exception.
> After checking the catalina-source, I found out that the
> exception is raised
> if the response has been suspended. But I did not do such things
> explicitly.
> (and again, tomcat did not complain in version 4.0)
>
> I could ignore the exception (for it seems to have no impact on the
> jsp-execution), but of course it's not that nice. :-)
>
> So, any ideas what's going on?
>
> thanks,
> pero
>
>
>
>
Tomcat 4.0.1 IllegalStateException (was NOT in 4.0 final)
Posted by pero <pe...@antaramusic.de>.
Hi,
after updating to TC 4.0.1 I occasionally get the following exception:
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException
at
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:1
59)
at
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:166)
at
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:158)
at
org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:205)
at
org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:176)
at
org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFacto
ryImpl.java:198)
at
org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.j
ava:193)
at org.apache.jsp.page3$jsp._jspService(page3$jsp.java:3393)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:202)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:201)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:472)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1011)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106
)
at java.lang.Thread.run(Thread.java:484)
It is not bound to a specific page (even if I reload the page that cause the
"error" the exception does not reoccur) and the page is executed normally
even if that exception occurs.
In TC4.0 final I never got such an exception.
After checking the catalina-source, I found out that the exception is raised
if the response has been suspended. But I did not do such things explicitly.
(and again, tomcat did not complain in version 4.0)
I could ignore the exception (for it seems to have no impact on the
jsp-execution), but of course it's not that nice. :-)
So, any ideas what's going on?
thanks,
pero
Re: problems with JDBC and JSP
Posted by Richard Troy <rt...@ScienceTools.com>.
Pete,
This is an off-topic post, but this should help:
What you're missing is a call of the form rs.moveToInsertRow(); Now that I
take a second look, you're performing set methods on a prepared statement,
which is fine, but you can also perform update methods on a result set...
Curious, isn't it? Therefore I'm giving you _two_ excerpts from working
examples. Note that they are very different but both achieve a similar
goal. One also illustrates simply passing your args in a String! To wit:
1) First, using update methods against a result set - you can insert
as many rows as you like, just move forward with moveToInsertRow()
as shown below
Statement s = conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = s.executeQuery("select * from MyTable where 1=2;");
// The 'where 1=2' is just a clever way to get a full result set
// defined with no rows of data returned.
rs.moveToInsertRow();
rs.updateString(1,MyFirstVariable);
rs.updateString(2,"A Constant String");
rs.insertRow();
rs.moveToCurrentRow();
2) Second, using set methods against a Prepared Statement, a lot like
what you were doing in your example:
PreparedStatement PS;
String sql = "insert into MyTable (MyTime, Who, What) ";
sql +="values(?, '"+WhoVariable+"', '+WhatVariable+"');";
PS = conn.prepareStatement(sql);
PS.setDate(1,MyTimeVariable);
PS.executeUpdate();
This should do it for you...
RT
--
Richard Troy, Chief Scientist
Science Tools Corporation
rtroy@ScienceTools.com, 510-567-9957, http://ScienceTools.com/
On Thu, 18 Oct 2001, Peter wrote:
> Date: Thu, 18 Oct 2001 15:37:01 -0400
> From: Peter <pe...@ccs.neu.edu>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: problems with JDBC and JSP
>
> hi All, I'm having some wierd behavior in a JSP that I can't seem to trace
> the cause to. The code is similar to as follows
> query = <some query>
> PreparedStatement ps = connection.prepareStatement(query);
> ps.setInt(1, <some int variable>);
> ps.setInt(1, <some other int variable>);
> ps.executeUpdate();
> ps.close();
> //second update
> query2 = <new query>
> ps = connection.prepareStatement(query2);
> ps.setInt(1, <some int variablet>);
> ps.executeUpdate();
>
> however after closing the prepared statement the second everything goes
> smoothly except that only nulls get inserted into the second update. I've
> checked to make sure that the data gets to the right places before the
> insert by checking with System.out.println("<some int variable>") however
> nothing seems to help.
> it's as if the second update never occurs. I'm running a win2k server, with
> tomcat 3.2.3 and a MSSQL server 2000, JDK 1.3 any advice is welcome
> thanks. -Pete
>
.zip file in app/WEB-INF/lib
Posted by Henry <hx...@cs.ualberta.ca>.
when i added the classes12.zip to my classpath for oracle JDBC, fine.
however, i added that zip file to myapp/WEB-INF/lib, it says:
"could not find suitable driver"
should i add something to web.xml as well?
problems with JDBC and JSP
Posted by Peter <pe...@ccs.neu.edu>.
hi All, I'm having some wierd behavior in a JSP that I can't seem to trace
the cause to. The code is similar to as follows
query = <some query>
PreparedStatement ps = connection.prepareStatement(query);
ps.setInt(1, <some int variable>);
ps.setInt(1, <some other int variable>);
ps.executeUpdate();
ps.close();
//second update
query2 = <new query>
ps = connection.prepareStatement(query2);
ps.setInt(1, <some int variablet>);
ps.executeUpdate();
however after closing the prepared statement the second everything goes
smoothly except that only nulls get inserted into the second update. I've
checked to make sure that the data gets to the right places before the
insert by checking with System.out.println("<some int variable>") however
nothing seems to help.
it's as if the second update never occurs. I'm running a win2k server, with
tomcat 3.2.3 and a MSSQL server 2000, JDK 1.3 any advice is welcome
thanks. -Pete
Re: Problem with sessions and SSL
Posted by Alexandre Victoor <av...@prisma-presse.com>.
Sorry, I found the response myself to my problem. The problem came from a
load-balancing between two tomcat servers...
Alex