0 Replies Latest reply on Apr 4, 2007 4:12 PM by pri20

    accessing EJBs in isolated ear's

    pri20 Newbie

      Hi,

      I'm using Jboss 4.0.2. The environment I am working in has the Isolation and CallByValue set to true in the ear-deployer.xml. Additionally, we have configured ALL our EJB's and JNDI lookups to use RMI over http/https.

      I'm trying to deploy 2 ear's EARA and EARB containing 2 stateless session beans SessionA and SessionB respectively. I want SessionA/EARA to access SessionB/EARB. When I try to do the SessionB lookup from SessionA it fails with the exception below


      13:32:40,925 INFO [STDOUT] java.rmi.ServerException: EJBException:; nested exception is:
      javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract temp.SessionBObject temp.SessionBHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException
      13:32:40,925 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352)
      13:32:40,925 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:125)
      13:32:40,925 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      13:32:40,925 INFO [STDOUT] at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
      13:32:40,925 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:894)
      13:32:40,925 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
      13:32:40,925 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      13:32:40,925 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
      13:32:40,926 INFO [STDOUT] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      13:32:40,926 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      13:32:40,926 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      13:32:40,926 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      13:32:40,926 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      13:32:40,926 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
      13:32:40,926 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
      13:32:40,926 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
      13:32:40,926 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
      13:32:40,926 INFO [STDOUT] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      13:32:40,926 INFO [STDOUT] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      13:32:40,926 INFO [STDOUT] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
      13:32:40,926 INFO [STDOUT] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      13:32:40,926 INFO [STDOUT] at $Proxy159.create(Unknown Source)


      I am also attaching relevant parts of my configuration xmls for EARA. My ejb-jar.xml for EARA are as follows

      <enterprise-beans>

      <ejb-name>SessionABean</ejb-name>
      test.SessionAHome
      test.SessionAObject
      <ejb-class>test.SessionABean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <ejb-ref>
      Reference to sessionB ears
      <ejb-ref-name>ejb/SessionBEJB</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      temp.SessionBHome
      temp.SessionBObject
      </ejb-ref>
      <security-identity>
      <use-caller-identity/>
      </security-identity>

      ..

      and the jboss.xml for EARA is as follows


      <ejb-name>SessionABean</ejb-name>
      <configuration-name>HTTPS Stateless SessionBean</configuration-name>
      <invoker-bindings>

      <invoker-proxy-binding-name>a-stateless-http-ssl-invoker</invoker-proxy-binding-name>

      </invoker-bindings>
      <ejb-ref>
      <ejb-ref-name>ejb/SessionBEJB</ejb-ref-name>
      <jndi-name>jnp://localhost:1099/SessionBBean</jndi-name>
      </ejb-ref>

      ...

      Additonally, I am a bit confused with the <jndi-name> element in the jboss.xml above. I tried to use the same lookup I use in my ejb clients viz.
      http://localhost:8080/invoker/JNDIFactory/SessionBEJB

      but it gives a

      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: http: not bound]

      The code I use to do the lookup is as follows:

      Context testcontext = new InitialContext();
      Object objref = testcontext.lookup("java:comp/env/ejb/SessionBEJB");
      SessionBHome home = PortableRemoteObject.narrow(objref,
       _SessionBHome.class);
      


      Can anyone point out what I am doing wrong or is it even possible to access EJBs across isolated EAR's.

      Thanks.
      Priya