简体   繁体   中英

javax.naming.NameNotFoundException when deploying WebAppp with JBoss/Spring and NetBeans

I'm new to both NetBeans and JBoss (been using Eclipse and Tomcat for years now) and I'm having problems deploying our new proyect. It seems that JBoss can't find the data source xml configuration file. I have copied that file (buzon-adaptiv-ds.xml) into Other Sources/setup folder inside my proyect in NetBeans and in the conf folders in JBoss Home folder.

Every time I try to Run the proyect I get a deployment fail error, what I can see from the stack trace is that Spring/JBoss can't find the configuration for the Data Source:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BuzonAdaptivCoreDS': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: BuzonAdaptivCoreDS not bound
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
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:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:546)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

BuzonAdaptivCoreDS is one of three data sources set with jndi-name inside the data source configuration file. The configuration (database url, user, pass, etc) is correctly set.

I'd apreciate any clues on why this could be happening, I realise this might be a dumb question but I'm still not sure how the JBoss-Spring-Hibernate intregration should work.

Thanks in advance.

You need to place your datasource xml file in the jboss/server/xxx/deploy folder. The same place you put your war files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM