2 Replies Latest reply on Feb 15, 2013 2:11 AM by rahul22

    ClassCastException on deployment

    kauedg

      I'm trying to deploy a project to JBoss AS 7 but I'm getting the following exception:

       

      17:55:13,000 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" =>

      {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"GCD-EE-ear-1.0-SNAPSHOT.ear\".WeldService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"GCD-EE-ear-1.0-SNAPSH

      OT.ear\".WeldService: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:

      Exception 0 :

      java.lang.ClassCastException: org.jboss.seam.persistence.HibernatePersistenceProvider cannot be cast to org.jboss.seam.persistence.SeamPersistenceProvider

              at org.jboss.seam.persistence.ManagedPersistenceContextExtension.beforeBeanDiscovery(ManagedPersistenceContextExtension.java:85)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)

              at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

              at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

              at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)

              at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)

              at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)

              at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)

              at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)

              at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)

              at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)

              at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:75)

              at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:46)

              at org.jboss.weld.bootstrap.events.BeforeBeanDiscoveryImpl.fire(BeforeBeanDiscoveryImpl.java:46)

              at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:322)

              at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81)

              at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

              at java.lang.Thread.run(Thread.java:722)

      "}}}}

      17:55:13,018 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS014654: Composite operation was rolled back

       

      It must be something really simples that I'm missing, because I coudn't find anything related to this on Google. Started after I added seam-persistence and seam-persistence-api (3.1.0.Final) to my dependencies. I know that just the exception stack is too little to solve a problem, but maybe someone knows this error already. Ask me for more resources.