当前位置: 代码迷 >> J2EE >> Name java:comp is not bound in this Context,该如何解决
  详细解决方案

Name java:comp is not bound in this Context,该如何解决

热度:73   发布时间:2016-04-22 00:51:21.0
Name java:comp is not bound in this Context
Java code
Caused by: javax.naming.NameNotFoundException: Name java:comp is not bound in this Context    at org.apache.naming.NamingContext.lookup(NamingContext.java:770)    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)    at javax.naming.InitialContext.lookup(InitialContext.java:392)    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:93)    at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)    at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:197)    at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:184)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1198)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)    at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:82)    at javax.servlet.GenericServlet.init(GenericServlet.java:212)    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)    at org.apache.catalina.core.StandardService.start(StandardService.java:516)    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)2012-3-19 14:32:49 org.apache.catalina.core.ApplicationContext log

web.xml配置:
Java code
  相关解决方案