Hi,
I am getting the following message when trying to lookup datasource:
-----------------------------------------------------------------------------------
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dataSource' defined in class path resource [com/package/name/commonBeanDefinition.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: While trying to look up /env/comp/datasource/ds in /app/ejb/testspring.jar#beanservicemdb.
-----------------------------------------------------------------------------------
bean definition:
-----------------------------------------------------------------------------------
...
<bean id="dsJndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.provider.url">t3://localhost:7001</prop>
<prop key="java.naming.factory.initial">weblogic.jndi.WL InitialContextFactory</prop>
</props>
</property>
</bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
<property name="jndiName">
<value>datasource/ds</value>
</property>
<property name="resourceRef">
<value>true</value>
</property>
<property name="jndiTemplate">
<ref local="dsJndiTemplate"/>
</property>
</bean>
...
-----------------------------------------------------------------------------------
I also tried adding jndi-name setting in weblogic-ejb-jar with no luck:
-----------------------------------------------------------------------------------
<weblogic-enterprise-bean>
..
<jndi-name>datasource/ds</jndi-name>
..
</weblogic-enterprise-bean>
-----------------------------------------------------------------------------------
JNDI Name:datasource/ds - defined in weblogic console
What am I missing? I am using weblogic 8.1 sp4, jdk 1.4.2
Thanks,
Mark.


Reply With Quote