1 2 Previous Next 17 Replies Latest reply on Jan 5, 2011 11:25 AM by tarioch

    AS6 Final Illegal State Exception

    gwzoller

      Hello,

       

      I have a sample EJB that was working fine in AS6 M5, but AS6 Final gives me an IllegalStateException (trace below).  From the trace it seems it thinks the EAR is installed twice, but there is only one such EAR.  Otherwise organization and config of AS6 is the same as I had in M5.

       

      Any ideas why it's complaining?  Only thing that stands out to me is that after the first few lines it seems to stop my FrameMaker service for some unknown reason, then perhaps craps out because some ghost of the now-stopped module is still present.  Why would it stop?

       

      Thanks,

      Greg

       

      14:01:05,066 INFO  [JBossASKernel] Added bean(jboss.j2ee:ear=FrameMaker.ear,jar=FrameMakerEjb.jar,name=FrameMakerServiceImpl,service=EJB3) to KernelDeployment of: FrameMakerEjb.jar
      14:01:05,269 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=FrameMaker.ear,jar=FrameMakerEjb.jar,name=FrameMakerServiceImpl,service=EJB3
      14:01:05,285 INFO  [EJBContainer] STARTED EJB: co.nubilus.frame.FrameMakerServiceImpl ejbName: FrameMakerServiceImpl
      14:01:05,394 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

       

          FrameMaker/FrameMakerServiceImpl/remote - EJB3.x Default Remote Business Interface
          FrameMaker/FrameMakerServiceImpl/remote-co.nubilus.frame.FrameMakerRemote - EJB3.x Remote Business Interface
          FrameMaker/FrameMakerServiceImpl/local - EJB3.x Default Local Business Interface
          FrameMaker/FrameMakerServiceImpl/local-co.nubilus.frame.FrameMakerLocal - EJB3.x Local Business Interface

       

      14:01:05,394 WARN  [TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers
      14:01:05,988 INFO  [SessionSpecContainer] Stopping jboss.j2ee:ear=FrameMaker.ear,jar=FrameMakerEjb.jar,name=FrameMakerServiceImpl,service=EJB3
      14:01:06,019 INFO  [EJBContainer] STOPPED EJB: co.nubilus.frame.FrameMakerServiceImpl ejbName: FrameMakerServiceImpl
      14:01:06,035 INFO  [BeanInstantiatorDeployerBase] Uninstalled org.jboss.ejb3.instantiator.impl.Ejb31SpecBeanInstantiator@1470c7d from MC at org.jboss.ejb.bean.instantiator/FrameMaker/FrameMakerEjb/FrameMakerServiceImpl
      14:01:06,035 ERROR [AbstractKernelController] Error installing to Real: name=vfs:///C:/Apps/jboss-6.0.0.Final/server/default/deploy/FrameMaker.ear state=PreReal mode=Manual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error deploying: jboss.naming:application=FrameMaker,module=FrameMaker
          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.0.GA]
          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:187) [:2.2.0.GA]
          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]
          at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]
          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
          at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
          at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
          at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]
          at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]
          at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.0.0.Final]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
          at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at java.lang.Thread.run(Unknown Source) [:1.6.0_21]
      Caused by: java.lang.IllegalStateException: jboss.naming:application=FrameMaker,module=FrameMaker is already installed.
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:835) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]
          ... 49 more

        • 1. Re: AS6 Final Illegal State Exception
          jaikiran

          Do you use any IDE to deploy that application? What kind of application is it? Any Seam stuff involved? It's strange that the application is being undeployed within a few milliseconds of being deployed.

          • 2. Re: AS6 Final Illegal State Exception
            gwzoller

            I use Eclipse but I get the same result if I deploy and start AS manually.  No Seam or other stuff... just EJB3.  The only thing a little different is that I'm using the EJB Timer service, and I see in the output a warning about an obsolete TimerServiceContainer, but I'm not directly using a TimerServiceContainer, so I'm not sure where that comes from, or if its the cause of the module being immediately shut off.

             

            It looks like the module isn't even really undeployed--just shut off.  That's why it tosses its cookies a moment later: the module is still there (but not 'on') as it tries to restart.

             

            Something important changed from M5 to Final, as this code works flawlessly in M5.

            • 3. Re: AS6 Final Illegal State Exception
              tarioch

              I'm having exactly the same effect. EAR works fine on CR1 but does have the same behaviour you described in final release.

               

              • I'm also using the TimerService and have the same warnings
              • Suddenly during the startup the ejb are stopped
              • The exception is an IllegalStateException with "... is already installeD"
              • 4. Re: AS6 Final Illegal State Exception
                jaikiran

                Can one of you please attach a sample application which reproduces this issue and the server.log file?

                • 5. Re: AS6 Final Illegal State Exception
                  jaikiran

                  Or can you post the contents of the .ear file and what each of the modules in that .ear correspond to?

                  • 6. Re: AS6 Final Illegal State Exception
                    tarioch

                    I can't post the contents of the .ear in detail but I can give you some information about what's in it.

                     

                    application.ear is a folder in my case and contains the following folders

                     

                    app1.jar an ejb 3.0 application

                    • uses a persistence-context
                    • uses an interceptor:

                     

                    <assembly-descriptor>

                                    <interceptor-binding>
                                    <ejb-name>*</ejb-name>
                                    <interceptor-class>bla.interceptors.MDCInterceptor</interceptor-class>
                                    </interceptor-binding>

                    </assembly-descriptor>

                     

                     

                    app2.war a JSF 2.0 application and interface classes and containers for accessing the ejbs, it is a very simiple "hello world" JSF application that calls one EJB

                     

                     

                    app1.sar mbeans to export some functionality

                     

                    jboss-service.xml looks like this:

                     

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd">
                    <server>
                            <mbean code="bla.mbean.MyController"
                                       name="bla:service=foo/MyController"/>

                     

                            <mbean code="bla.simulator.mbean.SimulatorController"
                                       name="bla:service=foo/SimulatorController"/>

                     

                    </server>

                     

                    various dependency jars

                     

                     

                    the META-INFO of the ear does contain an application.xml

                     

                    <?xml version="1.0" encoding="UTF-8"?>
                    <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
                            <display-name>App2</display-name>
                            <module>
                                    <web>
                                            <web-uri>app2.war</web-uri>
                                            <context-root>app2</context-root>
                                    </web>
                            </module>
                            <module>
                                    <ejb>app1.jar</ejb>
                            </module>
                    </application>

                     

                    and an jboss-app.xml

                     

                    <?xml version='1.0' encoding='UTF-8'?>
                    <!DOCTYPE jboss-app PUBLIC  "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
                    <jboss-app>
                            <loader-repository>bla:loader=foo/application.ear
                                    <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                         </loader-repository>
                            <module>
                                    <service>app1.sar</service>
                            </module>
                    </jboss-app>

                    • 7. Re: AS6 Final Illegal State Exception
                      tarioch

                      I did a test with removing the war file and the entry for it in the application.xml and the error still happens.

                      • 8. Re: AS6 Final Illegal State Exception
                        jaikiran

                        I suspect it's the app1.sar (although I haven't looked at the details of your app). Either rename app1.sar to something else (since it duplicates the name of app1.jar) or move the *-service.xml from the .sar to the META-INF of the .jar.

                        • 9. Re: AS6 Final Illegal State Exception
                          gwzoller

                          Here's my application.xml contents:

                           

                          <?xml version="1.0" encoding="UTF-8"?>
                          <application xmlns="http://java.sun.com/xml/ns/javaee"
                                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
                                       version="5">
                             
                              <display-name>FrameMaker</display-name>
                             
                              <module>
                                  <java>FrameMakerClient.jar</java>
                              </module>  
                              <module>
                                  <ejb>FrameMakerEjb.jar</ejb>
                              </module>
                              <module>
                                  <web>
                                      <web-uri>FrameMaker.war</web-uri>
                                      <context-root>/FrameMaker</context-root>
                                  </web>
                              </module>
                          </application>

                           

                          and my ear-jar.xml:

                           

                          <?xml version="1.0" encoding="UTF-8"?>
                          <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
                            <display-name>FrameMaker</display-name>
                            <ejb-client-jar>FrameMakerClient.jar</ejb-client-jar>
                          </ejb-jar>

                           

                          Anything stand out there?

                          • 10. Re: AS6 Final Illegal State Exception
                            gwzoller

                            How can I attach files to this forum?  I've isolated a very minimal EAR file (7K) that illustrates the problem: a simple ejb that should set up a  timer to print a message every 5 seconds.  You'll only need to download and install 1 dependency jar in the server's default/lib directory: scala-library.jar for Scala-2.8.1.Final.  Otherwise drop my ear file into deploy dir and watch the fun.

                            • 11. Re: AS6 Final Illegal State Exception
                              jaikiran

                              Greg Zoller wrote:

                               

                              How can I attach files to this forum? 

                              Click on "Reply" and then click on "Use advanced editor". There's a "Attach files" option below the advanced editor.

                              • 12. Re: AS6 Final Illegal State Exception
                                tarioch

                                jaikiran pai wrote:

                                 

                                I suspect it's the app1.sar (although I haven't looked at the details of your app). Either rename app1.sar to something else (since it duplicates the name of app1.jar) or move the *-service.xml from the .sar to the META-INF of the .jar.

                                I did rename the sar file and now it looks like it tries to start the app1.ejb twice which then results in DuplicateBindException. So it still looks kind of similar to the original problem. Maybe from the small example from Greg the problem can be found.

                                • 13. Re: AS6 Final Illegal State Exception
                                  gwzoller

                                  Here's my ear file.  I've re-tooled into 100% Java so you no longer need the Scala library.  Just drop this file into deply dir and run.

                                   

                                  Greg

                                  • 14. Re: AS6 Final Illegal State Exception
                                    jaikiran

                                    You are packaging a ejb-jar.xml in the .ear/META-INF folder. That's not allowed by spec. Remove that from there and you should be able to get past this issue.

                                    1 2 Previous Next