We are using the depends element in jboss-service.xml DD's to declare dependencies on our common EJB's:
For example, ...
The SystemTask's jboss-service.xml declares dependencies on all the common EJB's:
jboss.j2ee:jndiName=SysConfig,service=EJB
jboss.j2ee:jndiName=MsgStore,service=EJB
And other services simply deccleare a dependency on the SystemTask service:
iServices:task=SystemTask
In this way we have avoided repeating the common EJB dependency declarations in every jboss-service.xml and still ensured correct deployment order on JBoss startup.
But on JBoss shutdown it appears as if the common EJB's are being stopped before the services, resulting in the exception below when a service tries to access a common EJB.
The undeployment order appears not to be the reverse of the deployment order.
How can we enforce an undeployment order on shutdown?
java.lang.IllegalStateException: container is not started, you cannot invoke ejb methods on it
at org.jboss.ejb.Container.invoke(Container.java:702)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:99)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
at $Proxy76.setSystemAttribute(Unknown Source)
at com.myob.iservices.common.task.feature.TaskAttribute.storeValue(TaskAttribute.java:334)
at com.myob.iservices.common.task.TaskMBeanSupport.storePersistentAttributes(TaskMBeanSupport.java:331)
at com.myob.iservices.common.task.SystemTask$RunThread.run(SystemTask.java:709)
Can you provide a simple example of this problem?
Services should be undeployed in the reverse order
to their deployment.
Regards,
Adrian