I am using JBoss2.2.2 , I have an issue due DataSource
lookup failure. I have created a DataSource "WebNmsDB" (MySql) related
changes are made in conf file and is successful, here is message from console,
[JDBC provider] Starting
[JDBC provider] Started
[WebNmsDB] Starting
[WebNmsDB] XA Connection pool WebNmsDB bound to java:/WebNmsDB
[WebNmsDB] Started
[DefaultDS] Starting
....
....
....
Whenever I tried to lookup this DataSource in my client bean code , it fails ,
[J2EE Deployer Default] Starting
[J2EE Deployer Default] No web container found - only EJB deployment
available...
[J2EE Deployer Default] Cleaning up deployment directory
[J2EE Deployer Default] Started
[Auto deploy] Starting
[Auto deploy] Watching E:\JBoss-2.2.2\deploy
[Auto deploy] Auto deploy of file:/E:/JBoss-2.2.2/deploy/AlertSessionBean.jar
[J2EE Deployer Default] Deploy J2EE application: file:/E:/JBoss-2.2.2/deploy/AlertSessionBean.jar
[J2EE Deployer Default] Create application AlertSessionBean.jar
[J2EE Deployer Default] install module std_AlertSessionBean.jar
[Container factory] Deploying:file:/E:/JBoss-2.2.2/tmp/deploy/Default/AlertSessionBean.jar
[Verifier] Verifying file:/E:/JBoss-2.2.2/tmp/deploy/Default/AlertSessionBean.jar/ejb1001.jar
[Verifier] javax.naming.NameNotFoundException: env not bound
[Verifier] at org.jnp.server.NamingServer.getBinding(NamingServer.java:473)
[Verifier] at org.jnp.server.NamingServer.getBinding(NamingServer.java:481)
[Verifier] at org.jnp.server.NamingServer.getObject(NamingServer.java:487)
[Verifier] at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
[Verifier] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
[Verifier] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:457)
[Verifier] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
[Verifier] at javax.naming.InitialContext.lookup(InitialContext.java:350)
[Verifier] at fe.alert.ejb.AlertSessionEJB.<init>(AlertSessionEJB.java:47)
My client code for lookup datasource is as follows,
InitialContext ic = new InitialContext();
String dbName = "java:comp/env/jdbc/WebNmsDB";
DataSource ds = (DataSource) ic.lookup(dbName); /// This is the line
where lookup fails (AlertSessionEJB.java:47)
Give your suggestion to resolve this issue, I need the solution very urgently.
Thanks in advance,
Chithu