javax.naming.NamingException: No naming context bound to this class loader

时间:2023-02-01 21:11:12

1、错误描述

警告: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/soa]] so no cleanup was performed for that container
javax.naming.NamingException: No naming context bound to this class loader
	at org.apache.naming.ContextBindings.getClassLoader(ContextBindings.java:350)
	at org.apache.catalina.deploy.NamingResources.cleanUp(NamingResources.java:985)
	at org.apache.catalina.deploy.NamingResources.stopInternal(NamingResources.java:968)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5702)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:272)
	at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1041)
	at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1234)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
	at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1041)
	at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1234)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
	at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:593)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
	at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:829)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:693)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)

2、错误原因

      在部署Java Web项目,添加到Tomcat中出现问题,没有部署好,导致错误。


3、解决办法

(1)关闭Tomcat服务器

(2)将Web项目从Tomcat移除,清除缓存

(3)最后,将项目重新部署到Tomcat中,启动Tomcat