• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Jboss 5 - @Resource dataSource versus direct lookup in Session Bean

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a stateless session bean (in ejb 3). If I use Dependency Injection of datasource it works perfectly.
But if I do direct lookup of datasource it does not work - it complains "jdbc not bound".
Can you help me here? How can it be that DI is able to find bound datasource while direct lookup is not able to do that?
Session bean along with its interface is in .jar file (and further it is in .ear file with .war file), while datsource XML file is deployed directly under default/deploy.
 
Varun Chopra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's working now after I changed datasource lookup name to java:myDS from java:comp/env/jdbc/myDS
But this was working fine under JBoss 4.2.2 with java:comp/env/jdbc/myDS and with EJB 2.1.
Is there a change in how JNDI names are referenced in JBoss 5 with ejb 3?
 
reply
    Bookmark Topic Watch Topic
  • New Topic