| Author |
JNDI Lookup of Datasource
|
Edmund Yong
Ranch Hand
Joined: Nov 16, 2003
Posts: 164
|
|
We have a datasource called DBPool defined in a WebLogic server. On the same server, we want to run a stand-alone program to access the same datasource. The stand-alone program uses Spring/Hibernate for the database access. In this stand-alone program, we defined the following: <bean id="MyDBPool" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="resourceRef"> <value>true</value> </property> <property name="jndiName"> <value>DBPool</value> </property> </bean> When this stand-alone program runs, it will fail in the JNDI lookup. In general, is it possible for a stand-alone program to do a JNDI lookup for a datasource defined in a WebLogic server? Thanks.
|
SCJP 1.2, SCWCD 1.4
|
 |
Emanuel Kadziela
Ranch Hand
Joined: Mar 24, 2005
Posts: 93
|
|
|
Is this standalone program able to lookup any other JNDI resources?
|
 |
Chris Mathews
Ranch Hand
Joined: Jul 18, 2001
Posts: 2712
|
|
You are running this application outside the context of WebLogic right? So you need to provide addtional information for Spring to do the JNDI lookup... like where to look for the WebLogic Server. The username/password properties would only be required if you are accessing a resource that is secured in WebLogic... in other words it depends on your particular configuration.
|
 |
 |
|
|
subject: JNDI Lookup of Datasource
|
|
|