0
I have a JSF + Primefaces application that runs smoothly in the development environment. But when it comes to deploying . War in Tomcat, in production, I can’t. The error in the logs is:
java.lang.IllegalStateException: CDI BeanManager instance is not available in JNDI.
References to omnifaces in the project are:
import org.omnifaces.util.Faces;
(in some Beans)
<resource-handler>org.omnifaces.resourcehandler.CombinedResourceHandler</resource-handler>
(faces-config)
Can someone help me?
Version Tomcat 8.8.42. OS: Ubuntu 16.04
Error stack:
SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.omnifaces.ApplicationListener]
java.lang.ExceptionInInitializerError
at org.omnifaces.ApplicationListener.checkCDIAvailable(ApplicationListener.java:63)
at org.omnifaces.ApplicationListener.contextInitialized(ApplicationListener.java:55)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4770)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5236)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1414)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1378)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1613)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1170)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1364)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: CDI BeanManager instance is not available in JNDI.
at org.omnifaces.config.BeanManager.<init>(BeanManager.java:106)
at org.omnifaces.config.BeanManager.<clinit>(BeanManager.java:49)
... 15 more
You probably have conflicting/duplicate libs in the server classpath, I suggest validating the constant libs in the classpath as well as those sent with your application
– nullptr
Thanks for the tip. But you can explain better how I do to locate possible conflicts hi duplicities?
– Rafael Laranjeiras