3 Replies Latest reply on Jul 30, 2013 8:47 AM by sfcoy

    @PostConstruct cause SLSB deployment failed on JBoss EAP 6.1

      I have a SLSB as following:

       

      @Stateless

      @RolesAllowed( { "operator"})

      @SecurityDomain("ams")

      public class AMSQueryBean implements AMSQuery{

      ...

      @PostConstruct

          public void init() {

              logger.info(" post construct ejb");

       

          } 

       

      // other business methods

       

      }

       

      When I deployed the bean to JBoss EAP 6.1, I got following error:

       

      16:10:44,304 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC000001: Failed to start service jboss.deployment.unit."efe-mpc-ams.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."efe-mpc-ams.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "efe-mpc-ams.jar"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_15]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_15]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_15]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011030: Could not configure component AMSQueryBean

              at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:91)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

              ... 5 more

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018755: No method found with id: Method init() on class (or its super class) class com.intuit.engine.efp.efe.ams.AMSQueryBean

              at org.jboss.as.server.deployment.reflect.ClassReflectionIndexUtil.findRequiredMethod(ClassReflectionIndexUtil.java:79) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

              at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator$3.handleClassMethod(ComponentDescription.java:760)

              at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator$3.handle(ComponentDescription.java:744)

              at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)

              at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:738)

              at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80)

              ... 6 more

       

       

      But if I uncommented out  @PostConstruct in the code, the bean was deployed successfully.

       

      //@PostConstruct

          public void init() {

              logger.info(" post construct ejb");

          }

       

      Any idea what caused the deployment problem?

       

      Thanks