Hi
I created a jar with pojo classes, some of them annotated with hibernate annotations. This jar contains such persistence.xml file:
<?xml version="1.0" encoding="UTF-8"?> <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="models_service" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>com.magick.models.IndicatorMeta</class> <class>com.magick.models.Indicator</class> <class>com.magick.models.IndicatorContainer</class> <class>com.magick.models.IndicatorParameter</class> <class>com.magick.models.IndicatorParameterType</class> <properties> <property name="hibernate.connection.driver_class" value="org.postgresql.Driver" /> <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/indicators_service" /> <property name="hibernate.connection.username" value="postgres" /> <property name="hibernate.connection.password" value="root" />
<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>
I'd like to include this jar in WEB-INF/lib directory of another war file and use persistence unit of this jar there. When I deploy war with my models.jar to JBoss AS7 i can see that this persistent unit is created, but it can't find packages and annotated classes and i have such messages in log:
17:58:54,582 DEBUG [org.hibernate.cfg.Configuration] (MSC service thread 1-7) Mapping Package com.magick.models.log 17:58:54,607 DEBUG [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-7) HHH000194: Package not found or wo package-info.java: com.magick.models.log 17:58:54,607 DEBUG [org.hibernate.cfg.Configuration] (MSC service thread 1-7) Mapping Package com.magick.models 17:58:54,612 DEBUG [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-7) HHH000194: Package not found or wo package-info.java: com.magick.models
I've checked these packages are in jar and annotated classes too.
Can you help me how can I resolve this issue?
Thanks, Anton
|