Когда я mvn clean install
получаю эту ошибку:
(main) Caused by: org.wildfly.swarm.container.DeploymentException: THORN0004: Deployment failed: {"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.adds"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => {
["jboss.persistenceunit.\"ad-service-0.2.0-SNAPSHOT.war#AdPU\".__FIRST_PHASE__ is missing
[jboss.naming.context.java.jboss.datasources.adds]","jboss.persistenceunit.\"ad-service-0.2.0-SNAPSHOT.war#AdPU\" is missing [jboss.naming.context.java.jboss.datasources.adds]"]
}
Я предполагаю, что это означает, что он не может найти мою базу данных AdPUTest
Вот мой файл persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="AdPUTest"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>domain.model.Ad</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
<property name="javax.persistence.jdbc.url"
value="jdbc:h2:mem:AdDB;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=TRUE" />
<property name="javax.persistence.jdbc.user" value="ad" />
<property name="javax.persistence.jdbc.password" value="ad" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.dialect"
value="org.hibernate.dialect.H2Dialect" />
<property name="hibernate.id.new_generator_mappings" value="true" />
<property name="hibernate.hbm2ddl.charset_name" value="UTF-8"/>
<property name="javax.persistence.sql-load-script-source" value="META-INF/instruments_test_data.sql"/>
</properties>
</persistence-unit>
</persistence>
Я добавил эти <property name="hibernate. xxx
, но это все еще не работает ..
есть идеи?