2013-02-20 89 views
0

我想用下面建立一個戰爭:javax.naming.NameNotFoundException:名稱java:comp不是在這種情況下勢必

  • Spring框架3.0.6
  • JSF 2.1.6
  • ICEfaces 3.1

spring的配置文件位於/conf/rb_conf.xml中。

GRAVE: Exception sending context initialized event to listener instance of class 
org.springframework.web.context.ContextLoaderListener 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/conf/rb_conf.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name java:comp is not bound in this Context 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) 
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) 
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) 
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) 
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282) 
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204) 
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) 
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) 
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) 
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:563) 
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1399) 
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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) 
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) 
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) 
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500) 
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:252) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:194) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) 
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) 
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600) 
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703) 
at java.lang.Thread.run(Thread.java:662) 
Caused by: javax.naming.NameNotFoundException: Name java:comp is not bound in this Context 
at org.apache.naming.NamingContext.lookup(NamingContext.java:770) 
... 

我一直在試圖解決這個問題,但沒有運氣,誰能幫助? 任何想法? 謝謝

回答

0

錯誤是在訪問某個名稱以「java:comp」開頭的JNDI資源期間發生的,並且該資源在服務器中不存在。您是否使用在服務器中配置的數據源?你使用什麼服務器?

+0

嗨我正在使用apache-tomcat-6.0.36。是的,我正在使用GlobalNamingResources中配置的數據源。資源的名稱是:mysqlPool – Mule 2013-02-20 18:14:42

+0

請發佈GlobalNamingResources片段和spring配置文件。 – viniciusjssouza 2013-02-20 18:25:03

+0

Mule 2013-02-21 15:42:51