2 Replies Latest reply on Jan 16, 2009 1:22 PM by Vijay Phagura

    Accessing EJB3 from ESB

    Vijay Phagura Newbie

      I'm using JBossESB 4.4 with JBoss AS 4.2.3 on OpenSuse 11.

      My ESB acts as a cleint to the EJB3, and I have to call the SLSB methods with Enitity beans as a param. My calls look something like this:

      CustomerAccessor customerAccessor = ServiceLocator.getInstance().getCustomerAccessor(); // JNDI lookup

      customerAccessor.createCustomer( customer );


      Where customer is a EntityBean.

      Now packaging:

      EAR
      - EJB3 jar
      -- CustomerAccessor.class
      -- CustomerAccessorBean.class
      -WAR

      ESB
      --- Actions...
      --- config xml files

      COMMON.jar
      -- Customer.class

      Now, deployment:
      All of my archives go the ../deploy directory


      Problem:

      When do the 'createCustomer' from my ESB action I get:

      java.lang.IllegalArgumentException: Unknown entity: com.vsp.reservator.ejb.dmo.Customer
      at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:215)
      at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:182)
      at com.vsp.reservator.ejb.accessor.CustomerAccessorBean.createCustomer(CustomerAccessorBean.java:20)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)


      Any ideas/suggestions?? BTW: My MANIFEST in the EAR has a CLass-Path referencing COMMON.jar and I tried without that it does not still work!!!!!!