| Author |
JNDI Lookup Portal problem
|
|
|
| I have used the following code in Web Application in WebSphere
try {
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/api");
Connection conn = ds.getConnection();
out.println(conn.getCatalog());
} catch (Exception exp) {
}
and it works but If I execute the same code in doView() method of JSR168 portlet, It gives me an exception
javax.naming.NameNotFoundException: jdbc/api. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
can anybody suggest me what should be done to get over this problem
Thank you
| |
|
|
I'll answer it by making some assumptions (you're using WAS 6.x and you previously added it only as an application in server1).
Seeing that you use the global jndi instead of 'java:comp/env/jdbc' my firsthand guess would be to check if the datasource itself is added to the WebSphere_Portal Application server.
If you're using RAD and added a server configuration for WPS 6.0 you could use the test cient to see if the JNDI are available for it.
/Jonas V
|
|
|
|