Weird deployment exception (CDI-related ?!)

(Vaadin 7.3.6, Vaadin CDI 1.0.3, WildFly 8.1, Maven Project)

Hi!

I recently migrated my project to IntelliJ IDEA. Since using it, I’m facing the following exception while deploying my project:

[code]
12:29:47,884 ERROR [org.jboss.msc.service.fail]
(MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit.“studimanager-ear.ear”.WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit.“studimanager-ear.ear”.WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_20]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_20]

at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_20]

Caused by: org.jboss.weld.exceptions.DeploymentException: Enclosing method not found
at org.jboss.weld.executor.AbstractExecutorServices.checkForExceptions(AbstractExecutorServices.java:66)
at org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:43)
at org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:51)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer.createClassBeans(ConcurrentBeanDeployer.java:72)
at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:260)
at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:351)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:79)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:92)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

... 3 more

Caused by: java.lang.InternalError: Enclosing method not found
at java.lang.Class.getEnclosingMethod(Class.java:1052) [rt.jar:1.8.0_20]

at org.jboss.weld.util.reflection.Reflections.isNonStaticInnerClass(Reflections.java:388)
at org.jboss.weld.util.Beans.isTypeManagedBeanOrDecoratorOrInterceptor(Beans.java:486)
at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:233)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:74)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:72)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_20]

... 3 more

12:29:47,893 ERROR [org.jboss.as.controller.management-operation]
(management-handler-thread - 2) JBAS014613: Operation (“deploy”) failed - address: ([(“deployment” => “studimanager-ear.ear”)]
) - failure description: {“JBAS014671: Failed services” => {“jboss.deployment.unit."studimanager-ear.ear".WeldStartService” => “org.jboss.msc.service.StartException in service jboss.deployment.unit."studimanager-ear.ear".WeldStartService: Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: Enclosing method not found
Caused by: java.lang.InternalError: Enclosing method not found”}}
12:29:47,895 ERROR [org.jboss.as.server]
(management-handler-thread - 2) JBAS015870: Deploy of deployment “studimanager-ear.ear” was rolled back with the following failure message:
{“JBAS014671: Failed services” => {“jboss.deployment.unit."studimanager-ear.ear".WeldStartService” => “org.jboss.msc.service.StartException in service jboss.deployment.unit."studimanager-ear.ear".WeldStartService: Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: Enclosing method not found
Caused by: java.lang.InternalError: Enclosing method not found”}}
[/code]I guess the error is caused by Vaadin itself. There are three errors (not exceptions!) which appear right before this exception.

12:29:47,247 INFO  [org.jboss.weld.Bootstrap]
 (weld-worker-8) WELD-000119: Not generating any bean definitions from com.vaadin.cdi.internal.VaadinExtension$VaadinComponentProxyException because of underlying class loading error: Type [unknown]
 not found.  If this is unexpected, enable DEBUG logging to see the full error.
12:29:47,249 INFO  [org.jboss.weld.Bootstrap]
 (weld-worker-4) WELD-000119: Not generating any bean definitions from com.vaadin.cdi.CDIViewProvider$ViewChangeListenerImpl because of underlying class loading error: Type [unknown]
 not found.  If this is unexpected, enable DEBUG logging to see the full error.
12:29:47,252 INFO  [org.jboss.weld.Bootstrap]
 (weld-worker-1) WELD-000119: Not generating any bean definitions from com.vaadin.cdi.CDIUIProvider$DetachListenerImpl because of underlying class loading error: Type [unknown]
 not found.  If this is unexpected, enable DEBUG logging to see the full error.

So I enabled DEBUG logging. Here’s what is causing these errors:

Caused by: java.lang.IncompatibleClassChangeError: com.vaadin.cdi.internal.VaadinExtension and com.vaadin.cdi.internal.VaadinExtension$VaadinComponentProxyException disagree on InnerClasses attribute Caused by: java.lang.IncompatibleClassChangeError: com.vaadin.cdi.CDIViewProvider and com.vaadin.cdi.CDIViewProvider$ViewChangeListenerImpl disagree on InnerClasses attribute Caused by: java.lang.IncompatibleClassChangeError: com.vaadin.cdi.CDIUIProvider and com.vaadin.cdi.CDIUIProvider$DetachListenerImpl disagree on InnerClasses attribute So it seems that all of these errors are related to the CDI-Plugin. But that’s a little bit weird - These errors exist only since I am using IntelliJ for deployment.

Any proposals?

From time to time I do get this error and a “mvn clean” should fix the error. Mostly this error happens when doing refactoring of anonymous methods or inner classes. looks like Intellij leaves the .class and they get package on the deploy (I may be wrong) but the mvn clean is your friend here.