tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Ersoy <ole.er...@gmail.com>
Subject Re: NPE when adding dependency to webapp
Date Thu, 13 Sep 2007 19:07:53 GMT
Hello again,

I noticed someone else had the same exception:

java.lang.IllegalStateException: No Factories configured for this Application.

And were able to resolve it by deleting the work directory.  I did the same (Nuked both work
and temp), but I still get the same exception.

Any ideas?

Thanks,
- Ole



Ole Ersoy wrote:
> Hi,
> 
> I'm getting an exception with myfaces when adding a dependency to the 
> webapp.  This dependency contains a component and renderer, but I 
> removed the META-INF directory, so it should just be interpreted as a 
> "simple" java dependency.  If I completely remove the dependency the 
> test app deploys and works fine as shown in the tomcat log here:
> 
> Sep 13, 2007 12:45:27 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive test9.war
> Sep 13, 2007 12:45:27 PM org.apache.myfaces.config.FacesConfigurator 
> feedStandardConfig
> INFO: Reading standard config META-INF/standard-faces-config.xml
> Sep 13, 2007 12:45:27 PM org.apache.myfaces.config.FacesConfigurator 
> feedClassloaderConfigurations
> INFO: Reading config 
> jar:file:/var/lib/apache-tomcat/webapps/test9/WEB-INF/lib/jsf-facelets-1.1.13.jar!/META-INF/faces-config.xml

> 
> Sep 13, 2007 12:45:28 PM org.apache.myfaces.config.FacesConfigurator 
> feedWebAppConfig
> INFO: Reading config /WEB-INF/faces-config.xml
> Sep 13, 2007 12:45:28 PM org.apache.myfaces.config.FacesConfigurator 
> logMetaInf
> INFO: Starting up MyFaces-package : myfaces-api in version : 1.2.0 from 
> path : 
> file:/var/lib/apache-tomcat/webapps/test9/WEB-INF/lib/myfaces-api-1.2.0
> .jar
> Sep 13, 2007 12:45:28 PM org.apache.myfaces.config.FacesConfigurator 
> logMetaInf
> INFO: Starting up MyFaces-package : myfaces-impl in version : 1.2.0 from 
> path : 
> file:/var/lib/apache-tomcat/webapps/test9/WEB-INF/lib/myfaces-impl-1.2
> .0.jar
> Sep 13, 2007 12:45:28 PM org.apache.myfaces.config.FacesConfigurator 
> logMetaInf
> INFO: MyFaces-package : tomahawk-sandbox not found.
> Sep 13, 2007 12:45:28 PM org.apache.myfaces.config.FacesConfigurator 
> logMetaInf
> INFO: MyFaces-package : tomahawk not found.
> Sep 13, 2007 12:45:28 PM org.apache.myfaces.shared_impl.util.LocaleUtils 
> toLocale
> WARNING: Locale name in faces-config.xml null or empty, setting locale 
> to default locale : en_US
> Sep 13, 2007 12:45:28 PM org.apache.myfaces.config.FacesConfigurator 
> handleSerialFactory
> INFO: Serialization provider : class 
> org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
> Sep 13, 2007 12:45:28 PM 
> org.apache.myfaces.webapp.DefaultFacesInitializer initFaces
> INFO: ServletContext '/var/lib/apache-tomcat/webapps/test9/' initialized.
> Sep 13, 2007 12:45:38 PM com.sun.facelets.compiler.TagLibraryConfig 
> loadImplicit
> INFO: Added Library from: 
> jar:file:/var/lib/apache-tomcat/webapps/test9/WEB-INF/lib/jsf-facelets-1.1.13.jar!/META-INF/jstl-core.taglib.xml

> 
> Sep 13, 2007 12:45:38 PM com.sun.facelets.compiler.TagLibraryConfig 
> loadImplicit
> INFO: Added Library from: 
> jar:file:/var/lib/apache-tomcat/webapps/test9/WEB-INF/lib/jsf-facelets-1.1.13.jar!/META-INF/jsf-core.taglib.xml

> 
> Sep 13, 2007 12:45:38 PM com.sun.facelets.compiler.TagLibraryConfig 
> loadImplicit
> INFO: Added Library from: 
> jar:file:/var/lib/apache-tomcat/webapps/test9/WEB-INF/lib/jsf-facelets-1.1.13.jar!/META-INF/jstl-fn.taglib.xml

> 
> Sep 13, 2007 12:45:38 PM com.sun.facelets.compiler.TagLibraryConfig 
> loadImplicit
> INFO: Added Library from: 
> jar:file:/var/lib/apache-tomcat/webapps/test9/WEB-INF/lib/jsf-facelets-1.1.13.jar!/META-INF/jsf-html.taglib.xml

> 
> Sep 13, 2007 12:45:38 PM com.sun.facelets.compiler.TagLibraryConfig 
> loadImplicit
> INFO: Added Library from: 
> jar:file:/var/lib/apache-tomcat/webapps/test9/WEB-INF/lib/jsf-facelets-1.1.13.jar!/META-INF/jsf-ui.taglib.xml

> 
> 
> 
> 
> However, if I add the dependency the log looks like this:
> 
> 
> 
> INFO: Deploying web application archive test10.war
> Sep 13, 2007 12:49:04 PM 
> org.apache.myfaces.webapp.DefaultFacesInitializer initFaces
> SEVERE: Error initializing MyFaces: null
> java.lang.NullPointerException
>        at 
> org.apache.myfaces.webapp.DefaultFacesInitializer.initFaces(DefaultFacesInitializer.java:102)

> 
>        at 
> org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:57)

> 
>        at 
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) 
> 
>        at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
>        at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 
> 
>        at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>        at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
>        at 
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
>        at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:515)
>        at 
> org.apache.catalina.startup.HostConfig.check(HostConfig.java:1220)
>        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:597)
>        at 
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) 
> 
>        at 
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)

> 
>        at 
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
>        at 
> org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1458)
>        at 
> org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:641)
>        at 
> org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:428)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>        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 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
> 
>        at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
> 
>        at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)

> 
>        at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 
> 
>        at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
> 
>        at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
> 
>        at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
>        at 
> org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852) 
> 
>        at 
> org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)

> 
>        at 
> org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
>        at java.lang.Thread.run(Thread.java:619)
> 
> 
> The dependency contains just two classes and nothing else.  It's added 
> with a runtime scope like this to the webapp pom:
> 
>        <dependency>
>            <groupId>com.pyramidetechnologies.presentation.jsf</groupId>
>            <artifactId>faceletsBaselineComponent</artifactId>
>            <version>2.0.0</version>
>            <scope>runtime</scope>
>        </dependency>
> 
> I removed the META-INF directory and bumped the version to 2.0.0, making 
> sure that the war contains a clean version of the jar.  Does anyone know 
> why adding a dependency causes an NPE?
> 
> Thanks,
> - Ole
> 
> 
> 
> 

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


Mime
View raw message