• 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
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Weblogic JNDI

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to setup a JNDI datasource in Spring's applicationContext.xml file but I get the following error:



I'm using Spring 1.2, Hibernate 3, MySql, and Weblogic 8.1.

My applicationContext.xml file:



I know the JNDI name is valid because I can get a connection in a main code.


Any ideas?

thanks in advance.

Yoo-Jin
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had two issues when trying to do the same. The first was the provider complaining that I didn't have a usable context. I fixed this by explicitly creating a JndiTemplate and configuring it with the usual JNDI context stuff. (Maybe because I'm running Weblogic at port 7011???)

At this point, I started getting the same error you did. On a long shot, I dropped the resource-ref param so that JndiObjectFactoryBean wouldn't supplement my jndiName with "java:comp/env/", since I don't supply this myself when manually getting a datasource. It worked. In the end, my key beans looks like this:



Maybe it'll work for you too...
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, 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!