0 Replies Latest reply on Apr 8, 2013 11:24 AM by Anton Nikulin

    JPA Entities. HHH000194: Package not found

    Anton Nikulin Newbie

      Hi

       

      I have a jar with pojo classes, some of them annotated with JPA annotations. This jar also contains persistence.xml file and when i try to deploy this jar to JBoss AS7, it creates a persistent unit, but doesn't scan classes, that are defined in persistent.xml:

       

       

      <?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>

       

      During deployment i an see such logs:

       

      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. I would like to use this persistentUnit in other applications, but can't use it, cause it has no classes.

      Can you help me how can I resolve this issue?

       

      I attached this jar, if you can, please take at look at it.

      Thanks, Anton