• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in context lookup

 
siddharth paul
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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)
.....
.....

 
vamsheedhar devarishati
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • 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 ...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic