• 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

Warning: Resource reference is not defined for JNDI name

 
tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic