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?
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
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.
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?
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...
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.