Sushil,

As it turns out, this is really a Spring question... I encountered a
similar problem (see http://preview.tinyurl.com/2gge34) all you need to
do is, set the reference-ref property of
JndiObjectFactoryBean to true:

<bean id="the_dataSource"
                class="org.springframework.jndi.JndiObjectFactoryBean">
                <property name="jndiName" value="myJDBC" /> 
                        <property name="resourceRef">
                        <value>true</value>
                    </property> 
</bean>

The explanation can be found in Spring JavaDoc:

http://static.springframework.org/spring/docs/2.5.x/api/org/springframew
ork/jndi/JndiObjectFactoryBean.html

then you should be able to use the same configuration in WL and Tomcat.

I hope this helps.

Florian

-----Original Message-----
From: Sureka, Sushil [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 05, 2008 6:33 PM
To: Tomcat Users List
Subject: Defining JDBC Data source

We are trying to port an application from Weblogic to Tomcat. Our JDBC
entry looks like this

<bean id="the_dataSource"
                class="org.springframework.jndi.JndiObjectFactoryBean">
                <property name="jndiName" value="myJDBC" /> </bean>

The weblogic works fine with setup. The jdbc datasource is setup through
weblogic console.

On Tomcat, we noticed that we would have to modify the above entry like
this

<bean id="the_dataSource"
                class="org.springframework.jndi.JndiObjectFactoryBean">
                <property name="jndiName" value="java:/comp/env/myJDBC"
/>
</bean> 

But the above setup won't work for Weblogic. Any way we can reconcile
the difference. The Tomcat context.xml file contains an entry llike

<Context>

    <Resource name="myJDBC" auth="container" ...../>

</context>

Sushil


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to