[jboss-user] [EJB3] - Re: lookup for remote bean - failure (only from eclipse)
JN JNC
do-not-reply at jboss.com
Wed Jul 10 05:43:58 EDT 2013
JN JNC [https://community.jboss.org/people/jnjnc] created the discussion
"Re: lookup for remote bean - failure (only from eclipse)"
To view the discussion, visit: https://community.jboss.org/message/827279#827279
--------------------------------------------------------------
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
[https://community.jboss.org/message/827279#827279]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130710/bbe7dd6e/attachment-0001.html
More information about the jboss-user
mailing list