7 Replies Latest reply on Oct 17, 2017 8:58 AM by Juan Martin Runge

    Random error with @Startup bean on Wildfly 11 CR1

    Juan Martin Runge Newbie

      Hi,

      Im having a random error when deploying my app to Wildfly 11 CR1.  1 of 3 deployments fails. Its really courious because same app was deploying every time successfully to Wildfly 9 Final.

       

      Giving this two components:

      @Singleton
      @Startup
      public class InitialConfig {
          @Inject
          private SecurityService securityService;
          @Inject
          private MovimientoService movimientoService;
          @Inject
          private MilongaConfig config;
          @PersistenceContext
          private EntityManager em;
      
      ...
      ...
      ...
      }
          
      

       

      @LocalBean
      @Stateless
      public class MovimientoService {
          @PersistenceContext
          private EntityManager em;
          @Inject
          private MilongaConfig config;
          @Inject
          private PersonaService personaService;
      
      ...
      ...
      ...
      }
      

       

      Im getting the following exception on every 1 of 3 deployments:

      13:04:41,180 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 102) MSC000001: Failed to start service jboss.deployment.subunit."milonga2-ear-0.1.0.ear"."milonga2-vaadin-0.1.0.war".component.InitialConfig.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."milonga2-ear-0.1.0.ear"."milonga2-vaadin-0.1.0.war".component.InitialConfig.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
      at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)
      at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)
      at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:124)
      at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:138)
      at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
      ... 6 more
      Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: Can not set ar.com.zir.milonga.ejb.services.MovimientoService field ar.com.zir.milonga.ejb.config.InitialConfig.movimientoService to ar.com.zir.milonga.ejb.services.MovimientoService$Proxy$_$$_Weld$EnterpriseProxy$
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:188)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:354)
      at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:74)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)
      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
      ... 11 more
      Caused by: java.lang.IllegalArgumentException: Can not set ar.com.zir.milonga.ejb.services.MovimientoService field ar.com.zir.milonga.ejb.config.InitialConfig.movimientoService to ar.com.zir.milonga.ejb.services.MovimientoService$Proxy$_$$_Weld$EnterpriseProxy$
      at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
      at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
      at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
      at java.lang.reflect.Field.set(Field.java:764)
      at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:94)
      at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:358)
      at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:369)
      at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:71)
      at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
      at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:73)
      at org.jboss.weld.injection.producer.DynamicInjectionPointInjector.inject(DynamicInjectionPointInjector.java:60)
      at org.jboss.weld.injection.producer.ejb.SessionBeanInjectionTarget.inject(SessionBeanInjectionTarget.java:140)
      at org.jboss.as.weld.injection.WeldInjectionContext.inject(WeldInjectionContext.java:39)
      at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:51)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:107)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:105)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
      ... 26 more
      
      

       

      Spent a few hours on google and could not find someone with the same problem.  What am I doing wrong? Or is it a bug?

       

      Thanks in advance!

       

      Juan Martin