*
The moose likes Websphere and the fly likes WSAD looking up a  datasource from WAS 3.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "WSAD looking up a  datasource from WAS 3.5" Watch "WSAD looking up a  datasource from WAS 3.5" New topic
Author

WSAD looking up a datasource from WAS 3.5

Patricia Wu
Greenhorn

Joined: Sep 23, 2002
Posts: 5
Hello all,
I am new to using WSAD and wondering if it is possible to run a standalone program to lookup a datasource on a WebSphere 3.5 naming server.
After having changed the JRE to the plugin.server.jdk's one, the ClassNotFoundException is resolved, but when trying to cast the obj looked up to a DataSource type, it throws a ClassCastException.
The jndi name is "jdbc/MyDataSource".
It looks like I am getting javax.naming.Reference object.
So is it possible to look up a datasource inside of WSAD. Because my standalone program does work outside of WSAD after having installed the IBM JDK.

Please help.
Patricia Wu
Greenhorn

Joined: Sep 23, 2002
Posts: 5
I am still struggling with this problem, when I print out the Object I lookup from WAS3.5, It shows the following:
Reference Class Name: com.ibm.ejs.sm.beans.DataSourceBean$Reference
Type: driverType
Content: JDBC1.0
Type: databaseName
Content: @MyDBName:1521:MySID
Type: dataSourceName
Content: MyDataSourceName
Type: driverImplClass
Content: oracle.jdbc.driver.OracleDriver
Type: driverUrlPrefix
Content: jdbc racle:thin
Type: minPoolSize
Content: 1
Type: maxPoolSize
Content: 30
Type: connTimeout
Content: 300
Type: idleTimeout
Content: 1800
Type: orphanTimeout
Content: 1800
Type: description
Content:
Type: networkProtocol
Content:
Here is the staack trace if it is any helpful in analyzing the problem:
DataSource Lookup Error: java.lang.ClassCastException: javax.naming.Reference
java.lang.ClassCastException: javax.naming.Reference
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:253)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:136)
Please help.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: WSAD looking up a datasource from WAS 3.5