7 Replies Latest reply on Feb 5, 2015 9:18 AM by Jozef Hartinger

    EJB deployment exception in WildFly 8.2.0

    Emjay Khan Newbie

      Hello, all.

       

      I'm running into a problem in deploying an EJB jar file.

      The jar file contains

      • all the class files
      • ejb-jar.xml
      • jboss-deployment-structure.xml

       

      On deployment, the WildFly app server throws an exception as follows:

       

      "{

          \"JBAS014671: Failed services\" => {\"jboss.deployment.unit.\\\"my-ejb.jar\\\".INSTALL\" => \"org.jboss.msc.service.StartException in service jboss.deployment.unit.\\\"my-ejb.jar\\\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \\\"my-ejb.jar\\\"

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

          Caused by: org.jboss.classfilewriter.InvalidBytecodeException: Cannot load variable at 1. Local Variables: Local Variables: [StackEntry [descriptor=Ljava/lang/String;, type=OBJECT]]\"},

          \"JBAS014771: Services with missing/unavailable dependencies\" => [

              \"jboss.deployment.unit.\\\"my-ejb.jar\\\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\\\"my-ejb.jar\\\".beanmanager]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.Validator is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.HandleDelegate is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.ValidatorFactory is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.ORB is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.HandleDelegate is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.ValidatorFactory is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.InstanceName is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.Validator is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.ORB is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.InAppClientContainer is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.HandleDelegate is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.HandleDelegate is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.InstanceName is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.InstanceName is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.InstanceName is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.ValidatorFactory is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.ORB is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.ValidatorFactory is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.InAppClientContainer is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.Validator is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.ORB is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.Validator is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.InAppClientContainer is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]\",

              \"jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.InAppClientContainer is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]\"

          ]

      }"

       

      The Java classes are written and built in Java 8

      and the app server is 8.2.0 started also in Java 8.

       

      Any help will be appreciated.

       

      Thanks in advance.

        • 1. Re: EJB deployment exception in WildFly 8.2.0
          Tomaz Cerar Master

          This might do with using JDK8 features where weldclassintrospector doesn't know them that well.

          maybe swd847 or jharting might know more.

          • 2. Re: EJB deployment exception in WildFly 8.2.0
            Jozef Hartinger Master

            There should be a full stack trace for the org.jboss.classfilewriter.InvalidBytecodeException exception somewhere in the log. If you can find it and paste it here that would be very helpful.

            • 3. Re: EJB deployment exception in WildFly 8.2.0
              Emjay Khan Newbie

              Hello, guys.

               

              Thanks a lot for the replies.

               

              As requested by Jozef Hartinger, I'm posting the stack trace regarding InvalidBytecodeException below.

              I hope this helps.


              ERROR [org.jboss.msc.service.fail] MSC000001: Failed to start service jboss.deployment.unit."my-ejb.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."my-ejb.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "my-ejb.jar"

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]

                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]

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

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

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

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

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

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]

                ... 5 more

              Caused by: org.jboss.classfilewriter.InvalidBytecodeException: Cannot load variable at 1. Local Variables: Local Variables: [StackEntry [descriptor=Ljava/lang/String;, type=OBJECT]]

                at org.jboss.classfilewriter.code.CodeAttribute.aload(CodeAttribute.java:185)

                at org.jboss.invocation.proxy.ProxyFactory$ProxyMethodBodyCreator.overrideMethod(ProxyFactory.java:150)

                at org.jboss.invocation.proxy.AbstractSubclassFactory.overrideMethod(AbstractSubclassFactory.java:106)

                at org.jboss.invocation.proxy.AbstractSubclassFactory.addInterface(AbstractSubclassFactory.java:363)

                at org.jboss.invocation.proxy.ProxyFactory.generateClass(ProxyFactory.java:286)

                at org.jboss.invocation.proxy.AbstractClassFactory.buildClassDefinition(AbstractClassFactory.java:207)

                at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:160)

                at org.jboss.invocation.proxy.AbstractProxyFactory.getCachedMethods(AbstractProxyFactory.java:150)

                at org.jboss.as.ejb3.component.stateless.StatelessComponentDescription$3.configure(StatelessComponentDescription.java:150)

                at org.jboss.as.ee.component.DefaultComponentViewConfigurator.configure(DefaultComponentViewConfigurator.java:68)

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

                ... 6 more

               

              ERROR [org.jboss.as.controller.management-operation] JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "my-ejb.jar")]) - failure description: {

                  "JBAS014671: Failed services" => {"jboss.deployment.unit.\"my-ejb.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"my-ejb.jar\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"my-ejb.jar\"

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

                  Caused by: org.jboss.classfilewriter.InvalidBytecodeException: Cannot load variable at 1. Local Variables: Local Variables: [StackEntry [descriptor=Ljava/lang/String;, type=OBJECT]]"},

                  "JBAS014771: Services with missing/unavailable dependencies" => [

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.ORB is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.InstanceName is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.ORB is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.ORB is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.InstanceName is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.Validator is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.Validator is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.ValidatorFactory is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.InAppClientContainer is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]",

                      "jboss.deployment.unit.\"my-ejb.jar\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"my-ejb.jar\".beanmanager]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.HandleDelegate is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.InstanceName is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.Validator is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.InstanceName is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.HandleDelegate is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.InAppClientContainer is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.InAppClientContainer is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.ValidatorFactory is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.HandleDelegate is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.Validator is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.InAppClientContainer is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.HandleDelegate is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.ORB is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.ValidatorFactory is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1]",

                      "jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.ValidatorFactory is missing [jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2]"

                  ]

              }

              INFO  [org.jboss.as.server] JBAS018559: Deployed "my-ejb.jar" (runtime-name : "my-ejb.jar")

              INFO  [org.jboss.as.controller] JBAS014774: Service status report

              JBAS014775:    New missing/unsatisfied dependencies:

                    service jboss.deployment.unit."my-ejb.jar".beanmanager (missing) dependents: [service jboss.deployment.unit."my-ejb.jar".weld.weldClassIntrospector]

                    service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0 (missing) dependents: [service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.InstanceName, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.ORB, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.Validator, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB0.ValidatorFactory, JBAS014799: ... and 3 more ]

                    service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3 (missing) dependents: [service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.InAppClientContainer, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.HandleDelegate, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.ValidatorFactory, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB3.ORB, JBAS014799: ... and 3 more ]

                    service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1 (missing) dependents: [service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.Validator, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.HandleDelegate, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.ORB, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB1.InstanceName, JBAS014799: ... and 3 more ]

                    service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2 (missing) dependents: [service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.Validator, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.HandleDelegate, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.InAppClientContainer, service jboss.naming.context.java.comp.my-ejb.my-ejb.MyEJB2.ORB, JBAS014799: ... and 3 more ]

              JBAS014777:   Services which failed to start:      service jboss.deployment.unit."my-ejb.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."my-ejb.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "my-ejb.jar"

               

              INFO  [org.jboss.as.server.deployment] JBAS015877: Stopped deployment my-ejb.jar (runtime-name: my-ejb.jar) in 84ms

              INFO  [org.jboss.as.server] JBAS018558: Undeployed "my-ejb.jar" (runtime-name: "my-ejb.jar")

              INFO  [org.jboss.as.controller] JBAS014774: Service status report

              JBAS014777:   Services which failed to start:      service jboss.deployment.unit."my-ejb.jar".INSTALL

               

              Thanks again.

              • 4. Re: EJB deployment exception in WildFly 8.2.0
                Emjay Khan Newbie

                I also like to tell you that the EJBs have several lamda expressions and method references here and there.

                I hope this helps.

                • 5. Re: EJB deployment exception in WildFly 8.2.0
                  Jozef Hartinger Master

                  Could you, for the purpose of reproducing the bug, try to simplify the EJB as much as you can to a minimal form that still causes the issue and paste its code here? That would be very helpful.

                  • 6. Re: EJB deployment exception in WildFly 8.2.0
                    Emjay Khan Newbie

                    Hello.

                     

                    At the request from Jozef Hartinger, I wrote up a simple EJB and deployed it to the WildFly.

                    After playing with it for a while, I think I found the cause of the InvalidBytecodeException above.

                     

                    The exception seems to be thrown when an EJB interface contains static default methods.

                    Following is the initial version of the EJB I wrote to test:

                    public interface TestManager {

                      public static TestManager bean() {return ...// Returns a new instance of the EJB class }

                      public static TestManager local() {return ...// Returns a new instance of the local EJB implementation }

                      public static TestManager remote(String contextName) {return ...// Returns a new instance of the remote EJB implementation}

                      public String greeting(String name);

                    }

                    The EJB always failed to be deployed to the WildFly.

                    However, when I moved the default methods to a class nested inside the interface as below,

                    the app server had no problem in deploying the EJB.

                     

                    public interface TestManager {

                      public String greeting(String name);

                     

                      public static class Factory {

                        public static TestManager bean() {return ...// Returns a new instance of the EJB class }

                        public static TestManager local() {return ...// Returns a new instance of the local EJB implementation}

                        public static TestManager remote(String contextName) {return ...// Returns a new instance of the remote EJB implementation}

                      }

                    }

                     

                    It seems that whatever object that inspects an ejb deployment has problems with EJBs whose interfaces have (static) default methods.

                    • 7. Re: EJB deployment exception in WildFly 8.2.0
                      Jozef Hartinger Master

                      Hi Emjay,

                       

                      thanks for isolating trigger of the issue. I filed a bug and sent a fix. You can track progress at https://issues.jboss.org/browse/WFLY-4316