• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

error in context lookup

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When i am connecting to Sql server using following code.

I am getting this....
A Reference object looked up from the context "localhost/nodes/localhost/servers/server1" with the name "jdbc/ds1" was sent to the JNDI Naming Manager and an exception resulted.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If this code is running inside the container, there's no need to specify parameters when creating the initial context. Try creating the initial context without parameters. Example:
 
siddharth paul
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i ran with.

afraid to say still the same.
Below from WSAD console.


[2/3/09 15:27:22:201 IST] 505ecddf Helpers W NMSV0605W: A Reference object looked up from the context "localhost/nodes/localhost/servers/server1" with the name "jdbc/ds1" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
Reference Factory Class Name: com.ibm.websphere.advanced.cm.factory.DataSourceFactory$ResourceReferenceObjectFactory
Reference Factory Class Location URLs: <null>
......
......

Exception data follows:
javax.naming.NamingException: Attempted to use a 4.0 DataSource in EJB 2.0 Module. Invalid configuration.
at com.ibm.ejs.cm.DSFactoryImpl.verifyConfiguration(DSFactoryImpl.java:272)
.....
.....


 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure You added ref in Deployment Descriptor like this and make sure it is loaded when jvm starts.

<resource-ref id="ResourceRef_1126121987734">
<description></description>
<res-ref-name>jdbc/localds1</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

After server start up , be fore hitting the app , search for datasorce ...
 
permaculture is giving a gift to your future self. After reading this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic