Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Warning: Resource reference is not defined for JNDI name

 
David Yutzy
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
 
Sheldon Fernandes
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:

 
David Hibbs
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic