2 Replies Latest reply on Feb 27, 2012 7:15 PM by Akram Ben Aissi

    JBoss AS 6.0 final + Weld + Jsf

    Saad Laassel Newbie


      Hi,

      My question is two fold please bear with me.

      I am new to weld and trying to integrate it to my JSF app but as soon as I add beans.xml to my WEB-INF JBoss throws the following exception while starting up (my application no longer starts):

      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///Users/slaassel/jboss-6.0.0.Final/server/default/deploy/Test.war_WeldBootstrapBean state=Create: java.lang.ClassCastException: org.jboss.weld.security.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$slaassel$jboss-6$0$0$Final$server$default$deploy$Test$war"-Built-in-Principal_$$_WeldProxy cannot be cast to javassist.util.proxy.ProxyObject
           at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:248) [:6.0.0.Final]
           at org.jboss.weld.bean.builtin.ee.AbstractEEBean.<init>(AbstractEEBean.java:46) [:6.0.0.Final]
           at org.jboss.weld.bean.builtin.ee.PrincipalBean.<init>(PrincipalBean.java:60) [:6.0.0.Final]
           at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:201) [:6.0.0.Final]
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:363) [:6.0.0.Final]


      The only way I can get around this error is if I drop the weld-se.jar in $JBoss_Home/common/lib/

      First question
      ==============

      The Weld documentation states (http://docs.jboss.org/weld/reference/1.1.0.CR1/en-US/html/gettingstarted.html#jbossas):

      "The reason JBoss AS 6.0.0 or above is required is because it's the first release that has both CDI and Bean Validation support built-in, making it close enough to Java EE 6 to run the examples. The good news is that there are no additional modifications you have to make to the server. It's ready to go!"


      Is the documentation wrong? is there a bug somewhere? or am I missing something?


      Second Question
      ===============

      I am able to use @Named, @Inject, in conjunction with JSF scoping with no problem, but as soon as I use CDI scoping e.g javax.enterprise.context.SessionScoped instead of javax.faces.bean.SessionScoped,I get the following exception:

      com.google.common.collect.ComputationException: java.lang.ClassCastException: com.test.controllers.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$slaassel$jboss-6$0$0$Final$server$default$deploy$Test$war"-ManagedBean-class_com$test$controllers$TestSelectionController_$$_WeldClientProxy cannot be cast to javassist.util.proxy.ProxyObject

      Caused by:
      java.lang.ClassCastException - com.test.controllers.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$slaassel$jboss-6$0$0$Final$server$default$deploy$Test$war"-ManagedBean-class_com$test$controllers$TestSelectionController_$$_WeldClientProxy cannot be cast to javassist.util.proxy.ProxyObject



      Any help would be greatly appreciated thank you.
        • 1. Re: JBoss AS 6.0 final + Weld + Jsf
          Horacio Lagandara Newbie

          Hi Saad,


          The ClassCastException is related to a javassist conflict. I have fixed it removing all javassist dependency in my pom.xml in order to use the default jboss javassist version.


          h.

          • 2. Re: JBoss AS 6.0 final + Weld + Jsf
            Akram Ben Aissi Newbie

            Thank you Horacio,

             

            I was having the following problem that is due to the same error, and as you said excluding javassit from my war solved the issue:

             

            resources.war_WeldBootstrapBean state=Create: java.lang.ClassCastException: org.jboss.weld.security.Principal$337656414$Proxy$_$$_Weld$Proxy$ cannot be cast to javassist.util.proxy.ProxyObject

            [INFO] [talledLocalContainer]     at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:272) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at org.jboss.weld.bean.builtin.ee.AbstractEEBean.<init>(AbstractEEBean.java:46) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at org.jboss.weld.bean.builtin.ee.PrincipalBean.<init>(PrincipalBean.java:60) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:202) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:368) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at org.jboss.weld.integration.deployer.env.helpers.BootstrapBean.boot(BootstrapBean.java:92) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_29]

            [INFO] [talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_29]

            [INFO] [talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_29]

            [INFO] [talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_29]

            [INFO] [talledLocalContainer]     at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.1.SP1]

            [INFO] [talledLocalContainer]     at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.1.SP1]

            [INFO] [talledLocalContainer]     at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.1.SP1]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.2.GA]

            [INFO] [talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.2.GA]

            [INFO] [talledLocalContainer]     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.2.GA]

            [INFO] [talledLocalContainer]     at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]

            [INFO] [talledLocalContainer]     at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]

            [INFO] [talledLocalContainer]     at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]

            [INFO] [talledLocalContainer]     at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]

            [INFO] [talledLocalContainer]     at java.lang.Thread.run(Thread.java:680) [:1.6.0_29]

            [INFO] [talledLocalContainer]

            [INFO] [talledLocalContainer] 00:57:30,174 ERROR [ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

            [INFO] [talledLocalContainer]

            [INFO] [talledLocalContainer] DEPLOYMENTS MISSING DEPENDENCIES:

            [INFO] [talledLocalContainer]   Deployment "jboss-injector:appName=resources,module=resources" is missing the following dependencies:

            [INFO] [talledLocalContainer]     Dependency "<UNKNOWN jboss-injector:appName=resources,module=resources>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=resources,module=resources' **")

            [INFO] [talledLocalContainer]   Deployment "jboss-injector:topLevelUnit=resources.war,unit=resources.war,bean=JournalMessageDrivenBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor" is missing the following dependencies:

            [INFO] [talledLocalContainer]     Dependency "<UNKNOWN jboss-injector:topLevelUnit=resources.war,unit=resources.war,bean=JournalMessageDrivenBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=resources,module=resources' **")

            [INFO] [talledLocalContainer]   Deployment "jboss-injector:topLevelUnit=resources.war,unit=resources.war,bean=JournalMessageDrivenBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor" is missing the following dependencies:

            [INFO] [talledLocalContainer]     Dependency "<UNKNOWN jboss-injector:topLevelUnit=resources.war,unit=resources.war,bean=JournalMessageDrivenBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=resources,module=resources' **")

            [INFO] [talledLocalContainer]   Deployment "jboss-switchboard:appName=resources,module=resources" is missing the following dependencies:

            [INFO] [talledLocalContainer]     Dependency "java:global/cdi/resources/resources/BeanManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'java:global/cdi/resources/resources/BeanManager' **")

            [INFO] [talledLocalContainer]   Deployment "jboss.j2ee:jar=resources.war,name=JournalMessageDrivenBean,service=EJB3" is missing the following dependencies:

            [INFO] [talledLocalContainer]     Dependency "<UNKNOWN jboss.j2ee:jar=resources.war,name=JournalMessageDrivenBean,service=EJB3>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-injector:bean=JournalMessageDrivenBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor,topLevelUnit=resources.war,unit=resources.war' **")

            [INFO] [talledLocalContainer]     Dependency "<UNKNOWN jboss.j2ee:jar=resources.war,name=JournalMessageDrivenBean,service=EJB3>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-injector:bean=JournalMessageDrivenBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor,topLevelUnit=resources.war,unit=resources.war' **")

            [INFO] [talledLocalContainer]   Deployment "jboss.web.deployment:war=/resources" is missing the following dependencies:

            [INFO] [talledLocalContainer]     Dependency "jboss-injector:appName=resources,module=resources" (should be in state "Create", but is actually in state "Configured")