akka, persistence.xml ignored in Jboss AS 7?
h3m3r Oct 31, 2011 7:16 AMHello,
I have problem with deploying akka application:
I am using scala and java and have resulting war (created with SBT):
META-INF/
|
|- persistence.xml
|
WEB-INF/
|
| - classes/ (here are java entities @Entity)
| - libs
| - web.xml
HTML files
(i tried to move with persistence.xml in war structure)
I have defined a datasource in jboss7/standalone/configuration/standalone.xml:
<datasources>
<datasource jndi-name="java:jboss/datasources/flooksysDatasource"
pool-name="flooksysDatasource_pool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:postgresql:flooksys</connection-url>
<driver>postgresql-9.1-901.jdbc4.jar</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>flks</user-name>
<password>flks</password>
</security>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements/>
</statement>
</datasource>
I have tested this datasource from jboss as 7 admin cosole, it works.
My persistence.xml in project.war/META-INF/
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
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_2_0.xsd">
<persistence-unit name="flooksysDatasource">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/flooksysDatasource</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/> <!-- validate | update | create | create-drop -->
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.default_schema" value="public"/>
</properties>
</persistence-unit>
</persistence>
When is war deploying, jboss report
11:33:25,196 INFO [org.jboss.as.jpa] (MSC service thread 1-3) added javax.persistence.api dependency to FlookSys_2.9.1-1.0.war
then start akka servlet and deploy finish successfully.
And it is all. Hibernate does not start, create no tables, nothing.
Am I doing something wrong? I am just starting with JBoss 7, I have never had any problem before.
Thank you very much for your help,
Vaclav