gpt4 book ai didi

java - 从 tomcat 7 升级到 tomcat8.5.41 部署失败

转载 作者:行者123 更新时间:2023-11-28 23:12:08 27 4
gpt4 key购买 nike

我从tomcat7换成了tomcate8.5.41在其上部署我的应用程序时失败 java code for login bean

这一行抛出异常

private static Logger logger = (Logger) LoggerFactory.getLogger(LoginBean.class);

我使用 primefaces 7 jsf 2.2.6

我认为原因之一是日志模块的问题

我尝试添加以下依赖项,但也不起作用

我尝试添加日志依赖,但也不起作用

 <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>

INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/mySharedData/Mokalmat/WorkSpaces/EclipseWorkSpace/VAS_prime_7_ws/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/ConfigurationWebTool/WEB-INF/lib/slf4j-simple-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/mySharedData/Mokalmat/WorkSpaces/EclipseWorkSpace/VAS_prime_7_ws/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/ConfigurationWebTool/WEB-INF/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: The requested version 1.5.8 by your slf4j binding is not compatible with [1.6, 1.7]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
Jun 12, 2019 3:02:57 PM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:449)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
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.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.faces.FacesException: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:508)
at com.sun.faces.config.processor.AbstractConfigProcessor.processAnnotations(AbstractConfigProcessor.java:402)
at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:340)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:239)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:435)
... 10 more
Caused by: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:504)
... 17 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at com.sun.faces.util.Util.loadClass(Util.java:325)
at com.sun.faces.config.AnnotationScanner.processClassList(AnnotationScanner.java:309)
at com.sun.faces.config.JavaClassScanningAnnotationScanner.getAnnotatedClasses(JavaClassScanningAnnotationScanner.java:128)
at com.sun.faces.config.DelegatingAnnotationProvider.getAnnotatedClasses(DelegatingAnnotationProvider.java:85)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:932)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:884)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:383)
... 10 more
Caused by: java.lang.ClassCastException: org.slf4j.impl.SimpleLogger cannot be cast to ch.qos.logback.classic.Logger
at com.vis.vasplatform.web.configuration.beans.LoginBean.<clinit>(LoginBean.java:42)
... 20 more

Jun 12, 2019 3:02:57 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: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:273)
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.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:449)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
... 9 more
Caused by: javax.faces.FacesException: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:508)
at com.sun.faces.config.processor.AbstractConfigProcessor.processAnnotations(AbstractConfigProcessor.java:402)
at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:340)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:239)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:435)
... 10 more
Caused by: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:504)
... 17 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at com.sun.faces.util.Util.loadClass(Util.java:325)
at com.sun.faces.config.AnnotationScanner.processClassList(AnnotationScanner.java:309)
at com.sun.faces.config.JavaClassScanningAnnotationScanner.getAnnotatedClasses(JavaClassScanningAnnotationScanner.java:128)
at com.sun.faces.config.DelegatingAnnotationProvider.getAnnotatedClasses(DelegatingAnnotationProvider.java:85)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:932)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:884)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:383)
... 10 more
Caused by: java.lang.ClassCastException: org.slf4j.impl.SimpleLogger cannot be cast to ch.qos.logback.classic.Logger
at com.vis.vasplatform.web.configuration.beans.LoginBean.<clinit>(LoginBean.java:42)
... 20 more

.......




Jun 12, 2019 3:02:59 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.
Jun 12, 2019 3:02:59 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:1135)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:379)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:142)
at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:310)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4817)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5474)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

I tried to add the following dependency and also not working

<dependency> -->
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>

INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/mySharedData/Mokalmat/WorkSpaces/EclipseWorkSpace/VAS_prime_7_ws/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/ConfigurationWebTool/WEB-INF/lib/slf4j-simple-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/mySharedData/Mokalmat/WorkSpaces/EclipseWorkSpace/VAS_prime_7_ws/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/ConfigurationWebTool/WEB-INF/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: The requested version 1.5.8 by your slf4j binding is not compatible with [1.6, 1.7]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
Jun 12, 2019 3:02:57 PM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:449)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
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.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.faces.FacesException: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:508)
at com.sun.faces.config.processor.AbstractConfigProcessor.processAnnotations(AbstractConfigProcessor.java:402)
at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:340)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:239)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:435)
... 10 more
Caused by: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:504)
... 17 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at com.sun.faces.util.Util.loadClass(Util.java:325)
at com.sun.faces.config.AnnotationScanner.processClassList(AnnotationScanner.java:309)
at com.sun.faces.config.JavaClassScanningAnnotationScanner.getAnnotatedClasses(JavaClassScanningAnnotationScanner.java:128)
at com.sun.faces.config.DelegatingAnnotationProvider.getAnnotatedClasses(DelegatingAnnotationProvider.java:85)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:932)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:884)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:383)
... 10 more
Caused by: java.lang.ClassCastException: org.slf4j.impl.SimpleLogger cannot be cast to ch.qos.logback.classic.Logger
at com.vis.vasplatform.web.configuration.beans.LoginBean.<clinit>(LoginBean.java:42)
... 20 more

