• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

JNDI Lookup of Datasource

 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this standalone program able to lookup any other JNDI resources?
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!