问题
I´ve a webapplication wich uses JPA persistence unter wildfly 8.2.
The persistence.xml
is connected to <jta-data-source>java:/jdbc/myDS</jta-data-source>
wich generally works fine.
BUT if I start the JBoss-Server before the Database-Server is ready, the web application doen´t get deployed with the following error:
BAS011411: Unexpected problem gathering statistics: java.lang.IllegalStateException: JBAS011477: Persistence unit 'my.war#myPU' is not available
My wish is that the application DOES get deployed (and throws an exception when is accessed) even when the DB-server is not available. Is that possible?
My datasource-definition:
<datasource jndi-name="java:/jdbc/myDS" pool-name="myDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/mydb</connection-url>
<driver>mysql</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>15</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>myuser</user-name>
<password>mypwd</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>false</validate-on-match>
<background-validation>true</background-validation>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</datasource>
Steps to reproduce:
- Deploy an app with a "valid" datasource definition but keep the database server offline
来源:https://stackoverflow.com/questions/33775169/deploying-war-application-in-jboss-wildfly-with-unavailable-datasource