Remote EJB ERROR
esb Jan 4, 2012 1:14 PMHello,
I have 2 question one of them is about remote EJB second is about SSL. My development environment is JBoss 7 and Eclipse Indigo Java 7 and Maven 3 . My project is using (Java EE 6 application, single war) using JSF 2.0, CDI 1.0, EJB 3.1, JPA 2.0 , Bean Validation 1.0 and Richfaces 4.1.0 Final. When I migrated my application from Jboss as 6.0.0.Final to 7.1.0.Beta1b everything was fine except remote EJB and Richfaces component. I changed "modules/javax/faces/api/jsf-api-2.1.6" and "/modules/com/sun/jsf-impl/jsf-impl-2.1.6" Richfaces backed to normal.
EJB ERROR
I've struggled with remote EJB and SSL configuration since 7.1.0CR1 released(I tried 3 nightly built and 7.1.0.CR, lastly I tried #332 built from https://ci.jboss.org/hudson/job/JBoss-AS-7.x-latest/). I've followed Remote EJB example described in https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI .
My lookupStatelessMethod includes:
I
String appName="mat"; // I've got this info via @Resource(lookup = "java:app/AppName")private String appName;
String module="mat"; //I've got this info via @Resource(lookup = "java:module/ModuleName") private String moduleName;
String distinctName="";
String beanName=MyCRUDBean.class.getSimpleName();
String viewClassName=MyCRUDRemote.class.getName();
String key = "ejb:"+appName+"/"+module+"/"+distinctName+"/"+beanName+"!"+viewClassName;
MyCRUDRemote ejb = (MyCRUDRemote) context.lookup(key);
I'm calling remote EJB from unit test and I have a error :
at the server side :
16:37:47,225 ERROR [org.jboss.remoting.remote] (Remoting "esb-pc" read-1) JBREM000200: Remote connection failed: java.io.IOException:
An existing connection was forcibly closed by the remote host
at the client side :
javax.ejb.NoSuchEJBException: No such EJB[appname=mat, modulename=mat, distinctname=, beanname=MyCRUDBean, viewclassname=null]
at org.jboss.ejb.client.remoting.GeneralInvocationFailureResponseHandler.processMessage(GeneralInvocationFailureResponseHandler.java:75)
at org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver.handleMessage(ChannelAssociation.java:297)
at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:409)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
When I debugged, everything was fine before invoking.
EJBInvocationHandler -> doInvoke method Proxy for remote EJB StatelessEJBLocator{appName='mat', moduleName='mat', distinctName='', beanName='MyCRUDBean', view='interface my.package.MyCRUDRemote'}
and org.jboss.ejb.client.EJBLocator-> getviewType method returns interface my.package.MyCRUDRemote
after invoking my viewClassName lost. How can I overcome the problem.
Some of my maven dependencies:
org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.0.Final
org.jboss:jboss-ejb-client:1.0.0.Beta11(Beta 7,8,9,10,11 tried)
org.jboss.marshalling:jboss-marshalling:1.3.4.GA
org.jboss.xnio:xnio-api:3.0.0.GA(CR5 tried)
org.jboss.remoting3:jboss-remoting:3.2.0.CR8(CR 6 tried)
org.jboss.logging:jboss-logging:3.1.0.CR2
org.jboss.xnio:xnio-nio:3.0.0.GA(CR5 tried)
org.jboss.sasl:jboss-sasl:1.0.0.Beta9
org.jboss.marshalling:jboss-marshalling-river:1.3.4.GA
Thanks in advance