Handling SSLHandshakeException in Tomcat 5.5.17

Hi,
How do I handle this exception, when the user clicks "Cancel" upon SSL Client authentication when prompted for a certificate.
javax.net.ssl.SSLHandshakeException: null cert chain
Tomcat throws this exception, but I would like to catch it and redirect the user to a proper error page. The full stack trace is as follows:
2007-05-14 10:35:36 org.apache.tomcat.util.net.jsse.JSSE14Support synchronousHandshake
INFO: SSL Error getting client Certs
javax.net.ssl.SSLHandshakeException: null cert chain
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.ServerHandshaker.clientCertificate(Unknown Source)
at com.sun.net.ssl.internal.ssl.ServerHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at java.io.InputStream.read(Unknown Source)
at org.apache.tomcat.util.net.jsse.JSSE14Support.synchronousHandshake(JSSE14Support.java:87)
at org.apache.tomcat.util.net.jsse.JSSE14Support.handShake(JSSE14Support.java:66)
at org.apache.tomcat.util.net.jsse.JSSESupport.getPeerCertificateChain(JSSESupport.java:120)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:1126)
at org.apache.coyote.Request.action(Request.java:348)
at org.apache.catalina.authenticator.SSLAuthenticator.authenticate(SSLAuthenticator.java:134)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
2007-05-14 10:35:36 org.apache.coyote.http11.Http11Processor action
WARNING: Exception getting SSL attributes
javax.net.ssl.SSLHandshakeException: null cert chain
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.ServerHandshaker.clientCertificate(Unknown Source)
at com.sun.net.ssl.internal.ssl.ServerHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at java.io.InputStream.read(Unknown Source)
at org.apache.tomcat.util.net.jsse.JSSE14Support.synchronousHandshake(JSSE14Support.java:87)
at org.apache.tomcat.util.net.jsse.JSSE14Support.handShake(JSSE14Support.java:66)
at org.apache.tomcat.util.net.jsse.JSSESupport.getPeerCertificateChain(JSSESupport.java:120)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:1126)
at org.apache.coyote.Request.action(Request.java:348)
at org.apache.catalina.authenticator.SSLAuthenticator.authenticate(SSLAuthenticator.java:134)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
regards,
kews

You won't be able to respond to that exception even if you catch it. It is a fatal exception.
What happens on the client side when you click Cancel is that the browser closes the SSL connection (during the handshake, hence the exception). So even if you catch the exception you can't redirect the user because they have closed the connection.
The best bet for trying to get that working might be to try to do something client side with Javascript... perhaps on an insecure page try to load some Javascript off a secure site, if the user cancels that you may be able to detect that. eg. change a variable in the secure javascript and then in your page you can see if it has changed, ie. they didn't cancel the secure page... A bit of a long shot!

