You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by "Carragher Jr, Richard" <ri...@sap.com> on 2007/01/05 02:03:41 UTC

JNDI Access Problem

Hi,

I'm trying to deploy a non-j2ee application client connecting to a
stateless session bean in Geronimo 1.1.  This seems simple, and it has
worked without changes on WebSphere, Jboss, and WebLogic, so I'm pretty
sure that I'm setting something up in Geronimo incorrectly.

In open-ejb-jar.xml, I have the following snippet:

 <session>
         <ejb-name>Controller</ejb-name>
         <jndi-name>awc</jndi-name>
         <local-jndi-name>ControllerLocal</local-jndi-name>
		 <gernaming:resource-ref>
	
<gernaming:ref-name>jdbc/datasourceUri</gernaming:ref-name>
 
<gernaming:resource-link>jdbc/transactionwareDataSource</gernaming:resou
rce-link>
		 </gernaming:resource-ref>
      </session>

My client has the following properties setup:
java.naming.factory.initial=org.openejb.client.RemoteInitialContextFacto
ry
java.naming.provider.url=localhost:4201
java.naming.security.principal=system
java.naming.security.credentials=manager
And the client lookup code is pretty straightforward:
InitialContext jndiContext = new InitialContext(env);
Object ref = jndiContext.lookup("awc");
ControllerRemoteHome home = (ControllerRemoteHome)
PortableRemoteObject.narrow(ref, ControllerRemoteHome.class);
Here's the exception I get in geronimo.out:
19:46:54,233 ERROR [JndiRequestHandler] JNDI request error
java.lang.IllegalArgumentException
	at java.net.URI.create(URI.java:859)
	at
org.openejb.ContainerIndex.getContainerIndex(ContainerIndex.java:207)
	at
org.openejb.ContainerIndex$$FastClassByCGLIB$$6674ccb6.invoke(<generated
>)
	at
net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java(Inlined Compiled
Code))
	at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInv
oker.java(Compiled Code))
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.j
ava(Inlined Compiled Code))
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.jav
a(Compiled Code))
	at
org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java(Inli
ned Compiled Code))
	at
org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperation
Invoker.java(Compiled Code))
	at
org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyM
ethodInterceptor.java(Compiled Code))
	at
org.openejb.ContainerIndex$$EnhancerByCGLIB$$2edf4a7f.getContainerIndex(
<generated>)
	at
org.openejb.server.ejbd.JndiRequestHandler.doLookup(JndiRequestHandler.j
ava:178)
	at
org.openejb.server.ejbd.JndiRequestHandler.processRequest(JndiRequestHan
dler.java:115)
	at org.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:154)
	at org.openejb.server.ejbd.EjbServer.service(EjbServer.java:87)
	at
org.openejb.server.ejbd.EjbServer$$FastClassByCGLIB$$d379d2ff.invoke(<ge
nerated>)
	at
net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java(Inlined Compiled
Code))
	at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInv
oker.java(Compiled Code))
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.j
ava(Inlined Compiled Code))
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.jav
a(Compiled Code))
	at
org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java(Inli
ned Compiled Code))
	at
org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperation
Invoker.java(Compiled Code))
	at
org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyM
ethodInterceptor.java(Compiled Code))
	at
org.activeio.xnet.ServerService$$EnhancerByCGLIB$$eb95fe48.service(<gene
rated>)
	at org.activeio.xnet.ServicePool$2.run(ServicePool.java:67)
	at org.activeio.xnet.ServicePool$3.run(ServicePool.java:90)
	at
org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:172)
	at
org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(Threa
dPool.java:289)
	at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
	at java.lang.Thread.run(Thread.java:568)
Caused by: java.net.URISyntaxException: Illegal character in path at
index 1: /"awc"
	at java.net.URI$Parser.fail(URI.java:2764)
	at java.net.URI$Parser.checkChars(URI.java(Inlined Compiled
Code))
	at java.net.URI$Parser.parseHierarchical(URI.java(Compiled
Code))
	at java.net.URI$Parser.parse(URI.java(Compiled Code))
	at java.net.URI.<init>(URI.java:595)
	at java.net.URI.create(URI.java:857)
	... 29 more
I've tried all variations of the jndi name in my client, but none seem
to work.  Any thoughts or ideas?

Thanks,
Rick Carragher 




Re: JNDI Access Problem

Posted by David Jencks <da...@yahoo.com>.
On Jan 4, 2007, at 8:03 PM, Carragher Jr, Richard wrote:

