0
votes

When I changed glassfish server to Apache tomcat then I got this error, how to fix it this error SEVERE: Critical error during deployment I am so tried but I am fail. I am new in jsf and primefaces

SEVERE: Critical error during deployment: java.lang.NoClassDefFoundError: com/sun/enterprise/InjectionException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:249) at com.sun.faces.util.Util.loadClass(Util.java:269) at com.sun.faces.spi.InjectionProviderFactory.getProviderFromEntry(InjectionProviderFactory.java:317) at com.sun.faces.spi.InjectionProviderFactory.findProviderClass(InjectionProviderFactory.java:285) at com.sun.faces.spi.InjectionProviderFactory.createInstance(InjectionProviderFactory.java:116) at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:335) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5099) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561) 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:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.InjectionException at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1891) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734) ... 18 more Aug 18, 2016 2:55:00 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sun/enterprise/InjectionException at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:290) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5099) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561) 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:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.NoClassDefFoundError: com/sun/enterprise/InjectionException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:249) at com.sun.faces.util.Util.loadClass(Util.java:269) at com.sun.faces.spi.InjectionProviderFactory.getProviderFromEntry(InjectionProviderFactory.java:317) at com.sun.faces.spi.InjectionProviderFactory.findProviderClass(InjectionProviderFactory.java:285) at com.sun.faces.spi.InjectionProviderFactory.createInstance(InjectionProviderFactory.java:116) at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:335) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) ... 10 more Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.InjectionException at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1891) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734) ... 18 more Aug 18, 2016 2:55:00 PM org.apache.catalina.core.StandardContext startInternal SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file Aug 18, 2016 2:55:00 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/TestJSF] startup failed due to previous errors Aug 18, 2016 2:55:00 PM javax.faces.FactoryFinder$FactoryManager getFactory SEVERE: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup. Aug 18, 2016 2:55:00 PM com.sun.faces.config.ConfigureListener contextDestroyed SEVERE: Unexpected exception when attempting to tear down the Mojarra runtime java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010) at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342) at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:141) at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:328) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5146) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5810) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571) at org.apache.catalinaa.core.ContainerBase$StartChild.call(ContainerBase.java:1561) 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:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Aug 18, 2016 2:55:00 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-6060"] Aug 18, 2016 2:55:00 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Aug 18, 2016 2:55:00 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 8611 ms

1

1 Answers

1
votes

Remember that Glassfish is an application server that supports JAVA EE while tomcat don't support this, a solution of apache org is apache TomEE.