Similar Messages

  • Where are Tomcat Java server pages stored in JBuilder 4?

    From what I understand JSP pages should be saved into the ROOT directory of Tomcat.
    I have created a JSP page in Jbuilder 4 but when it saves, it is somewhere entirely different.
    If I right click on the JSP in Jbuilder 4 and select webrun it runs in Jbuilder fine.
    However if I try and run it from IE7 browser with address http://localhost:8080/hello.jsp I get a message saying internet explorer cannot display the page.
    I also did a search on my C drive to find the tomcat ROOT directory but could not find it.
    So what do I need to do in Jbuilder4 to be able to view my developed JSP pages in a browser?
    Thanks,
    Jason.

    Hello,
    I am using version 4 of JBuilder professional.
    I am getting the impression that JBuilder4 does not setup a proper instalation of Tomcat but sets up some temporary directory/link to it when you do a webrun on the JSP.
    Here is the log if it means anything to you:
    C:\JBuilder4\jdk1.3\bin\javaw -classpath "C:\JBuilder4\tomcat\lib\webserver.jar;C:\JBuilder4\tomcat\lib\jasper.jar;C:\JBuilder4\tomcat\lib\xml.jar;C:\JBuilder4\lib\servlet.jar;C:\JBuilder4\lib\webserverglue.jar;C:\OU2007\TM427\EasyBeans\myproject;C:\JBuilder4\jdk1.3\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilder4\jdk1.3\jre\lib\i18n.jar;C:\JBuilder4\jdk1.3\jre\lib\jaws.jar;C:\JBuilder4\jdk1.3\jre\lib\rt.jar;C:\JBuilder4\jdk1.3\jre\lib\sunrsasign.jar;C:\JBuilder4\jdk1.3\lib\dt.jar;C:\JBuilder4\jdk1.3\lib\tools.jar" org.apache.tomcat.startup.Tomcat -config C:\OU2007\TM427\EasyBeans\conf\server8080.xml
    Starting tomcat. Check logs/tomcat.log for error messages
    Setting home to C:\OU2007\TM427\EasyBeans
    Context log: path="" Adding context path="" docBase="C:\OU2007\TM427\EasyBeans\"
    Starting tomcat install="C:\OU2007\TM427\EasyBeans" home="C:\OU2007\TM427\EasyBeans" classPath="C:\JBuilder4\tomcat\lib\webserver.jar;C:\JBuilder4\tomcat\lib\jasper.jar;C:\JBuilder4\tomcat\lib\xml.jar;C:\JBuilder4\lib\servlet.jar;C:\JBuilder4\lib\webserverglue.jar;C:\OU2007\TM427\EasyBeans\myproject;C:\JBuilder4\jdk1.3\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilder4\jdk1.3\jre\lib\i18n.jar;C:\JBuilder4\jdk1.3\jre\lib\jaws.jar;C:\JBuilder4\jdk1.3\jre\lib\rt.jar;C:\JBuilder4\jdk1.3\jre\lib\sunrsasign.jar;C:\JBuilder4\jdk1.3\lib\dt.jar;C:\JBuilder4\jdk1.3\lib\tools.jar"
    JSP Servlet Started
    JSP Servlet Started (Echo)
    Context log path="" :tomcat.errorPage: init
    Context log: path="" File not found C:\OU2007\TM427\EasyBeans\WEB-INF\web.xml, using only defaults
    Context log path="" :jsp: init
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007 Scratch dir for the JSP engine is: C:\OU2007\TM427\EasyBeans\work\localhost_8080</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007 IMPORTANT: Do not modify the generated servlets</JASPER_LOG>
    Context log path="" :default: init
    Context log: path="" File not found C:\OU2007\TM427\EasyBeans\conf\tomcat-users.xml
    Starting endpoint port="8080" handler="org.apache.tomcat.service.http.HttpConnectionHandler"
    Starting endpoint port="8081" handler="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"
    HTTP:GET /myproject/mybeans/valuebean.jsp 17-Mar-07 08:06:37
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007 JspEngine --> /myproject/mybeans/valuebean.jsp</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007      ServletPath: /myproject/mybeans/valuebean.jsp</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007      PathInfo: null</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007      RealPath: C:\OU2007\TM427\EasyBeans\myproject\mybeans\valuebean.jsp</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007      RequestURI: /myproject/mybeans/valuebean.jsp</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007      QueryString: null</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007      Request Params: </JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:06:37 GMT+00:00 2007 Classpath according to the init parameter is: </JASPER_LOG>
    HTTP:GET /hello.jsp 17-Mar-07 08:07:15
    <JASPER_LOG> Sat Mar 17 08:07:15 GMT+00:00 2007 JspEngine --> /hello.jsp</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:07:15 GMT+00:00 2007      ServletPath: /hello.jsp</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:07:15 GMT+00:00 2007      PathInfo: null</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:07:15 GMT+00:00 2007      RealPath: C:\OU2007\TM427\EasyBeans\hello.jsp</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:07:15 GMT+00:00 2007      RequestURI: /hello.jsp</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:07:15 GMT+00:00 2007      QueryString: null</JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:07:15 GMT+00:00 2007      Request Params: </JASPER_LOG>
    <JASPER_LOG> Sat Mar 17 08:07:15 GMT+00:00 2007 Classpath according to the init parameter is: </JASPER_LOG>

  • How to make a socket connection timeout infinity in Servlet doPost method.

    I want to redirect my System.out to a file on a remote server (running Apache Web Server and Apache Tomcat). For which I have created a file upload servlet.
    The connection is established only once with the servlet and the System.out is redirected to it. Everything goes fine if i keep sending data every 10 second.
    But it is required that the data can be sent to the servlet even after 1 or 2 days. The connection should remain open. I am getting java.net.SocketTimeoutException: Read timed out Exception as the socket timeout occurs.
    Can anyone guide me how to change the default timeout of the socket connection in my servlet class.
    Following is the coding to establish a connection with the Servlet.
    URL servletURL = new URL(mURL.getProtocol(), mURL.getHost(), port, getFileUploadServletName() );
    URLConnection mCon = servletURL.openConnection();
    mCon.setDoInput(true);
    mCon.setDoOutput(true);
    mCon.setUseCaches(false);
    mCon.setRequestProperty("Content-Type", "multipart/form-data");
    In the Servlet Code I am just trying to read the input from the in that is the input stream.
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    BufferedInputStream in = new BufferedInputStream(req.getInputStream());
    byte [] content = new byte[1024];
    do
    read = in.read(content, 0, content.length);
    if (read > 0)
    out.write(content, 0, read);
    I have redirected the System.out to the required position.
    System.setOut(........);
    Can anyone guide me how to change the default timeout of the socket connection in my servlet class.

    I am aware of the setKeepAlive() method, but this can only used with the sockets. Here i am inside a servlet, have access to HTTPServletRequest and HTTPServletResponse and I don't know how to get access to the underlying sockets as the socket handling will be handled by the tomcat itself. If I am right there will be method in the apache tomcat 6.0.x to set this property. But till now I am not getting it.

  • How to specify alias for local filesystem in JBOSS

    hi,
    I want to specify alias for localfilesystem in JBOSS. I know how to do it in Apache_2.0.52-Openssl_0.9.7e-Win32. In this we can specify alias as,
    Alias /icons/ "C:/Program Files/Apache_2.0.52-Openssl_0.9.7e-Win32/icons/" in httpd.conf and futher we can specify the directory access also. So I want to do the same thing in JBOSS. How to do it.
    Thanks.

    JBoss is an app-server, not an HTTP server. The concept of directories is meaningless, as everything is based on contexts. Any of the HTTP server options will be handled by the Tomcat (Catalina) engine that is part of the JBoss installation. You can configure the Tomcat server by editing the jboss-service.xml file in JBOSS_HOME/deploy/tomcat-5.5.sar (or something like that). If you really need to start mapping/rewriting URLs onto your J2EE application, I'd suggest using Apache as the front-end, and connect the Web-tier to Apache via mod_jk. Then you can use all of Apache's URL rewriting and directory aliasing and specify access on a per-location basis. Some of Apache's functionality may be available to the Catalina engine, but there's no sense in trying to make Tomcat as "capable" as Apache, when a means to connect the two already exists.
    Brian

  • Time-out on MySQL

    hi all,
    I am facing a crisis here. The situation is such:
    Operating System : Solaris
    Java Server : Apache Tomcat
    Database : MySQL
    Technology : JSP, INet Crystal
    I am running a JSP page that pushes a lot of data (and I mean a lot) into MySQL. Afterwhich, I will call the Inet crystal report to generate a report based on those data. But the problem is the Inet Crystal doesn't fire.
    I checked the database and all the records are inserted correctly.
    However, on my webpage, it shows page loading and just kept on loading without any further progress.
    What is wrong here?
    Time-out on Tomcat? MySQL didn't pass the handler back to Tomcat/JSP?
    Help, please.
    Nicholas

    If this is still an issue can you post the snippet of code that deals with writing to the mySQL db so I can have a look at it... on first glance it sounds like there's an infinite loop in there somewhere so I'd check for that.
    Cheers.

  • JDeveloper as my IDE

    I need to get an IDE for developing JSP/Servlets using a Tomcat container. I will be developing alot of JSP/Servlets to work with Oracle database.
    Please advise if Oracle JDeveloper is a good choice and what are the advantages and/or negatives about using it?

    I haven't used JDeveloper in a few years.
    It was a reasonably good product then.
    It was based on Borland JBuilder if I recall correctly, JBuilder being one of the best IDEs around at that time.
    However for right now, Eclipse and NetBeans are the main contenders for most widely used IDE - mainly because they are free.
    I use Eclipse myself and with the Callisto plug-ins for web development it can handle JSP/Servlets / Tomcat / Oracle all from within the IDE.

  • New error with upgrade jboss/tomcat: "Connection handle has been closed and is unusable"

    Hi,
    This error suddenly appeared when we upgraded from jboss3/tomcat5.0 to jboss4.2/tomcat5.5.
    here's the usecase:
    1) User clicks on report link
    2) Crystal reports web componnent displays screen to fill in report parameters.
    3) user enters parameters and clicks submit
    4) System throws Exception
    The same reports worked fine with jboss 3.2.6/tomcat 5.0. We haven't touched anything in this realm.
    Log Excerpt:
    09:42:18,842 INFO  [datasource] Openning rowset
    09:42:18,904 ERROR [reportdefinition] com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Connection handle has been closed and is unusable
    09:42:18,905 ERROR [datasource] Failed to open rowset: the query failed to open rowset
    com.crystaldecisions.reports.reportdefinition.datainterface.g: JDBC Error: Connection handle has been closed and is unusable
         at com.crystaldecisions.reports.reportdefinition.datainterface.d.a(Unknown Source)
    To try to narrow down the problem, I've updated the jdbc configuration to
         <track-statements>true</track-statements>   
    here's a recap:
    This Boolean element specifies whether to check for unclosed statements when a connection is returned to the pool. If it is true, a warning message is issued for each unclosed statement. If the log4j category org.jboss.resource.adapter.jdbc.WrappedConnection has trace level enabled, a stack trace of the connection close call is logged as well. This is a debug feature that can be turned off in production.
    Interestingly enough, this error appears slightly upstream:
    (CachedConnectionManager.java:526) - Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
    java.lang.Throwable: STACKTRACE
         at
    org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
         at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
         at com.crystaldecisions.reports.common.av.a(Unknown Source)
         at com.crystaldecisions.reports.common.ag.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown
    So the question arises:
    1) Is the jboss datasource overly/aggressively closing result sets?
    2) or is there a coding error in CRXIR2?
    thanks,
    bill
    Full stack trace:
    [2008-03-13 17:26:18,905] [INFO ] org.jboss.resource.connectionmanager.CachedConnectionManager (CachedConnectionManager.java:526) - Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
    java.lang.Throwable: STACKTRACE
         at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
         at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
         at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
         at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
         at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
         at com.crystaldecisions.reports.common.av.a(Unknown Source)
         at com.crystaldecisions.reports.common.ag.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.z.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ak.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ad.int(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.bk.for(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.v.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.v.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(Unknown Source)
         at com.crystaldecisions.reports.sdk.DatabaseController.setTableLocation(Unknown Source)
         at org.apache.jsp.reports.processreport_jsp.switchTables(processreport_jsp.java:131)
         at org.apache.jsp.reports.processreport_jsp.loadReport(processreport_jsp.java:68)
         at org.apache.jsp.reports.processreport_jsp._jspService(processreport_jsp.java:227)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.shared.pagecache.client.PageCacheFilter.doFilter(PageCacheFilter.java:760)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.ExpiredPasswordFilter.doFilter(ExpiredPasswordFilter.java:92)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.pe.channels.client.servlet.ChannelUrlFilter.processUrl(ChannelUrlFilter.java:168)
         at com.participate.pe.channels.client.servlet.ChannelUrlFilter.doFilter(ChannelUrlFilter.java:100)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.BlockIpAddressFilter.doFilter(BlockIpAddressFilter.java:224)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.outstart.multiapp.filters.KeepOtherSessionsAliveFilter.doFilter(KeepOtherSessionsAliveFilter.java:88)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:151)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:619)

    <p>
    OK. I found the problem along with a workaround.
    </p>
    <p>
    <strong>The problem:</strong>
    </p>
    <p>
    a programming practice clashes with a new jboss 'safety check'.
    </p>
    <p>
    <strong>Programming practice:</strong>
    </p>
    <p>
    crystal reports gets a database connection in one jsp page, then tries to use it on another jsp/servlet
    </p>
    <p>
    <strong>Jboss safety check:</strong>
    Jboss/tomcat new comes configured out-of-the-box with a 'cached connection
    manager', which
    </p>
    <p>
    "Check[s] for unclosed connections and transaction terminated checks in servlets/jsps."
    </p>
    <p>
    <strong> Summary</strong>
    </p>
    <p>
    In short, if a servlet/jsp ends and it leaves a database connection open, Jboss will automatically close it.
    </p>
    <p>
    </p>
    <p>
    <strong>Workaround:</strong><br />
    Comment out two entries in these two files:
    </p>
    <p>
    1) conf/jboss4/pe/deploy/jboss-web.deployer/server.xml
    </p>
    <p>
    2) conf/jboss4/pe/deploy/jboss-web.deployer/META-INF/jboss-service.xml
    </p>
    <p>
    The two entries:
    </p>
    <p>
    </p>
    <p>
    1)
    </p>
    <p>
                 <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"<br />
                    cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"<br />
                    transactionManagerObjectName="jboss:service=TransactionManager" /><br />
    </p>
    <p>
    2)
    </p>
    <p>
          <depends>jboss.jca:service=CachedConnectionManager</depends><br />
    </p>
    <p>
    </p>
    <p>
    <strong>Comments on the workaround</strong>
    </p>
    <p>
    The 'cached connection manager' basically makes sure that the application cleans up after bad programmers. It seems most helpful in development, load testing, or trouble shooting.
    </p>
    <p>
    In production,  you can likely  comment them out with minimal
    impact on the application.
    </p>

  • Handling runtime Exceptions in tomcat / struts

    Hi, I'm trying to find a way to cleanly handle exceptions in struts/tomcat. I've read a number of suggestions in my struts book, but none seem to work.
    What I've done is created an instance within my action class that deliberatley creates a NullPointerException. I want to be able to display an errorPage at this point, but whatever I do I just get the same horrible HTTP Status 500 error.
    Can anyone give any advice with this please?

    Check out the org.apache.struts.action.ExceptionHandler class. Basically you extend this class, and override the execute method. In the struts config file you add this entry...
    <global-exceptions>
    <exception
    handler="the pathname of the class that extends ExceptionHandler"
    key="message properties entry"
    path="error page jsp"
    scope="request"
    type="type of Exception you want to catch (Throwable)"/>
    </global-exceptions>
    This basically acts as a "catch all" global exception handle.

  • How does Tomcat handle data files?

    Hello,
    To test something, i wrote a small test.jsp file, to figure out how tomcat handles data files. The content looks like this:
    <html>
    <head>
    <title>test</title>
    </head>
    <body>
    <%@ page import="java.io.*"%>
    <%
              String Line;
              try
                   FileWriter fw = new FileWriter("http://localhost:8080/act/testfile.dat");
         PrintWriter pw = new PrintWriter(fw);
                   pw.write("yeah baby yeah");
                   pw.close();
                   FileReader fr = new FileReader("http://localhost:8080/act/testfile.dat");
         BufferedReader br = new BufferedReader(fr);
                   Line = br.readLine();
                   br.close();
              catch (Exception e)
                   Line = "OEPS : " + e.getMessage();
    %><%=Line%>
    </body>
    </html>
    This give me an error.
    When i chance the path of the Filewriter adn filereader to: c:/testfile.dat
    it works.
    Can anyone explain this to me...
    many thanks
    Hugo Hendriks

    I think you should rewrite your code using the following.
    FileWriter fw = new FileWriter(getServletContext().getRealPath("/testfile.txt"));
    FileReader fr = new FileReader(getServletContext().getRealPath("/testfile.txt"));It works for me.

  • Tomcat error:   SEVERE: Protocol handler pause failed

    I am running apache-tomcat-5.5.23 using java 1.5.0_11 with modjk and Apache 2.0.52 on Redhat Enterprise Linux 4ES. Tomcat does not seem to shutdown cleanly taking a long time to do so displaying the following message in the logs. Any Ideas how to resolve this problem?
    I also have
    127.0.0.1          localhost localhost.localdomain
    in my hosts file amoungst other things.
    SEVERE: Protocol handler pause failed
    java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:208)
    at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:492)
    at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:289)
    at org.apache.jk.server.JkMain.pause(JkMain.java:681)
    at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:163)
    at org.apache.catalina.connector.Connector.pause(Connector.java:1032)
    at org.apache.catalina.core.StandardService.stop(StandardService.java:489)
    at org.apache.catalina.core.StandardServer.stop(StandardServer.java:734)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:602)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:577)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    30-May-2007 02:41:42 org.apache.catalina.core.StandardService stop
    INFO: Stopping service Catalina
    30-May-2007 02:41:43 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: Failed shutdown of Apache Portable Runtime

    This problem was resolved by editing the host file (/etc/hosts in the case of my unix box). What had happened in my case was that the box was using the IP address of the external cisco box, when it should have been using its internal IP. So I would recommend looking and checking what your host name resolve to.
    Just thought I would add this note as I hate it when people say problem fixed but leave no resolution.

  • Tomcat 4.1.2 default servlet request handling

    I have a problem which seems to be pretty common. I have a servlet that I would like to make the default servlet in my webapp. I have mapped the servlet to <url-pattern>/</url-pattern>. I would like this servlet to handle all requests, EXCEPT, for those with static content (images, .html files, etc.). The problem it seems is this: The Tomcat default servlet, which is also mapped to "/", in the /conf/web.xml file handles all static content. When I make my servlet the default servlet in my app, it overrides the tomcat default servlet, thus no static content is served. There must be a soulution to this problem other than writing a jsp redirect file??????
    Thanks,
    Kevin

    You can write a servlet which extends the default FileServlet of the tomcat.
    and in the service method check if the reques is for *.jpg or *.html
    If YES call super.service(); and return;
    If NO continue your work..
    There must be a soulution to this problem other than
    writing a jsp redirect file??????Redirect !!! I guess it won't work. Redirect will again hit the servlet mapped with "/" .. and it goes on in a contnious loop.
    Hope this helps.

  • Tomcat error handling...

    Is it possible to pass error messages onto servlets rather than have them caught by Tomcat's jvm.stderr & jvm.stdout? For example a System.out.. will go to jvm.stdout & System.error.. will go to jvm.stderr. I am unable to change these logging messages in the code (3rd party).
    Thanks in advanced.

    If you mean you want to catch any exception that has been thrown in you application, you can try to extend all your servlets from one super servlet and do the logging there, e.g.
    public class SuperServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServerException {
    try {
         handle(request,response)
    catch(IOException e) {
         // do you own logging
         throw new IOException(e);
    catch(ServerException e) {
         // do you own logging
         throw new ServerException(e);
    public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServerException {
         System.out.println("Error. Silly programmers should invent their own handle");
    then have your servlets extend SuperServlet and override the handle function and you have your logging

  • If the browser's cookie is disabled, how does Tomcat 4.1.12 handle the sess

    If the browser's cookie is disabled, how does Tomcat 4.1.12 handle the session?

    by URL Rewriting.
    For in deep information have a look at the servlet api docu or get the free pdf tutorial CoreServlets that covers this topic under pdf.coreservlets.com

  • Handling files in JSP(using TOMCAT engine)

    Hi
    I am calling a text file,which contains the details of the database variables(like the ip of the database server, the username and the password of the database) from one of my JSP pages. I have added this text file at 2 places , one in the BIN folder of my APACHE TOMCAT folder, another in the same folder from where i am running my .JSP file.
    But its not working .. it gives an error..."The system cannot find the file specified" i.e. The Text File.
    Help//

    try this
    File f = new File(application.getRealPath("connect.properties"));

  • Struts in Tomcat ( Exception Handling)

    When an exception is rised in an struts application, the StackTrace of the Exception is logged.
    Ex:
    2004-10-27 12:16:27,960 - DEBUG -- org.apache.struts.action.ExceptionHandler -- (ExceptionHandler.java: logException :122) -- ExceptionHandler caught this exception:
    hansen.playground.customexcep
         at hansen.playground.SubmitAction.execute(SubmitAction.java:37)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:536)
    Instead, I need only the first 7 to 8 lines. That is the Catalina part in not required. How to do it? Is it possible ?

    Hi there,
    I only have limited knowledge of this area so beware!!
    You'd probably have to look at using something like log4J in order to filter out part of that Stacktrace, e.g. Filter out any part with catalina in it etc.
    Karianna

Maybe you are looking for

  • Oracle.xml.parser.v2.SAXParser error

    I'm reposting this error that I recently received one more time before removing the XML transforms from my Java projects and doing them in .NET. Code that was working fine suddenly getting a transform error using JDeveloper. Get the following: javax.

  • Changing dvd drive help

    I have a presario S7150 and want to change dvd/cd rom drive. New drive is S ATA old one is IDE, cant find where to plug the SATA cable into . Do I need an adapter or is there a place to plug in on the motherboard and if so where.

  • How do i include transitions in Flash export?

    when I export my Keynote presentation to Flash, the transitions I selected disappear leaving way to a simple change of screen. I was wondering if there was a way to preserve all transitions and effects in the Flash export. Thank you for your help!

  • MIRO - display field ID and text

    Hello all - I know this is simple.  I just cannot remember where it is. When I am in MIRO, I see the tax code and tax description.   For the plant, all I see is the plant code.   Where/how can I set it to see both the plant code and the plant descrip

  • Never seen this error before - video importing

    Hello - I am trying to import 130 min movie from FCP into iDVD4 and am receiving an error in iDVD that I've never gotten before, "Unsupported file type: invalid video." The way I'm doing the import and the way I have always done it without issue, is: