2 Replies Latest reply on May 1, 2015 10:38 AM by Arnab Ghosh

    EAR deployment containing Jersey based web services fail

    Arnab Ghosh Novice

      Hi All,

       

      I am trying to deploy an enterprise application which is based on Hibernate 3.5.6.Final, EJB 3.0 and Jersey based RESTFul services. The deployment is failing with the below error:

       

       

      2015-04-30 19:18:20,379 CONFIG [com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer] (MSC service thread 1-7) The EJB interceptor binding API is not available. JAX-RS EJB support i

      s disabled.: javax.naming.NameNotFoundException: java:org.glassfish.ejb.container.interceptor_binding_spi

              at org.jboss.as.naming.InitialContext$DefaultInitialContext.findContext(InitialContext.java:187)

              at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:231)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)

              at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_40]

              at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_40]

              at com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer.initialize(EJBComponentProviderFactoryInitilizer.java:64) [jersey-bundle.jar:1.17.1]

              at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:570) [jersey-bundle.jar:1.17.1]

              at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:312) [jersey-bundle.jar:1.17.1]

              at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:604) [jersey-bundle.jar:1.17.1]

              at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210) [jersey-bundle.jar:1.17.1]

              at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374) [jersey-bundle.jar:1.17.1]

              at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557) [jersey-bundle.jar:1.17.1]

              at javax.servlet.GenericServlet.init(GenericServlet.java:244) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:79)

              at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:220) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:125) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:508) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:88)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

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

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

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

       

       

      2015-04-30 19:18:20,382 CONFIG [com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer] (MSC service thread 1-7) The CDI BeanManager is at java:comp/BeanManager

      ESC[0mESC[31m18:53:56,777 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host."/aoma.api": org.jboss

      .msc.service.StartException in service jboss.undertow.deployment.default-server.default-host."/aoma.api": 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_40]

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

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

      Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException: com -- service jboss.naming.context.java.com

              at com.sun.jersey.server.impl.cdi.CDIExtension.getInitializedExtension(CDIExtension.java:177)

              at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactory.<init>(CDIComponentProviderFactory.java:92)

              at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer.initialize(CDIComponentProviderFactoryInitializer.java:75)

              at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:572)

              at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:312)

              at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:604)

              at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)

              at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374)

              at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557)

              at javax.servlet.GenericServlet.init(GenericServlet.java:244)

              at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)

              at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:79)

              at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)

              at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:220)

              at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:125)

              at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:508)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:88)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)

              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: javax.naming.NameNotFoundException: com -- service jboss.naming.context.java.com

              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:104)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:202)

              at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:233)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)

              at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_40]

              at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_40]

              at com.sun.jersey.server.impl.cdi.CDIExtension$2.stepInto(CDIExtension.java:290)

              at com.sun.jersey.server.impl.cdi.CDIExtension.diveIntoJNDIContext(CDIExtension.java:267)

              at com.sun.jersey.server.impl.cdi.CDIExtension.lookupJerseyConfigJNDIContext(CDIExtension.java:287)

              at com.sun.jersey.server.impl.cdi.CDIExtension.getInitializedExtension(CDIExtension.java:175)

              ... 22 more

       

      Please help.

       

      Regards

      Arnab

       

      Message was edited by: Arnab Ghosh

        • 1. Re: EAR deployment containing Jersey based web services fail
          Arnab Ghosh Novice

          If I set the below in standalone.conf

           

          # Fix for Jersey to allow JNDI entries into JVM

          JAVA_OPTS="$JAVA_OPTS -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true"

           

          Exception changes to:

          [31m23:44:54,018 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host."/aoma.api": org.jboss

          .msc.service.StartException in service jboss.undertow.deployment.default-server.default-host."/aoma.api": 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_40]

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

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

          Caused by: org.jboss.weld.exceptions.IllegalStateException: WELD-001332: BeanManager method getBeans() is not available during application initialization

                  at org.jboss.weld.bean.builtin.BeanManagerProxy.checkContainerState(BeanManagerProxy.java:246)

                  at org.jboss.weld.bean.builtin.BeanManagerProxy.checkContainerState(BeanManagerProxy.java:251)

                  at org.jboss.weld.bean.builtin.BeanManagerProxy.getBeans(BeanManagerProxy.java:100)

                  at com.sun.jersey.server.impl.cdi.Utils.getBean(Utils.java:61)

                  at com.sun.jersey.server.impl.cdi.Utils.getInstance(Utils.java:83)

                  at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactory.<init>(CDIComponentProviderFactory.java:89)

                  at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer.initialize(CDIComponentProviderFactoryInitializer.java:75)

                  at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:572)

                  at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:312)

                  at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:604)

                  at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)

                  at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374)

                  at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557)

                  at javax.servlet.GenericServlet.init(GenericServlet.java:244)

                  at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)

                  at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:79)

                  at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)

                  at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:220)

                  at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:125)

                  at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:508)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:88)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)

                  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

           

           

          ESC[0mESC[33m23:44:54,207 WARN  [org.jboss.weld.Event] (MSC service thread 1-2) WELD-000411: Observer method [BackedAnnotatedMethod] com.sun.jersey.server.impl.cdi.CDIExtension.processAnnotatedType

          (@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.

          ESC[0mESC[31m23:44:55,722 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "aoma.api.ear")]) - fai

          lure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host.\"/aoma.api\"" => "org.jboss.msc.service.StartException in service jboss.undertow.deploym

          ent.default-server.default-host.\"/aoma.api\": Failed to start service

           

          Please help

          • 2. Re: EAR deployment containing Jersey based web services fail
            Arnab Ghosh Novice

            I was able to resolve this issue by adding the below to weld sub-system declaration:

            require-bean-descriptor="true"

             

            <subsystem xmlns="urn:jboss:domain:weld:2.0" require-bean-descriptor="true"/>

             

            Not sure that this will cause any other issues later.