Jun 12, 2019 3:02:57 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: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:273)
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.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:449)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
... 9 more
Caused by: javax.faces.FacesException: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:508)
at com.sun.faces.config.processor.AbstractConfigProcessor.processAnnotations(AbstractConfigProcessor.java:402)
at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:340)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:239)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:435)
... 10 more
Caused by: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:504)
... 17 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at com.sun.faces.util.Util.loadClass(Util.java:325)
at com.sun.faces.config.AnnotationScanner.processClassList(AnnotationScanner.java:309)
at com.sun.faces.config.JavaClassScanningAnnotationScanner.getAnnotatedClasses(JavaClassScanningAnnotationScanner.java:128)
at com.sun.faces.config.DelegatingAnnotationProvider.getAnnotatedClasses(DelegatingAnnotationProvider.java:85)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:932)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:884)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:383)
... 10 more
Caused by: java.lang.ClassCastException: org.slf4j.impl.SimpleLogger cannot be cast to ch.qos.logback.classic.Logger
at com.vis.vasplatform.web.configuration.beans.LoginBean.<clinit>(LoginBean.java:42)
... 20 more

.......


SEVERE: Unable to load annotated class: com.vis.vasplatform.web.configuration.beans.LoginBean, reason: java.lang.NoClassDefFoundError: Could not initialize class com.vis.vasplatform.web.configuration.beans.LoginBean
Jun 12, 2019 3:02:59 PM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
java.lang.StackOverflowError
at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:261)
at java.lang.ThreadLocal.get(ThreadLocal.java:146)
at javax.faces.context.FacesContext.getCurrentInstance(FacesContext.java:897)
at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:798)
at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:793)
at javax.faces.FactoryFinder$FactoryManagerCache.access$100(FactoryFinder.java:768)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:377)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:142)


Jun 12, 2019 3:02:59 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.StackOverflowError
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:273)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5236)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.StackOverflowError
at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:261)
at java.lang.ThreadLocal.get(ThreadLocal.java:146)
at javax.faces.context.FacesContext.getCurrentInstance(FacesContext.java:897)
at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:798)
at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:793)
at javax.faces.FactoryFinder$FactoryManagerCache.access$100(FactoryFinder.java:768)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:377)




Jun 12, 2019 3:02:59 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
Jun 12, 2019 3:02:59 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/ConfigurationWebTool] startup failed due to previous errors
Jun 12, 2019 3:02:59 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class [com.sun.faces.config.ConfigureListener]
java.lang.StackOverflowError
at org.apache.catalina.security.SecurityUtil.isPackageProtectionEnabled(SecurityUtil.java:425)
at org.apache.catalina.core.ApplicationContextFacade.getAttribute(ApplicationContextFacade.java:375)
at org.apache.catalina.core.StandardContext$NoPluggabilityServletContext.getAttribute(StandardContext.java:6599)
at com.sun.faces.context.ApplicationMap.get(ApplicationMap.java:97)
at javax.faces.FactoryFinder$FactoryManagerCacheKey.<init>(FactoryFinder.java:939)
at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:801)
at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:793)
at javax.faces.FactoryFinder$FactoryManagerCache.access$100(FactoryFinder.java:768)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:377)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:142)

.......

Jun 12, 2019 3:02:59 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.
Jun 12, 2019 3:02:59 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:1135)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:379)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:142)
at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:310)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4817)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5474)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

最佳答案

问题出在您的 LoginBean 类的以下几行

import org.slf4j.LoggerFactory; 
import ch.qos.logback.classic.Logger;

...

private static Logger logger = (Logger) LoggerFactory.getLogger(LoginBean.class);

Logger 类是一个“logback”类。

LoggerFactory 类是一个“slf4j”类。

getLogger 方法返回某个类的实例,该实例实现了 org.slf4j.Logger 而不是 ch.qos.logback.classic.Logger .您不能在此处使用类型转换,因为这两个类不相关。

你不能像这样混合使用 slf4j 和 logback。您需要在代码中选择使用 slf4j API 还是 logback API。

我不知道该推荐哪个,因为您共享的少量代码并不能解释为什么您选择将 logger 声明为 logback Logger

但无论哪种方式,导致 ClassCastException 的问题都在您的代码中,而不是在 Tomcat 或您的 servlet 配置中。可能还有其他问题(例如,运行时有多个 slf4j 日志记录提供程序),但这个是一个阻碍。

关于java - 从 tomcat 7 升级到 tomcat8.5.41 部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56562644/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com