Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF with facelets in Tomcat7

I am trying to deploy a JSF 2.0 application with Facelets 1.1.14 to Tomcat7. I am getting the following exceptions:

INFO: Initializing Mojarra 2.0.0 (FCS b23) for context '/AdminUI'

3 Aug, 2011 7:44:32 PM com.sun.faces.spi.InjectionProviderFactory createInstance

INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.
3 Aug, 2011 7:44:33 PM com.sun.faces.config.ConfigManager initialized
INFO: Unsanitized stacktrace from failed start...
java.lang.NullPointerException
        at com.sun.faces.util.Util.loadClass(Util.java:200)
        at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:312)
        at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:416)
        at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:370)
        at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:313)
        at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:262)
        at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:337)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:219)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
        at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
        at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
3 Aug, 2011 7:44:33 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
3 Aug, 2011 7:44:33 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/AdminUI] startup failed due to previous errors
3 Aug, 2011 7:44:33 PM com.sun.faces.config.ConfigureListener contextDestroyed
SEVERE: Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
        at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)
        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)
        at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:104)
        at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:305)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4763)
        at org.apache.catalina.core.StandardContext$4.run(StandardContext.java:5472)
        at java.lang.Thread.run(Thread.java:662)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5481)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:225)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)    
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:932)    
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:723)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)
        at java.lang.Thread.run(Thread.java:662)
3 Aug, 2011 7:44:33 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/AdminUI] appears to have started a thread named [Mojarra-ResourceCache-1-thread-1] but has failed to stop it. This is very likely to create a memory leak.

Iam having the following jars under/WEB-INF/lib/

activation-1.1.jar
antlr-2.7.6.jar
asm-3.1.jar
cglib-2.2.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
hibernate-commons-annotations-3.2.0.final.jar
hibernate-core-3.6.5.final.jar
hibernate-entitymanager-3.6.5.final.jar
hibernate-jpa-2.0-api-1.0.0.final.jar
hibernate-validator-4.0.2.GA.jar
javassist-3.12.0.jar
jaxb-api-2.1.jar
jaxb-impl-2.1.3.jar
jsf-api-2.0.jar
jsf-impl-2.0.0.jar
jta-1.1.jar
slf4j-api-1.6.1.jar
stax-api-1.0-2.jar

How to resolve this?

like image 299
Gnanam Avatar asked Dec 27 '22 16:12

Gnanam


1 Answers

JSF 2.0 ships with Facelets 2.0 bundled. The Facelets 1.x JAR file would only collide with this. You should remove the Facelets 1.x JAR file.

All JAR files you need for developing JSF 2.0 with Facelets on Tomcat are jsf-api.jar and jsf-impl.jar.

like image 171
BalusC Avatar answered Jan 11 '23 08:01

BalusC