Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-4520

EJB subsystem gives uninformative error messages when an EJB class is invalid

    XMLWordPrintable

Details

    • Hide

      The project is created using the Richfaces simpleapp archetype. Add the jboss-javaee-6.0 dependency. Change web.xml to version 3.0 (doesn't actually change behavior for me, but...) Drop in this Singleton bean. And deploy. Without beans.xml it will work as expected. With, it fails. The Timer stuff actually makes little difference if it is uncommented. You'll just get extra timer setup failure in the beans.xml case.

      package com.foo.rfpushtest.ejb.singleton;

      import javax.annotation.PostConstruct;
      import javax.ejb.Schedule;
      import javax.ejb.Singleton;
      import javax.ejb.Startup;
      import javax.ejb.Timeout;
      import javax.ejb.Timer;

      @Startup
      @Singleton
      public class Poller {
      Poller() {}

      @PostConstruct
      public void postConstruct()

      { System.out.println("=========Poller was created========="); }

      //@Timeout
      //@Schedule(hour = "", minute = "", second = "0,30")
      public void doPoll(final Timer timer)

      { System.out.println("doPoll called. time until next timeout: " + timer.getTimeRemaining()); }

      }

      Show
      The project is created using the Richfaces simpleapp archetype. Add the jboss-javaee-6.0 dependency. Change web.xml to version 3.0 (doesn't actually change behavior for me, but...) Drop in this Singleton bean. And deploy. Without beans.xml it will work as expected. With, it fails. The Timer stuff actually makes little difference if it is uncommented. You'll just get extra timer setup failure in the beans.xml case. package com.foo.rfpushtest.ejb.singleton; import javax.annotation.PostConstruct; import javax.ejb.Schedule; import javax.ejb.Singleton; import javax.ejb.Startup; import javax.ejb.Timeout; import javax.ejb.Timer; @Startup @Singleton public class Poller { Poller() {} @PostConstruct public void postConstruct() { System.out.println("=========Poller was created========="); } //@Timeout //@Schedule(hour = " ", minute = " ", second = "0,30") public void doPoll(final Timer timer) { System.out.println("doPoll called. time until next timeout: " + timer.getTimeRemaining()); } }

    Description

      Singleton EJBs in the presence of beans.xml fail to deploy with a weld error. Without the presence of beans.xml the EJB deploys and functions as expected. Here's the full deployment attempt log:

      12:42:50,533 INFO [org.jboss.as.repository] (management-handler-thread - 2) JBAS014900: Content added at location /home/hcamp/code/jboss-as-7.1.1.Final/standalone/data/content/3a/11b79a5d3167adc8ec204eedf44cec07a50450/content
      12:42:50,561 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "rfpushtest.war"
      12:42:55,891 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment rfpushtest.war
      12:42:56,529 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named Poller in deployment unit deployment "rfpushtest.war" are as follows:

      java:global/rfpushtest/Poller!com.foo.rfpushtest.ejb.singleton.Poller
      java:app/rfpushtest/Poller!com.foo.rfpushtest.ejb.singleton.Poller
      java:module/Poller!com.foo.rfpushtest.ejb.singleton.Poller
      java:global/rfpushtest/Poller
      java:app/rfpushtest/Poller
      java:module/Poller

      12:42:57,493 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: rfpushtest.war
      12:42:57,653 INFO [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900 1.1.5 (AS71)
      12:42:57,817 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment rfpushtest.war
      12:42:59,592 INFO [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-1) Solder Config XML provider starting...
      12:42:59,595 INFO [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-1) Loading XmlDocumentProvider: org.jboss.solder.config.xml.bootstrap.ResourceLoaderXmlDocumentProvider
      12:42:59,658 INFO [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-1) Reading XML file: vfs:/content/rfpushtest.war/WEB-INF/beans.xml
      12:42:59,699 INFO [org.jboss.solder.Version] (MSC service thread 1-1) Solder 3.1.0.Final (build id: 3.1.0.Final)
      12:43:07,485 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."rfpushtest.war".component.Poller.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."rfpushtest.war".component.Poller.START: Failed to start service
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
      Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
      at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
      at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:116)
      at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:130)
      at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      ... 3 more
      Caused by: javax.ejb.EJBException: java.lang.RuntimeException: java.lang.IllegalAccessException: Class org.jboss.as.weld.injection.WeldEEInjection can not access a member of class com.foo.rfpushtest.ejb.singleton.Poller with modifiers ""
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:333)
      at org.jboss.as.ejb3.tx.SingletonLifecycleCMTTxInterceptor.processInvocation(SingletonLifecycleCMTTxInterceptor.java:56)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
      at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
      at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
      ... 9 more
      Caused by: java.lang.RuntimeException: java.lang.IllegalAccessException: Class org.jboss.as.weld.injection.WeldEEInjection can not access a member of class com.foo.rfpushtest.ejb.singleton.Poller with modifiers ""
      at org.jboss.as.weld.injection.WeldEEInjection.produce(WeldEEInjection.java:103)
      at org.jboss.as.weld.injection.WeldManagedReferenceFactory.getReference(WeldManagedReferenceFactory.java:77)
      at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:90)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
      at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
      ... 18 more
      Caused by: java.lang.IllegalAccessException: Class org.jboss.as.weld.injection.WeldEEInjection can not access a member of class com.foo.rfpushtest.ejb.singleton.Poller with modifiers ""
      at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) [rt.jar:1.6.0_26]
      at java.lang.Class.newInstance0(Class.java:349) [rt.jar:1.6.0_26]
      at java.lang.Class.newInstance(Class.java:308) [rt.jar:1.6.0_26]
      at org.jboss.as.weld.injection.WeldEEInjection.produce(WeldEEInjection.java:100)
      ... 26 more

      12:43:07,792 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "rfpushtest.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"rfpushtest.war\".component.Poller.START" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"rfpushtest.war\".component.Poller.START: Failed to start service"}}
      12:43:07,811 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016009: Stopping weld service for deployment rfpushtest.war
      12:43:07,951 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment rfpushtest.war in 173ms
      12:43:07,954 INFO [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
      JBAS014777: Services which failed to start: service jboss.deployment.unit."rfpushtest.war".component.Poller.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."rfpushtest.war".component.Poller.START: Failed to start service

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            traivor Harold Campbell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: