CLI deployment archive : deploy war with datasource and resource adapter
numerico Nov 30, 2012 3:47 PMI am trying to encapsulate all deployment operations for an app into a CLI deployment archive.
Components involved are a Microsoft SQL Server Datasource and its Driver, an ActiceMQ RAR JCA and, of course, my app as a WAR
So I'm packaging them int the CLI archive as such
\- |--META-INF |--MANIFEST.MF |--myApp.war |--activemq-rar-5.6.0.rar |--jtds-1.2.6.jar |--deploy.scr |--undeploy.scr
Let's focus on the deploy.scr file (since I need something deployed in order to undeploy it )
/subsystem=resource-adapters/resource-adapter=activemq-rar-5.6.0.rar:add(archive=activemq-rar-5.6.0.rar) deploy jtds-1.2.6.jar data-source add --name=myDS --connection-url=jdbc:jtds:sqlserver://server:1433/DB --jndi-name=java:jboss/datasources/myDS --driver-name=jtds-1.2.6.jar deploy myApp.war
This throws the following exception when deploying the WAR
17:05:58,006 ERROR [org.jboss.as.server] (management-handler-thread - 4) JBAS015870: Deploy of deployment "myApp.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => [ "jboss.persistenceunit.\"myApp.war#myDB\" is missing [jboss.naming.context.java.jboss.datasources.myDS]", "jboss.deployment.unit.\"myApp.war\".component.MyMDB.CREATE is missing [jboss.ra.\"activemq-rar-5.6.0\"]", ]}
If I exclude the sentence "deploy myApp.war" from deploy.scr, the script does finish... i.e. the datasource and resource adapter are, apparently, correctly deployed, and are indeed visible in the administration console. However, placing afterwards the WAR in the deployments/ directory will throw the same exception.
Therefore, I suspect my datasource and adapter might not have been correctly configured... In particular, I suspect they might lack their JNDI names so my App cannot reference them, or something alike.
This, unfortunately, I cannot check it since the JNDI View is broken in the nightly build (JBoss 7.2.0.Alpha1-SNAPSHOT, see >> or >>)
Please note that the project can be deployed if I configure the datasource as a module and the resource adapter in standalone.xml, so it's not the code, but I'm interested into simplifying deploy to multiple servers and bootstrap for new developers.
Not sure if it's really a bug though, or if I'm missing some configuration for this to work... so any kind of pointers are welcome.
Thanks