This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Warning: Resource reference is not defined for JNDI name  RSS feed

 
tumbleweed and gunslinger
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting the above message when using the following code:



It works, but I get this message in the log:



However, you may note that the jndiContext isn't in the proper format which should be:



When I use this jndiContextValue, I get NullPointerExceptions when I perform a DataSource.getConnection() call.

I'm using: Sun ONE Application Server 7.0.0_04
 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the <resource-ref> element to declare a web application's reference to an
external resource.

For example:
 
David Yutzy
tumbleweed and gunslinger
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not post this, but I already have this in my web.xml



I even created a sun-web.xml, but it didn't seem to have any effect:

 
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a) your res-ref-name needs to start with java:comp/env
b) make sure you also bind that reference to your jdbc name. WSAD is very nice in doing this, but you otherwise likely need to do it with the AAT. It will end up in your ibm-web-bnd.xmi file.
 
David Yutzy
tumbleweed and gunslinger
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


a) your res-ref-name needs to start with java:comp/env



Really? Every example I found doesn't have this syntax in either the web.xml or the sun-web.xml. It DOES have this syntax when you try to get it from the Context...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!