jar-file problem in persistence.xml
anikulin Mar 18, 2013 1:19 PMHi
I'm trying to add jar-file with annotated entity files to my persistence.xml in another jar. My current persistence.xml is in META-INF folder and looks like these:
<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_2_0.xsd"
version="2.0">
<persistence-unit name="indicators_service"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/PostgreDB/indicators_service</jta-data-source>
<jar-file>models.jar</jar-file>
<class>com.magick.models.IndicatorContainer</class>
<class>com.magick.models.Indicator</class>
<class>com.magick.models.Type</class>
<properties>
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.connection.useUnicode" value="true" />
<property name="hibernate.connection.characterEncoding"
value="UTF-8" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
</properties>
</persistence-unit>
</persistence>
But wheni try to deploy this jar on AS7 i have such exception:
18:57:26,794 WARN [org.hibernate.ejb.packaging.FileZippedJarVisitor] (MSC service thread 1-1) HHH015010: Unable to find file (ignored): file:models.jar: java.io.FileNotFoundException: models.jar (The system cannot find the file specified)
And in trace logs i can see the following:
18:57:24,929 DEBUG [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-3) Processing PersistenceUnitInfo [
...
Jar files URLs [
vfs:/D:/Programming/switchyard-as7-0.5/bin/content/models-0.0.1-SNAPSHOT.jar]
...
]
18:57:26,771 TRACE [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-1) PersistenceMetadata(version=2.0) [
...
jarFiles[
models-0.0.1-SNAPSHOT.jar
]
...
]
I've places this model.jar into META-INF folder of the main jar and into META-INF/lib folder but this didn't give any progre
Can you help me where should i place my model.jar for it to be visible from my main jar?
And is it possible to specify a reference to a jar-file that is in as7/modules folder in persistence.xml
Thanks, Anton