> Hi,
>
> I'm trying to deploy a non-j2ee application client connecting to a  
> stateless session bean in Geronimo 1.1.  This seems simple, and it  
> has worked without changes on WebSphere, Jboss, and WebLogic, so  
> I'm pretty sure that I’m setting something up in Geronimo incorrectly.
>
>
> In open-ejb-jar.xml, I have the following snippet:
>
>  <session>
>          <ejb-name>Controller</ejb-name>
>          <jndi-name>awc</jndi-name>
>          <local-jndi-name>ControllerLocal</local-jndi-name>
>                  <gernaming:resource-ref>
>                     <gernaming:ref-name>jdbc/datasourceUri</ 
> gernaming:ref-name>
>             <gernaming:resource-link>jdbc/ 
> transactionwareDataSource</gernaming:resource-link>
>                  </gernaming:resource-ref>
>       </session>
>
> My client has the following properties setup:
> java.naming.factory.initial=org.openejb.client.RemoteInitialContextFac 
> tory
> java.naming.provider.url=localhost:4201
> java.naming.security.principal=system
> java.naming.security.credentials=manager
> And the client lookup code is pretty straightforward:
> InitialContext jndiContext = new InitialContext(env);
> Object ref = jndiContext.lookup("awc");
> ControllerRemoteHome home = (ControllerRemoteHome)  
> PortableRemoteObject.narrow(ref, ControllerRemoteHome.class);
> Here's the exception I get in geronimo.out:
> 19:46:54,233 ERROR [JndiRequestHandler] JNDI request error
> java.lang.IllegalArgumentException
>         at java.net.URI.create(URI.java:859)
>         at org.openejb.ContainerIndex.getContainerIndex 
> (ContainerIndex.java:207)
>         at org.openejb.ContainerIndex$$FastClassByCGLIB$ 
> $6674ccb6.invoke(<generated>)
>         at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java 
> (Inlined Compiled Code))
>         at  
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke 
> (FastMethodInvoker.java(Compiled Code))
>         at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke 
> (GBeanOperation.java(Inlined Compiled Code))
>         at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke 
> (GBeanInstance.java(Compiled Code))
>         at org.apache.geronimo.gbean.runtime.RawInvoker.invoke 
> (RawInvoker.java(Inlined Compiled Code))
>         at  
> org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke 
> (RawOperationInvoker.java(Compiled Code))
>         at  
> org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept 
> (ProxyMethodInterceptor.java(Compiled Code))
>
>         at org.openejb.ContainerIndex$$EnhancerByCGLIB$ 
> $2edf4a7f.getContainerIndex(<generated>)
>         at org.openejb.server.ejbd.JndiRequestHandler.doLookup 
> (JndiRequestHandler.java:178)
>         at org.openejb.server.ejbd.JndiRequestHandler.processRequest 
> (JndiRequestHandler.java:115)
>         at org.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java: 
> 154)
>         at org.openejb.server.ejbd.EjbServer.service(EjbServer.java: 
> 87)
>         at org.openejb.server.ejbd.EjbServer$$FastClassByCGLIB$ 
> $d379d2ff.invoke(<generated>)
>         at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java 
> (Inlined Compiled Code))
>         at  
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke 
> (FastMethodInvoker.java(Compiled Code))
>         at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke 
> (GBeanOperation.java(Inlined Compiled Code))
>         at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke 
> (GBeanInstance.java(Compiled Code))
>         at org.apache.geronimo.gbean.runtime.RawInvoker.invoke 
> (RawInvoker.java(Inlined Compiled Code))
>         at  
> org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke 
> (RawOperationInvoker.java(Compiled Code))
>         at  
> org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept 
> (ProxyMethodInterceptor.java(Compiled Code))
>
>         at org.activeio.xnet.ServerService$$EnhancerByCGLIB$ 
> $eb95fe48.service(<generated>)
>         at org.activeio.xnet.ServicePool$2.run(ServicePool.java:67)
>         at org.activeio.xnet.ServicePool$3.run(ServicePool.java:90)
>         at org.apache.geronimo.pool.ThreadPool$1.run 
> (ThreadPool.java:172)
>         at org.apache.geronimo.pool.ThreadPool 
> $ContextClassLoaderRunnable.run(ThreadPool.java:289)
>         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor 
> $Worker.run(Unknown Source)
>         at java.lang.Thread.run(Thread.java:568)
> Caused by: java.net.URISyntaxException: Illegal character in path  
> at index 1: /"awc"
>         at java.net.URI$Parser.fail(URI.java:2764)
>         at java.net.URI$Parser.checkChars(URI.java(Inlined Compiled  
> Code))
>         at java.net.URI$Parser.parseHierarchical(URI.java(Compiled  
> Code))
>         at java.net.URI$Parser.parse(URI.java(Compiled Code))
>         at java.net.URI.<init>(URI.java:595)
>         at java.net.URI.create(URI.java:857)
>         ... 29 more
> I've tried all variations of the jndi name in my client, but none  
> seem to work.  Any thoughts or ideas?

I dont see anything wrong with your setup.  The lookup should have  
succeeded in line 175 of JndiRequestHandler.  Is there any chance you  
could debug the call to ContainerIndex.getContainerIndexByJndiName  
and see what is in jndiNameToIndex and what the jndi name parameter is ?

Wish I could help better
david jencks

> Thanks,
> Rick Carragher
>
>