0 Replies Latest reply on Jun 13, 2008 11:38 PM by Leonardo Bernardelli

    Problem with injection EJB in Weblogic

    Leonardo Bernardelli Newbie

      I'm using Weblogic 10.0 to develop my application.


      I create a project with JBoss Tools and add an ant build file to create my weblogic EAR.


      Then the problem:


      I need to develop my application with a layered architeture. My project has a Action layer this layer access only a manager layer that contain only business rules and this layer only access a DAO layer that is responsible to persist model objects into database. All layers are session beans.


      I have to inject a UserManager into UserAction then I use


      @In(autoCreate = true)
      UserManager userManager;



      to inject. But I got this error:


      SEVERE: Error Rendering View[/listOrganization.xhtml]
      javax.ejb.EJBTransactionRolledbackException: EJB Exception: ; nested exception is: org.jboss.seam.InstantiationException: Could not instantiate Seam component: organizacaoGerenciador
              at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:791)
              at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:483)
              at weblogic.ejb.container.internal.BaseLocalObject.postInvokeTxRetry(BaseLocalObject.java:421)
              at weblogic.ejb.container.internal.StatefulLocalObject.postInvokeTxRetry(StatefulLocalObject.java:86)
              at com.milestone.cop.action.OrganizacaoFacadeImpl_ldfou8_OrganizationActionImpl.listOrganizations(OrganizationActionImpl_ldfou8_OrganizationActionImpl.java:167)
              at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
              at jrockit.reflect.InitialMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
              at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
              at org.javassist.tmp.java.lang.Object_$$_javassist_2.listaOrganizacoesPorEstadoEmCriacao()V(Object_$$_javassist_2.java:???)
              at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
              at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2092)
              at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1929)
              at org.jboss.seam.Component.getInstance(Component.java:1866)
              at org.jboss.seam.Component.getInstance(Component.java:1843)
              at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)



      I solved the problem using @EJB annotation to inject the UserManager but all seam components injected in UserManager session bean like @Logger stopped to work.


      I try to run the same example in JBoss and it works fine with

      @In(autoCreate = true)