4 Replies Latest reply on Mar 1, 2012 11:20 AM by jaikiran

    Trouble with Remote EJB invocation

    gboro54

      I currently have an remote EJB deployed on a development server in our data center. However when I try to execute a test case locally to see the invocation I get the following exception:

       

      {code}

      Caused by: java.lang.IllegalArgumentException: Could not find module app: common-ear-1.0.2 module: common-jar distinct name:

                at org.jboss.as.ejb3.remote.LocalEjbReceiver.findBean(LocalEjbReceiver.java:274) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:109) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:173) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:43) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:175) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:92) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:175) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at $Proxy106.isHoliday(Unknown Source)          at com.service.impl.BillingBusinessDayServiceImpl.populateDates(BillingBusinessDayServiceImpl.java:48) [billing-common-test.jar:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_27]

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_27]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_27]

                at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.6.0_27]

                at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:135) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:84) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]

       

       

      {code}

       

      I defined the jboss-ejb-client.properties in the META-INF directory of the ejb jar. I am not sure if wrapping the project as an EAR is causing any issues. Do I have to move the jboss-ejb-client.properties file somewhere else? Anyway I can figure out what evnvrionment the lookup is occuring on(if I had to guess it is local host).

        • 1. Re: Trouble with Remote EJB invocation
          jaikiran

          What kind of client is it? Is it a standalone client or are you trying to access the EJB from some other server instance?

          • 2. Re: Trouble with Remote EJB invocation
            gboro54

            Another server instance. They are running on two seperate machines and the client side can hit the server side box.

            • 3. Re: Trouble with Remote EJB invocation
              gboro54

              Here is my client code for getting the bean:

               

               

              {code:java}


              private final String appName = "common-ear-1.0.2";

              private final String moduleName = "common-jar";

              private final String distinctName = "";

              BusinessDayServiceRemote bdsr;

              ExpirationDateService eds;

               

               


              @PostConstruct

              public void init() throws NamingException {


              final Hashtable<String, String> jndiProperties = new Hashtable<String, String>();


              jndiProperties.put(Context.URL_PKG_PREFIXES,




              "org.jboss.ejb.client.naming");

               

               



              final Context context = new InitialContext(jndiProperties);


              final String beanName = BusinessDayServiceImpl.class.getSimpleName();


              final String viewClassName = BusinessDayServiceRemote.class.getName();

               

               



              bdsr = (BusinessDayServiceRemote) context.lookup("ejb:" + appName + "/"




              + moduleName + "/" + distinctName + "/" + beanName + "!"




              + viewClassName);

              }

               

               

              {code}

               

              And here is my jboss-ejb-client.properties places in the meta-inf director of the ejb-jar(which is then wrapped by an ear for deployment)

               

              {code}

              remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

               

               

              remote.connections=default

               

               

              remote.connection.default.host=<ip>

              remote.connection.default.port = 4447

              remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

               

              {code}

              • 4. Re: Trouble with Remote EJB invocation
                jaikiran

                In that case the jboss-ejb-client.properties won't play a role. See this for your usecase https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance