7 Replies Latest reply on Aug 3, 2013 9:04 PM by ronneesley Branched to a new discussion.

    Remote EJB ERROR

    esb

      Hello,

          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

        • 1. Re: Remote EJB ERROR
          kavandesai

          One basic question (might sound stupid ). Are your EJB getting deployed successfully?

          • 2. Re: Remote EJB ERROR
            jaikiran

            esb wrote:

             

            at the client side :

            javax.ejb.NoSuchEJBException: No such EJB[appname=mat, modulename=mat, distinctname=, beanname=MyCRUDBean, viewclassname=null]

            That viewClassName = null is just a logging problem. Sorry about that. I'll fix it upstream. It's using the correct viewclassname. The real problem is:

             

             

            esb wrote:

             

            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

            Which exact jars and version of jars do you have on your client classpath? Also are you using CR1 or CR1b? Please use CR1b since it has some important fixes.

            1 of 1 people found this helpful
            • 3. Re: Remote EJB ERROR
              esb

              Thanks for your answers. My client dependencies are:

               

                      jboss-ejb-api_3.1_spec-1.0.1.Final

                          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                     (CR 4,5,7 tried)

                          org.jboss.remoting3:jboss-remoting:3.2.0.CR8         (CR 6,6-darranl-1,7,8 tried)

                          org.jboss.logging:jboss-logging:3.1.0.CR2

                          org.jboss.xnio:xnio-nio:3.0.0.GA                     (CR 4,5,7 tried)

                           org.jboss.sasl:jboss-sasl:1.0.0.Beta9

                          org.jboss.marshalling:jboss-marshalling-river:1.3.4.GA

               

              I tried more than one version for jboss-ejb-client, xnio-api,jboss-remoting,xnio-nio(I specified the versions above). I start migration with 7.1.0.Beta1 but after my remote EJB attempt I used 7.1.0.CR1 and 3 nightly built lastly I tried #332 built (03.Jan.2012 17:36:19) from https://ci.jboss.org/hudson/job/JBoss-AS-7.x-latest/. I haven't tried 7.1.0.CR1b but after CR1b 2 nightly built tried.

               

               

              @Kavan Desai yes my EJB deployed succesfully, because I can use it from my managed bean(locally) there is no problem and I saw it in server log.My problem occurs only when I try to run my unit test.

               

              May it be really related with operating system http://community.jboss.org/message/637750#637750 . My operationg system is Windows 7.

               

              Are there any mistake in my versions?

               

              Thank you again...

              • 4. Re: Remote EJB ERROR
                esb

                By the way I've tried 7.1.0.CR1b, I got same error. I could't solve it yet.

                • 5. Re: Remote EJB ERROR
                  kavandesai

                  Hi,

                   

                  I am using Java 6 u 29 and Eclipse Indigo and windows 7. However I am deploying the application ear out side the manually not form Eclipse plug in.

                  I am getting the following

                   

                  14:19:04,370 ERROR [org.jboss.remoting.remote] (Remoting "ww2001458" read-1) JBREM000200: Remote connection failed: java.io.IOException: An existing connection was forcibly closed by the remote host

                   

                  error on sever side however my test case executed successfully.

                   

                  A random guess are you deploying the ejb from eclipse ? If yes then this issue may help

                   

                  http://209.132.182.49/message/639238

                  • 6. Re: Remote EJB ERROR
                    juan_jordaan

                    Start the OSGI. Either through the web or configure it for startup in standalone.xml.

                    worked for me

                    • 7. Re: Remote EJB ERROR
                      ronneesley

                      Hi,

                       

                              I'm trying the same thing. I note that JBoss need annotating the EJB class with @Remote either. For example:

                       

                      @Remote

                      public interface INAME ...

                       

                      and

                       

                      @Stateless

                      public class NAMEBean implements INAME

                       

                             It's not enough for JBoss. You need add a annotation @Remote to Bean too. Like this:

                       

                      @Stateless

                      @Remote(INAME.class)

                      public class NAMEBean implements INAME

                       

                            After this, your project will work.

                       

                            I recommend read these texts:

                       

                      1º: https://community.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath

                      2º: https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI

                      3º: https://docs.jboss.org/author/display/AS71/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project