JBoss Community

Re: lookup for remote bean - failure (only from eclipse)

created by JN JNC in EJB3 - View the full discussion

Hi,

 

Sorry for the late, I did some more tests. I only have in my test classpath jbossall-client.jar coming from the server I used.

 

Here is my server log regarding my EJB deployment:

 

2013-07-10 09:19:01,940 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) Created KernelDeployment for: MY_JAR.jar

2013-07-10 09:19:01,941 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) installing bean: jboss.j2ee:ear=MY_EAR.ear,jar=MY_JAR.jar,name=CallAtProcessingBean,service=EJB3

2013-07-10 09:19:01,941 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   with dependencies:

2013-07-10 09:19:01,941 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   and demands:

2013-07-10 09:19:01,941 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)           jboss.ejb:service=EJBTimerService

2013-07-10 09:19:01,942 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   and supplies:

2013-07-10 09:19:01,942 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)           jndi:MY_EAR/CallAtProcessingBean/local-com.mycomp.myorg.sb.OFSProcessingBeanLocal

2013-07-10 09:19:01,942 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)           Class:com.mycomp.myorg.sb.OFSProcessingBeanRemote

2013-07-10 09:19:01,942 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)           jndi:MY_EAR/CallAtProcessingBean/local

2013-07-10 09:19:01,942 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)           Class:com.mycomp.myorg.sb.OFSProcessingBeanLocal

2013-07-10 09:19:01,943 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)           jndi:MY_EAR/CallAtProcessingBean/remote

2013-07-10 09:19:01,943 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)           jndi:MY_EAR/CallAtProcessingBean/remote-com.mycomp.myorg.sb.OFSProcessingBeanRemote

2013-07-10 09:19:01,943 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) Added bean(jboss.j2ee:ear=MY_EAR.ear,jar=MY_JAR.jar,name=CallAtProcessingBean,service=EJB3) to KernelDeployment of: MY_JAR.jar

 

I don't know whether the mapping is correct or not, I supposed it is as it works when invoked from the server, but I could see from that trace that the sequence between local JNDI name and class name is "weird".

 

As I said as this test is working like a charm in 4.2, thus given the stacktrace:

 

Caused by: javax.naming.NameNotFoundException: ProxyFactory not bound

        at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

 

I tried to replace the jnpclient.jar with former version with no luck.

 

Then given the stacktrace

 

Caused by: java.lang.RuntimeException: Exception while trying to locate proxy factory in JNDI, at key ProxyFactory/....

        at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getProxyFactoryFromJNDI(ProxyObjectFactory.java:

        at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:157)

 

I get rid of jboss-ejb3-proxy-impl-client.jar in my client libraries.

 

And my test is going a bit further, it's not failing anymore but second assert fails.

 

        Object object = initialContext.lookup("MY_EAR/CallAtProcessingBean/remote");

        assertNotNull(object);

        assertTrue(object instanceof OFSProcessingBeanRemote);

 

Here is a debug view of "object", thus it seems mapping is correct.

 

Reference Class Name: Proxy for: com.mycomp.myorg.sb.OFSProcessingBeanRemote

Type: ProxyFactoryKey

Content: ProxyFactory/MY_EAR/CallAtProcessingBean/MY_EAR/CallAtProcessingBean/remote

Type: EJB Container Name

Content: jboss.j2ee:ear=MY_EAR.ear,jar=MY_JAR.jar,name=CallAtProcessingBean,service=EJB3

Type: Proxy Factory is Local

Content: false

Type: Remote Business Interface

Content: com.mycomp.myorg.sb.OFSProcessingBeanRemote

Type: Remoting Host URL

Content: socket://127.0.0.1:3873/

 

If I try to do the cast to my type I got, which I guess is expected without the proxy jar.

 

java.lang.ClassCastException: javax.naming.Reference cannot be cast to com.mycomp.myorg.sb.CallAtProcessingBeanRemote

 

Any thought about that ?

 

Best regards,

Jean-Noel

Reply to this message by going to Community

Start a new discussion in EJB3 at Community