1

I am using JPA 2.1 + Eclipse link as a JPA provider + Wildfly 10.0 as a APP server.

My persistence.xml is in: WEB-INF/classes/META-INF/persistence.xml My classes folder in: WEB-INF/classes

Pls find my jar-file entry. It is not identifying the Entity classes, which is in classes folder. Even I tried file:../../classes/ (or) file:../../. and many combinations.

There is an option to give individual classes. But I don’t want to give this, since I have 150 entity classes…

IS there any option to give wildcard in classes tag? pls let me know...

  <persistence-unit name="DSProductCatalogPU" transaction-type="JTA">
       <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>java:jboss/datasources/SampleDS</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <jar-file>file:../classes/</jar-file>
    <properties>
      <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
    </properties>
  </persistence-unit>
</persistence>
Neil Stockton
  • 11,383
  • 3
  • 34
  • 29
MohanGV
  • 59
  • 1
  • 1
  • 4
  • 1
    Take a look in [this post](http://stackoverflow.com/questions/1780341/do-i-need-class-elements-in-persistence-xml). – josivan Mar 18 '16 at 13:22
  • 1
    Are your classes in a jar? You might remove the jar tag if not. The exclude-unlisted-classes tag should cause JPA to find classes on the classpath when run outside a server, and should just find entities in the application if packed correctly when deployed to an app server. Maybe describe your deployment, and turn on EclipseLink logging to finest to see what it loads when it deployes the persistence unit – Chris Mar 18 '16 at 13:46
  • @user3921892 you are using `jar-file` that can only take jar file as parameter and not the directory location. One option is, you can move you domain entities (`entities.jar`) into a jar file and place it under `WEB-INF/lib` folder. Then you can use `lib/entities.jar` – Madhusudana Reddy Sunnapu Mar 18 '16 at 14:09

0 Answers0