geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JohnSimpson <john.a.simp...@bankofamerica.com>
Subject Re: DataSource, JNDI and EJB module ...
Date Thu, 16 Aug 2007 13:42:37 GMT


Thanks for the help, I have made some progress in that the app now deploys. 
However, when I try and access the datasource from the app it throws an
exception.
The lookup code is:

InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:/comp/env/jdbc/DataSource");

The stack trace is:

javax.naming.NamingException: Could not look up : env/jdbc/DataSource [Root
exception is java.lang.IllegalStateException: Could not get proxy]
        at
org.apache.geronimo.naming.enc.CachingReference.resolveReference(CachingReference.java:59)
        at
org.apache.geronimo.naming.enc.CachingReference.get(CachingReference.java:45)
        at
org.apache.geronimo.naming.enc.AbstractReadOnlyContext.lookup(AbstractReadOnlyContext.java:86)
        at
org.apache.geronimo.naming.java.RootContext.lookup(RootContext.java:55)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)
        at boa.isd.mdm.batch.BatchTest.main(BatchTest.java:49)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.geronimo.client.AppClientContainer.main(AppClientContainer.java:143)
        at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
        at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:835)
        at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178)
        at
org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLine.java:90)
        at
org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientCommandLine.java:71)
        at
org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandLine.java:46)
Caused by: java.lang.IllegalStateException: Could not get proxy        at
org.apache.geronimo.naming.reference.ResourceReference.getContent(ResourceReference.java:55)
        at
org.apache.geronimo.naming.enc.CachingReference.resolveReference(CachingReference.java:55)
        ... 14 more
Caused by: org.apache.geronimo.kernel.GBeanNotFoundException:
geronimo.server:J2
EEApplication=null,J2EEServer=geronimo,JCAResource=console/MDMDB2/1.0/jar,j2eeTy
pe=JCAManagedConnectionFactory,name=MDMDB2 not found
        at
org.apache.geronimo.kernel.basic.BasicRegistry.getGBeanInstance(BasicRegistry.java:110)
        at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:177)
        at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:173)
        at
org.apache.geronimo.naming.reference.ResourceReference.getContent(ResourceReference.java:53)
        ... 15 more

The GBeanNotFoundException seems to imply that either the datasource does
not exist on the server or the client can't access it.  Given that the
datasource shows up on all the appropriate panels in the server admin area
and is used successfully by a web-app, I think that the second case applies. 
However, I don't know how to go about allowing access from the client app or
whether it is possible.
Sorry to keep going on about this, but it's got me totally stumped. 

Thanks,

john

-- 
View this message in context: http://www.nabble.com/DataSource%2C-JNDI-and-EJB-module-...-tf4090122s134.html#a12181535
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message