6 Replies Latest reply on Jun 11, 2015 7:04 AM by sridhar thiyagarajan

    About auto-deploy-exploded and scan-interval in Wilfdly 8

    sridhar thiyagarajan Novice

      Hello.. I am deploying the EAR file in an exploded format in standalone/deployments folder. For Wildfly 8.2.0 application server to take the exploded EAR, I have set the value of auto-deploy-exploded to "true" and the value of scan-interval attribute to "5000" as mentioned below.

       

      <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">

                  <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" auto-deploy-exploded="true"/>

           </subsystem>

       

      So, as per the value of scan-interval attribute, server will look for every 5 seconds to see if there are any changes that need to be re-deployed.

       

      Sometimes, I could see earfilename.ear.failed and when I open the file, it contains error messages with javax.management.InstanceAlreadyExistsException related to MBeans. This will come when MBeans are already registered and when server during scanning and re-deployment deploys the EAR again.

       

      Have anyone faced this error ? Does scan-interval attribute required along with auto-deploy-exploded=true ? if scan-interval is removed, then will auto scan and deployment happen only with auto-deploy-exploded="true" defined in standalone-full-ha.xml when any configuration file is changed in EAR folder that needs effect ? Or does scan-attribute need to be used always along with auto-deploy-exploded="true" for auto scan and deployment ? Please help me to understand. Thanks.

        • 1. Re: About auto-deploy-exploded and scan-interval in Wilfdly 8
          jaikiran pai Master

          What exceptions do you see in the server.log? Please post that entire exception stacktrace.

          • 2. Re: About auto-deploy-exploded and scan-interval in Wilfdly 8
            sridhar thiyagarajan Novice

            I have only one EAR containing MBeans deployed in exploded format and when something is modified in EAR file in deployment location, I am getting the below ERROR for most of the MBeans deployed. I understand from the ERROR that during scanning, it stops deployment and when re-starting the deployment, it deploys all the contents of EAR and when deploying MBeans, it already has the MBeans deployed and hence, it is not deploying the MBeans and failing with error JMX:javax.management.InstanceAlreadyExistsException.

             

            Ideally, when stopping deployment during the scan, MBeans should have been un-deployed as I am sharing the code for MBean implementation below this error trace. Singleton stateless EJB is registered as MBean during deployment and when EJB is destroyed, before the destroy, MBean is un-registered. Please help me whether I need to correct the MBean un-registration coding part as I am getting this error for almost all deployed MBeans implemented in similar fashion.

             

            Error:

             

            2015-06-11 10:44:00,466 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 108) MSC000001: Failed to start service jboss.deployment.subunit."test.ear"."testservice.jar".component.EmailService.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."test.ear"."testservice.jar".component.EmailService.START: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance

                at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_67]

                at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]

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

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

                at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]

                at org.jboss.threads.JBossThread.run(JBossThread.java:122)

            Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance

                at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:162) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:133) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:89) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:122)

                at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:137)

                at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                ... 6 more

            Caused by: javax.ejb.EJBException: java.lang.IllegalStateException: Problem occurred while registering test.email:service=EmailService into JMX:javax.management.InstanceAlreadyExistsException: test.email:service=EmailService

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:190)

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:369)

                at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:160) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                ... 11 more

            Caused by: java.lang.IllegalStateException: Problem occurred while registering test.email:service=EmailService into JMX:javax.management.InstanceAlreadyExistsException: test.email:service=EmailService

                at com.test.service.it.jmx.EmailService.registerAsMBean(EmailService.java:129)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_67]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_67]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_67]

                at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]

                at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)

                at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55)

                at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:94)

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]

                at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273)

                ... 27 more

             

            MBean implementation:

             

            @Singleton

            @LocalBean

            @Startup

            @DependsOn("InitConfig")

            public class EmailService implements EmailServiceMBean {

             

            private ObjectName objectName = null;

             

            ...

            ...

               

            @PostConstruct

            public void registerAsMBean() throws Exception {

               

                startService();

                   

                   try {

                       objectName = new ObjectName("test.email:service=EmailService" );

                       MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();

                       mBeanServer.registerMBean( this, objectName );

                   } catch ( Exception e ) {

                       throw new IllegalStateException( "Problem occurred while registering test.email:service=EmailService into JMX:" + e );

                   }

            }

               

            ...

            ...

             

            @PreDestroy

            public void unRegisterAsMBean() throws Exception {

                       

                stopService();

                       

                       try {

                           ManagementFactory.getPlatformMBeanServer().unregisterMBean( this.objectName );

                       } catch ( Exception e ) {

                           throw new IllegalStateException( "Problem occurred while un-registering test.email:service=EmailService from JMX:" + e );

                       }

            }

               

            ...

            ...

               

            }

             

            Many thanks.

            • 3. Re: About auto-deploy-exploded and scan-interval in Wilfdly 8
              jaikiran pai Master

              Can you add some logging or breakpoint in the @PreDestroy method of your @SIngleton EJB to check if it is being called or not?

              • 4. Re: About auto-deploy-exploded and scan-interval in Wilfdly 8
                sridhar thiyagarajan Novice

                Many thanks for the response. Getting the below exception when debugging at @predestroy method of singleton EJB. Is EJB itself not available at this point ? .. Jaikiran.

                 

                org.jboss.as.ejb3.component.EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down

                • 5. Re: About auto-deploy-exploded and scan-interval in Wilfdly 8
                  jaikiran pai Master

                  Can you please post that entire exception stacktrace?

                  • 6. Re: About auto-deploy-exploded and scan-interval in Wilfdly 8
                    sridhar thiyagarajan Novice

                    Adding the stack trace. I suspect when server detects changes, it does a re-deployment and when threads referring it finds it unavailable, then it fails. Please share your comments if you have faced any such error. Thanks. JFYI that proper stop and start of the server did not create any such problems. So, currently, using  auto-deploy-exploded to "true" alone detects exploded EAR file and any changes to any configuration files within the EAR requires a manual restart.

                     

                     

                    2015-06-11 15:19:21,568 ERROR [org.jboss.as.ejb3.invocation] (Thread-122) JBAS014134: EJB Invocation failed on component Facades for method public abstract com.test.it.model.TransferObject com.test.it.server.interfaces.FacadesLocal.loadData(com.test.it.model.TransferObject): org.jboss.as.ejb3.component.EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down

                        at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

                        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                        at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                        at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

                        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                        at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

                        at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)

                        at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

                        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                        at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

                        at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

                        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)

                        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)

                        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                        at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)

                        at com.test.it.server.interfaces.FacadesLocal$$$view24.loadData(Unknown Source) [serverutil.jar:]

                        at com.test.it.server.util.external.out.test.Reader.getAllData_aroundBody0(Reader.java:208) [test.jar:]

                        at com.test.it.server.util.external.out.test.Reader$AjcClosure1.run(Reader.java:1) [test.jar:]

                        at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) [aspectjrt-1.8.5.jar:]

                        at com.test.it.server.aop.interceptor.MethodInterceptor.invoke(MethodInterceptor.java:89) [aop.jar:]

                        at com.test.it.server.util.external.out.test.Reader.getAllData(Reader.java:138) [test.jar:]

                        at com.test.it.server.util.external.out.test.testProcess.exportMessages_aroundBody0(testProcess.java:188) [test.jar:]

                        at com.test.it.server.util.external.out.test.testProcess$AjcClosure1.run(testProcess.java:1) [test.jar:]

                        at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) [aspectjrt-1.8.5.jar:]

                        at com.test.it.server.aop.interceptor.InitInterceptor.invoke(InitInterceptor.java:61) [aop.jar:]

                        at com.test.it.server.util.external.out.test.testProcess.exportMessages_aroundBody2(testProcess.java:162) [test.jar:]

                        at com.test.it.server.util.external.out.test.testProcess$AjcClosure3.run(testProcess.java:1) [test.jar:]

                        at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) [aspectjrt-1.8.5.jar:]

                        at com.test.it.server.aop.interceptor.MethodInterceptor.invoke(MethodInterceptor.java:89) [aop.jar:]

                        at com.test.it.server.util.external.out.test.testProcess.exportMessages(testProcess.java:162) [test.jar:]

                        at com.test.it.server.jmx.testService$SenderThread.run_aroundBody0(testService.java:215) [test.jar:]

                        at com.test.it.server.jmx.testService$SenderThread$AjcClosure1.run(testService.java:1) [test.jar:]

                        at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) [aspectjrt-1.8.5.jar:]

                        at com.test.it.server.aop.interceptor.LoggingInterceptor.invoke(LoggingInterceptor.java:123) [aop.jar:]

                        at com.test.it.server.jmx.testService$SenderThread.run(testService.java:210) [test.jar:]