6 Replies Latest reply on Oct 9, 2006 4:19 AM by Dimitris Andreadis

    JBoss 4.0.4SP1/XP MBean AttributePersistenceService dependen

    Matt Kleiderman Newbie

      I've got an MBean who's state I'm trying to persist. If I start the app server with the .ear containing the .sar deployed I get an error ending in:

      Caused by: java.lang.IllegalStateException: Cannot perform operations unless service is started
       at org.jboss.system.pm.AttributePersistenceService.checkStarted(AttributePersistenceService.java:280)

      If I deploy the app to a running app server all is fine - so I assume I've got a dependency problem. I've tried adding

      <depends>jboss:service=AttributePersistenceService</depends>

      and
      <depends>jboss:service=AttributePersistenceService,StateString='Started'</depends>


      to my jboss-service.xml in the .sar file but the error isn't going away. What am I doing wrong?

      Thanks,
      Matt Kleiderman

        • 1. Re: JBoss 4.0.4SP1/XP MBean AttributePersistenceService depe
          Heiko Rupp Master

          Your first dependence looks ok, while the second one is bogus.
          Could you please show the full mbean-descriptor of your jboss-service.xml file?

          • 2. Re: JBoss 4.0.4SP1/XP MBean AttributePersistenceService depe
            Matt Kleiderman Newbie

            I'm happy to:

            <?xml version="1.0" encoding="UTF-8"?>
            
            <service>
            
             <mbean code="com.xerox.client.hfs.management.ClientHFSInboundMonitor"
             name="medco-hfs:name=HFSInboundMonitor"
             xmbean-dd="">
             <depends>jboss:service=AttributePersistenceService</depends>
            
             <xmbean>
             <description>Client Hosted Fax Service Inbound Configuration</description>
             <descriptors>
             <persistence persistPolicy="OnUpdate"/>
             <persistence-manager
             value="org.jboss.mx.persistence.DelegatingPersistenceManager"/>
             </descriptors>
             <class>com.xerox.client.hfs.management.ClientHFSInboundMonitor</class>
            
             <!-- Attributes -->
            
            
             </xmbean>
            
             </mbean>
            
            
            </service>
            


            (I've stripped out all the attribute and operation definitions from inside the xmbean tag for brevity's sakee

            - Matt

            • 3. Re: JBoss 4.0.4SP1/XP MBean AttributePersistenceService depe
              Matt Kleiderman Newbie

              This is getting weirder. I just tried packaging the persistent-service example up as a .sar, and copying it to the deploy directory before starting JBoss, and I got the same error message. If the .sar is copied after JBoss starts, it's fine.

              So, there's a problem with the provided example, and dependency tags don't seem to resolve the problem.

              - Matt

              • 4. Dimitri may need to look at this?
                Harold Hannon Newbie

                I also had the same issue so I put some trace in the 4.0.4 version of AttributePersistenceService to tell me the state of the service when the example deploys. It's a 6. I even did the evil trick of wrapping the sar in an ear because you mentioned that hot deploying the service worked for you. I was thinking that maybe there is a race condition somewhere. No luck. Still 6 (which is "created" state). If you go back in after the deployment of the example service fails, then you see that it is now at 3 for started. I think Dimitri owns this code. Maybe we could get him in on this to have a look at the 6 issue?

                • 5. Re: Dimitri may need to look at this?
                  Jimmy Wilson Apprentice

                  Why don't one of you post the full text of the exception stacktrace (or is the stacktrace above the full stacktrace? The checkStarted() method that I believe is getting called (and is then causing the error) can be called from several places.

                  We're using XMBeans for persistence, and we've not run into this problem...

                  • 6. Re: JBoss 4.0.4SP1/XP MBean AttributePersistenceService depe
                    Dimitris Andreadis Master

                    If you are using the installer to create your configuration, there is probably a bug, in that the attribute persistence service is deployed in ./deploy, while it should be started earlier from the conf/jboss-service.xml descriptor.

                    If you move it there, or use the .zip distro of jboss, the error should go away.