Add a dependency on the transaction service in your deploy/farm-service.xml config, like:
This should make your datasource available before the application is deployed.
The above posting may not do the trick. Refer to the following past posting for a solution which may fix your issue:
Both changes didn't fix my issue :(
After I added the dependency to the transaction service, the startup order was the following:
Starting deployment: farm-service.xml
Deployed package: farm-service.xml
Starting deployment: transaction-service.xml
Starting deployment: jbossha-httpsession.sar/ClusteredHttpSessionEB.jar/
Deployed package: jbossha-httpsession.sar/ClusteredHttpSessionEB.jar/
Starting deployment: My EAR in "farm"
Deployed package:: My EAR in "farm"
Deployed package: transaction-service.xml
So, although I added a dependency from "farm-service" to "transaction-service", it looks like the farm service starts the deployment of my EAR *while* the transaction service is starting up.
IMHO there is something broken with the configuration of JBoss 3.2. Without any changes, the farm-service is started in the middle of the startup sequence for the directory "deploy". Then, the farm service is deploying the files found in "farm", thus breaking the startup order which is defined in the DeploymentSorter.
I have the same issues and wonder if things are broken. For now I'm not farming.
I found a thread on the mailing list, which describes exactly the same problem with JBoss 3.0.4:
According to the last message in this thread, it should have been fixed in 3.0.5. If this is the case, then it looks like patches from 3.0.x don't make it into 3.2.x :-((
I had the same/similar error message appearing in my attempts to get farming working.
I manually put the datasource .xml file in the *deploy* directory of each machine, and put the .ear file in the *farm* directory.
This seemed to make startup + re-deploy errors go away. I thought it a reasonable workaround since the datasource .xml file doesn't usually change between new releases of the .ear