This is almost certainly caused by the involvement of two different
classloaders.  For example, if you place a driver jar such as Oracle's
classes12.jar in both places, then you'll find you cannot cast from a
com.oracle...BlobXXX to a com.oracle...BlobXXX, as the class you can see
comes from the web-app class loader, but the blob you have came from
Tomcat's common class loader, from whence the connection came.  The class
names are the same, and it can be quite confusing trying to figure it out,
as the CastClassException doesn't indicate the loader, only the class name.

Tim


> -----Original Message-----
> From: Bryan Basham [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 02, 2007 1:10 PM
> To: Tomcat Users List
> Subject: Configuring JSF in the TOMCAT/conf/web.xml for all webapps
> 
> Hello,
> 
> I am developing a system in which every webapp deployed to Tomcat uses
> JSF.
> So, I decided to move the common JSF configuration from each
> webapp/WEB-INF/web.xml
> into the TOMCAT/conf/web.xml file.
> 
> At startup time everything looks fine.  Here's an example of the output
> I see for each webapp:
> -------------------------
> [02 Feb 2007 10:32:15,699]  INFO [main] (HostConfig.java:788) -
> Deploying web application archive admin.war
> [02 Feb 2007 10:32:16,022]  INFO [main] (FacesConfigurator.java:151) -
> Reading standard config
> org/apache/myfaces/resource/standard-faces-config.xml
> [02 Feb 2007 10:32:16,112]  INFO [main] (FacesConfigurator.java:397) -
> Reading config /WEB-INF/module-faces-config.xml
> [02 Feb 2007 10:32:16,134]  INFO [main] (FacesConfigurator.java:411) -
> Reading config /WEB-INF/faces-config.xml
> [02 Feb 2007 10:32:16,165]  INFO [main] (NamedNavigationHandler.java:48)
> - The Cobia navigation handler has been instantiated.
> [02 Feb 2007 10:32:16,167]  INFO [main] (CobiaVariableResolver.java:59)
> - The Cobia variable resolver has been instantiated.
> [02 Feb 2007 10:32:16,171]  INFO [main]
> (CrossContextViewHandler.java:57) - The Cobia cross-context ViewHandler
> has been instantiated.
> [02 Feb 2007 10:32:16,230]  INFO [main] (HtmlRenderKitImpl.java:104) -
> Overwriting renderer with family = javax.faces.SelectOne rendererType =
> javax.faces.Radi
> o renderer class =
> org.stillsecure.common.web.components.SelectOneRadioRenderer
> [02 Feb 2007 10:32:16,231]  INFO [main] (HtmlRenderKitImpl.java:104) -
> Overwriting renderer with family = javax.faces.Form rendererType =
> javax.faces.Form renderer class =
> org.stillsecure.common.web.components.HtmlFormRenderer
> [02 Feb 2007 10:32:16,237]  INFO [main]
> (StartupServletContextListener.java:99) - ServletContext
> '/usr/local/apache-tomcat/webapps/admin/' initialized.
> [02 Feb 2007 10:32:16,237]  INFO [main]
> (StartupServletContextListener.java:140) - Serialization provider :
> class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
> [02 Feb 2007 10:32:16,238]  INFO [main] (CobiaInitializer.java:66) -
> Initializing Cobia ServletContext
> -------------------------
> 
> However, when the first URL to *.jsf occurs I get the following error
> message:
> -------------------------
> 02 Feb 2007 10:33:04,953]  INFO [http-443-Processor25]
> (ApplicationContext.java:646) - No state saving method defined, assuming
> default server state saving
> [02 Feb 2007 10:33:04,971]  WARN [http-443-Processor25]
> (JspViewHandlerImpl.java:394) - no faces servlet mappings found
> [02 Feb 2007 10:33:07,757]  WARN [http-443-Processor25]
> (JspViewHandlerImpl.java:394) - no faces servlet mappings found
> [02 Feb 2007 10:33:07,813]  INFO [http-443-Processor25]
> (MyfacesConfig.java:133) - No context init parameter
> 'org.apache.myfaces.PRETTY_HTML' found, using default value true
> [02 Feb 2007 10:33:07,815]  INFO [http-443-Processor25]
> (MyfacesConfig.java:133) - No context init parameter
> 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using  default value true
> [02 Feb 2007 10:33:07,818]  INFO [http-443-Processor25]
> (MyfacesConfig.java:119) - Tomahawk jar not available. Autoscrolling,
> DetectJavascript, AddResourceClass and CheckExtensionsFilter are
> disabled now.
> [02 Feb 2007 10:33:12,544] ERROR [http-443-Processor24]
> (UIComponentTag.java:926) - Faces context not found. getResponseWriter
> will fail. Check if the FacesServlet has been initialized at all in your
> web.xml.
> [02 Feb 2007 10:33:12,553] ERROR [http-443-Processor24]
> (StandardWrapperValve.java:253) - Servlet.service() for servlet jsp
> threw exception
> java.lang.NullPointerException
>         at
> javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:
> 929)
>         at
> javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
>         at
> org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:70)
>         at
> org.apache.jsp.login_jsp._jspx_meth_f_view_0(login_jsp.java:105)
>         at org.apache.jsp.login_jsp._jspService(login_jsp.java:82)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
> :334)
>         at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati
> onFilterChain.java:252)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter
> Chain.java:173)
>         at
> org.stillsecure.cobia.web.user.AuthenticationFilter.doFilter(Authenticatio
> nFilter.java:101)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati
> onFilterChain.java:202)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter
> Chain.java:173)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.
> java:213)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.
> java:178)
>         at
> org.stillsecure.cobia.web.tomcat.SharedSessionRequestValve.invoke(SharedSe
> ssionRequestValve.java:97)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1
> 26)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1
> 05)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja
> va: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.proces
> sConnection(Http11BaseProtocol.java:664)
>         at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.j
> ava:527)
>         at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollower
> WorkerThread.java:80)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.j
> ava:684)
>         at java.lang.Thread.run(Thread.java:595)
> -------------------------
> 
> If I move the JSF configuration back into each webapp-specific web.xml,
> then it works fine.  Any ideas why this would happen?
> 
> Thanks,
> Bryan
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to