Esotu com o seguinte problema: estou fazendo o deploy de uma aplicacao no websphere onde já exite um data source configurado, porem a minha aplicacao nao “encontra” esse data source. Meu log de erros eh segue abaixo.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbc/CondicoesGeraisDS' defined in ServletContext resource [/spring/spring-config-hibernate.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name not found in context "java:".
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(AccessController.java:224)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
Para consuimir o data souce tenho a seguinte tag em meu web.xml:
<resource-ref>
<description>Conexao para o SQL Server</description>
<res-ref-name>jdbc/CondicoesGeraisDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
No meu spring-config-hibernate.xml tenho:
<bean id="condicoesGeraisDS" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:/comp/env/jdbc/CondicoesGeraisDS</value>
</property>
</bean>
abrsss.