5 Replies Latest reply on Nov 28, 2019 11:00 AM by fousey

    DuplicateServiceException in JBoss AS 7.1.1

    valsaraj007

      Hi,

      What could be the reason for follwing exception. When I used in JBoss AS 6, there was no error.

       

      Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.naming.context.java.global.app.appEJB."InvBean!org.app.core.InvLocal" is already registered

        at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154)

        at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227)

        at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560)

        at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)

        at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228)

        at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)

        at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228)

        at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307)

        at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:182)

        at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:93)

        ... 6 more

        • 1. Re: DuplicateServiceException in JBoss AS 7.1.1
          jaysensharma

          Generally DuplicateServiceException  means you are trying to deploy the same service twice with the same JNDI name [java.global.app.appEJB."InvitationBean!org.app.core.InvitationLocal"] ,  Attaching complete server log will reveal more informations.

           

          Also it is confusing that in thread title you mentioned  JBoss AS 7.1.1 but in the description of the issue you mentioned JBoss AS 6 ?

          • 2. Re: DuplicateServiceException in JBoss AS 7.1.1
            valsaraj007

            I am migrating from JBoss AS 6 to 7.1.1. What I meant is this issue was not reported when I used AS 6.

            • 3. Re: Re: DuplicateServiceException in JBoss AS 7.1.1
              jaysensharma

              From your logs i see two isses:

               

              Issue : 1   I see that at time "11:13:30" the EJB was registered successfully ,  but after a second (11:13:31) looks like container might have found another copy of the same classes from some other JARs may be from "EAR/lib"  (just a guess)

               

              2014-12-04 11:13:30,435 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-5) JNDI bindings for session bean named InvitationBean in deployment unit subdeployment "appEJB.jar" of deployment "app.ear" are as follows:
              
                  java:global/app/appEJB/InvitationBean!org.app.core.InvitationLocal
                  java:app/appEJB/InvitationBean!org.app.core.InvitationLocal
                  java:module/InvitationBean!org.app.core.InvitationLocal
                  java:global/app/appEJB/InvitationBean
                  java:app/appEJB/InvitationBean
                  java:module/InvitationBean
              .
              .
              .
              .
              2014-12-04 11:13:31,953 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.subunit."app.ear"."appEJB.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."app.ear"."appEJB.jar".INSTALL: Failed to process phase INSTALL of subdeployment "appEJB.jar" of deployment "app.ear"
                  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119)
                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
                  at java.lang.Thread.run(Thread.java:722)
              Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011058: Failed to install component InvitationBean
                  at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:100)
                  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
                  ... 5 more
              Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.naming.context.java.global.app.appEJB."InvitationBean!org.app.core.InvitationLocal" is already registered
                  at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154)
                  at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227)
                  at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560)
                  at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)
                  at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228)
                  at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)
                  at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228)
                  at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307)
                  at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:182)
                  at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:93)
                  ... 6 more
              
              

               

              Can you check if inside your EAR you have multiple copies of the class "InvitationLocal" or "InvitationBean"  ?

               

               

              Issue: 2  The following NullPointerException indicates a Bug in JBoss Which is addressed as part of  [WFLY-2221] NPE in BinderService - JBoss Issue Tracker     (fixed in WildFly 8.0)  The code was not written properly to handle a scenario when the "controller"  becomes null. 

               

              2014-12-04 11:13:34,382 ERROR [org.jboss.msc.service] (MSC service thread 1-4) MSC00002: Invocation of listener "org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$BinderReleaseListener@6e40d18f" failed: java.lang.NullPointerException
                  at org.jboss.as.naming.service.BinderService.release(BinderService.java:81)
                  at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$BinderReleaseListener.transition(ModuleJndiBindingProcessor.java:300)
                  at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416)
                  at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49)
                  at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
                  at java.lang.Thread.run(Thread.java:722)
              
              
              • 4. Re: DuplicateServiceException in JBoss AS 7.1.1
                valsaraj007

                Issue: 2  The following NullPointerException indicates a Bug in JBoss Which is addressed as part of  [WFLY-2221] NPE in BinderService - JBoss Issue Tracker     (fixed in WildFly 8.0)  The code was not written properly to handle a scenario when the "controller"  becomes null.


                When I checked the commit message found that:

                WFLY-2221: binder service release() may be invoked after unsuccessful service install, in such scenario the controller field is null

                So this happens after some unsuccessful service, right? Is there any way to trace this service?


                I would like to know which code in EJB causes this error. I would like to check after commenting that part. Can you please suggest a situation when this error fired?

                • 5. Re: DuplicateServiceException in JBoss AS 7.1.1
                  fousey

                  Hello,

                   

                  This error is due to the presence of old deployed EAR. try to delete <deployments></deployments> in you standalone file and also remove deployments file (on your server, right clic, show in , file browser, delete all) and then restard your server and deploy you EAR.