JBoss Community

Re: @EJB(lookup) fails while context.lookup() is successfull

created by Dan Sirbu in JBoss AS7 Development - View the full discussion

I have tried the following:

 

(a) The ejb.jar file has : META-INF/beans.xml as the CDI EE6 requested        <-- if I remove the beans.xml then CDI is not "loaded" and EJB/Inject does not work.

 

(b) The bean has @Named && @Stateless

 

(c) I add @Inject. I also left @EJB as a test to see if both or one or none would work.

 

And I am getting the following error

 

15:52:03,095 INFO  [org.jboss.weld] (MSC service thread 1-15) Starting Services for CDI deployment: mgmt-war-P1A01.war
15:52:03,107 INFO  [org.jboss.weld] (MSC service thread 1-13) Starting weld service
15:52:03,124 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-13) MSC00001: Failed to start service jboss.deployment.unit."mgmt-war-P1A01.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."mgmt-war-P1A01.war".WeldService: java.lang.ClassCastException: org.jboss.weldx.transaction.UserTransaction$-1834181819$Proxy$_$$_Weld$Proxy$ cannot be cast to javassist.util.proxy.ProxyObject
        at org.jboss.as.weld.services.WeldService.start(WeldService.java:96)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
        at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
Caused by: java.lang.ClassCastException: org.jboss.weldx.transaction.UserTransaction$-1834181819$Proxy$_$$_Weld$Proxy$ cannot be cast to javassist.util.proxy.ProxyObject
        at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:272)
        at org.jboss.weld.bean.builtin.ee.AbstractEEBean.<init>(AbstractEEBean.java:46)
        at org.jboss.weld.bean.builtin.ee.UserTransactionBean.<init>(UserTransactionBean.java:60)
        at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:198)
        at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:368)
        at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81)
        at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
        ... 5 more

15:52:03,130 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) Service status report
  Services which failed to start:
      service jboss.deployment.unit."mgmt-war-P1A01.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."mgmt-war-P1A01.war".WeldService: java.lang.ClassCastException: org.jboss.weldx.transaction.UserTransaction$-1834181819$Proxy$_$$_Weld$Proxy$ cannot be cast to javassist.util.proxy.ProxyObject

 



I definitively do not use javaassist since the war file does load if the I do not have CDI activated.

 

What do I do wrong ?

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community