Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI look up for datasource

 
Amarakunthy Cox
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In the above code, once I execute it I get this error:
Exception Class =
java.lang.reflect.InvocationTargetException
Exception Stack =
java.lang.reflect.InvocationTargetException: javax.naming.NoInitialContextException: Cannot instantiate class: com.microsoft.jdbc.sqlserver.SQLServerDataSource. Root exception is java.lang.ClassNotFoundException: com.microsoft.jdbcx.sqlserver.SQLServerDataSource
I am trying to use Websphere 4.0 connection pooling feature using Microsoft SQL Server drivers.
I've created the jndi/datasource and set the classpath using Websphere's interface; used Websphere's "Test Connection" feature and it has passed.
I've checked that the datasource file that the error is indicating is in the *.jar. I've also tried another test by adding the system environment variable to point to the *jars, but still getting the same error.
Any help would be appreciated.

(Code tags added by Michael Morris)
[ April 23, 2004: Message edited by: Michael Morris ]
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amarakunthy,
Where is this client getting called from? If it is a client outside of the container, you will still need to make sure that the DataSource class is part of the classpath. Other than that, I haven't a clue.
 
Amarakunthy Cox
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nathaniel,
All the driver's *.jar files are set on the system environment variable. I have sat down and tried every place possible that I can think of and still the same problem.
Thanks for the suggestion though. Still hammering away ....
Amarakunthy
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem lies in your code. You don't specify the Datasource class as the InitialContext factory, you specify the InitialContext factory class instead!
The datasource class is specified when you set up the datasource in the admin screen. I STRONGLY suggest you take a look at the Infocenter documentation on setting up datasources. Also take a look at the WebSphere 4.0 programming handbook redbook for information on what class to use when calling an InitialContext.
Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic