How to fix "new missing/unsatisfied dependencies" (on Migration)
andilog Feb 10, 2012 9:06 AMHello everyone.
As far as I am new to JBoss I am trying to fix a little problem while migrating (4.2 -> 7.1), which doesnt seam very spectacular, but I dont know what exactly to do.
(The Application, which work on JBoss4.2 is using spring and struts.)
In JBoss 7.1 I have created a database connection through the standalone.xml and tested it with empty project, just read a few columns from the DB - it works.
Server Console tells me:
14:51:29,676 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "fournisseurs_web_7.1.war"
14:51:34,683 INFO [org.jboss.jpa] (MSC service thread 1-2) JBAS011401: Read persistence.xml for punit
14:51:37,403 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015856: Undeploy of deployment "fournisseurs_web_7.1.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"fournisseurs_web_7.1.war#punit\"jboss.naming.context.java.jboss.java:PostgresDSMissing[jboss.persistenceunit.\"fournisseurs_web_7.1.war#punit\"jboss.naming.context.java.jboss.java:PostgresDS]"]}
14:51:37,554 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) Stopped deployment fournisseurs_web_7.1.war in 473ms
14:51:37,555 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.java:PostgresDS (missing) dependents: [service jboss.persistenceunit."fournisseurs_web_7.1.war#punit"]
14:51:37,557 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"fournisseurs_web_7.1.war#punit\"jboss.naming.context.java.jboss.java:PostgresDSMissing[jboss.persistenceunit.\"fournisseurs_web_7.1.war#punit\"jboss.naming.context.java.jboss.java:PostgresDS]"]}}}
And I have persistance.xml in resources/META-INF, which contains:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <!-- <persistence-unit name="punit" transaction-type="JTA"> --> <persistence-unit name="punit" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <non-jta-data-source>java:PostgresDS</non-jta-data-source> <!--<class>fournisseurs2.model.Fournisseur</class>--> <properties> <property name="hibernate.hbm2ddl.auto" value="update" /> <property name="hibernate.show_sql" value="true" /> <property name="hibernate.format_sql" value="true" /> </properties> </persistence-unit>
I have tryed to create a new dependecy by creating a new file in WEB-INF named jboss-deployment-structure.xml, but I dont know what exactly i have to write there or whether its the right solution.
Would be thankfull for every little hint