• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JNDI Lookup of Datasource

 
Ranch Hand
Posts: 229
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic