I've got a Web application that compiles to a war and serves a restful API via RESTEasy 3.0.6 on JBoss AS 7. It contains within it a replicated cache that operates across JGroups using the JDBC_PING Protocol (Wherein it writes it ping information to a known database and pulls the ping information for other members of the group from the same place.) When the server shuts down, the application needs to then delete its information from the same table - but every time I bring it down, I get the following Exception:
16:28:07,486 ERROR [org.jgroups.protocols.JDBC_PING] Could not open connection to database: java.sql.SQLException: javax.resource.ResourceException: IJ000451: The connection manager is shutdown: java:jboss/datasources/dsl/control
I can see just a few lines before why this is happening:
16:28:07,459 INFO [org.jboss.as.server.deployment] JBAS015877: Stopped deployment postgresql-9.3-1100.jdbc41.jar in 77ms
but I can't seem to figure out how to tell JBoss to shut my application down before the Postgres Library.
These are the only two deployments on the server, and that will likely be the case for quite a while. I tried creating the META-INF/jboss-all xml as mentioned here: [AS7-5410] Support inter deployment dependencies - JBoss Issue Tracker with <dependency name="postgresql-9.3-1100.jdbc41.jar" /> but it seemed to have no effect, I also tried WEB-INF/jboss-deployment-structure.xml as described here: https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.3/html/Development_Guide/Add_…, but that only resulted in the entire deployment failing:
15:59:11,146 INFO [org.jboss.as.controller] (management-handler-thread - 5) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.module.service."deployment.dsl.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.dsl.war".main: Failed to load module: deployment.dsl.war:main
Last ditch, I even tried deploying this solution: Deployment dependency on datasource problem, but it was as big a bust as the others.
I feel I'm not going about this the right way, but I'm not sure how else to handle this problem.