[
https://issues.apache.org/jira/browse/OPENEJB-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jean-Louis MONTEIRO closed OPENEJB-412.
---------------------------------------
Resolution: Unresolved
2.2 codebase no more supported
> JNDI lookup on non-existing names throws wrong exception
> --------------------------------------------------------
>
> Key: OPENEJB-412
> URL: https://issues.apache.org/jira/browse/OPENEJB-412
> Project: OpenEJB
> Issue Type: Bug
> Affects Versions: 2.2
> Reporter: Jarek Gawor
>
> JNDI lookup on non-existing names should throw a
> javax.naming.NameNotFoundException. However, a ClassCastException is thrown
> (on the client):
> java.lang.ClassCastException: java.lang.IllegalArgumentException
> at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:249)
> at javax.naming.InitialContext.lookup(InitialContext.java:351)
> On the server-side (in this case Geronimo server (from trunk) outputs):
> 13:51:22,515 ERROR [JndiRequestHandler] JNDI request error
> java.lang.IllegalArgumentException: uri path must be in the form
> [groupId]/[arti
> factId]/[version]/[type] : /Foo
> at
> org.apache.geronimo.gbean.AbstractNameQuery.<init>(AbstractNameQuery.
> java:104)
> at
> org.apache.openejb.DeploymentIndex.getDeploymentIndex(DeploymentIndex
> .java:178)
> at
> org.apache.openejb.DeploymentIndex$$FastClassByCGLIB$$b865ce7c.invoke
> (<generated>)
> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> at
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethod
> Invoker.java:38)
> ....
> Sample client program:
> Properties p = new Properties();
>
> p.put("java.naming.factory.initial",
> "org.apache.openejb.client.RemoteInitialContextFactory");
> p.put("java.naming.provider.url",
> "127.0.0.1:4201");
> p.put("java.naming.security.principal",
> "myuser");
> p.put("java.naming.security.credentials",
> "mypass");
>
> InitialContext ctx = new InitialContext(p);
>
> try {
> Object obj = ctx.lookup("/Foo");
> System.out.println(obj);
> } catch (Exception e) {
> e.printStackTrace();
> }
> This problem has been reported before and contains a (old) patch:
> http://issues.apache.org/jira/browse/GERONIMO-2297
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira