enjoyourlife (1) [Avatar] Offline
I import maven project using eclipse(luna) and encounter some errors..

1. xmlns in persistence.xml


Eclipse shows following errors.

... Referenced file contains errors (http://xmlns.jcp.org/xml/ns/persistence_2_1.xsd). For more information..

So, I changed it like below,

<persistence xmlns="http://java.sun.com/xml/ns/persistence"

2. I cannot find the class in persistence.xml like <class>org.jpwh.model</class>
It seems just package, no class. So, i delete it.

<persistence-unit name="SimplePU">

<persistence-unit name="myPU">

3. No generator named “X” is defined in the persistence unit – Eclipse JPA

4. maven-antrun-plugin problem
You may encounter this problem when you importing maven project. i just disabled it by clicking eclipse error indicator.
Eclipse will insert following configuration to pom.xml

<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->

5. some errors in example project like below...

CreditCard_, Item_ classes seems does not exist. Many classes have this kinds of errors.

package org.jpwh.test.bulkbatch;

import org.jpwh.env.JPATest;
import org.jpwh.model.bulkbatch.BankAccount;
import org.jpwh.model.bulkbatch.Bid;
import org.jpwh.model.bulkbatch.CreditCard;
import org.jpwh.model.bulkbatch.CreditCard_;
import org.jpwh.model.bulkbatch.Item;
import org.jpwh.model.bulkbatch.Item_;

siebica (3) [Avatar] Offline
Please find some answers below:

2. I believe this is the extension that Hibernate provides for including the package-info.java (the file you can put your named queries inside)

Please check https://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html/configuration.html#setup-configuration-packaging
As an extension to the specification, you can add a package name in the <class> element (eg <class>org.hibernate.eg</class> ). Caution, the package will include the metadata defined at the package level (ie in package-info.java), it will not include all the classes of a given package.

5. The CreditCard_, Item_ metadata classes are generated during the build process and you can find them under model/target/generated-sources/annotations. The book talks about this strongly typed metadata model at page 45 of MEAP v8
424033 (1) [Avatar] Offline

I spent hours trying to import the project within Eclipse Luna. I tried different plugins, searched the web for the many error messages I got with no success.

Is it possible for you to provide online an Eclipse version tu run the sample codes (or at least to give us in a README file indications concerning the necessary plugins) ? Because for the moment it looks as if the targeted audience was rather persons having a good knowledge of Maven and Hibernate (or both) than pure Java developers?

Best regards,

557394 (2) [Avatar] Offline
I recently purchased the second edition of this book and tried to set up the project on my laptop. I experienced some of the issues listed here among which issue 5 took some of my time. Maven build for the complete project solved the issue in my case. I see the generated classes under model project. However out of curiosity I would like to know whether there is a way to resolve errors seen on eclipse for examples project. The examples project cannot resolve the generated classes in eclipse after a complete build of the entire codebase. The dependencies of examples include model and environment projects. However these projects are currently displayed as projects rather than jars under maven dependencies of examples project in my eclipse workspace. Any thoughts is greatly appreciated.

issue 6. I am setting up this project in windows. I faced an issue related to jconsole dependency of wildfly-arquillian-container-remote artifact. I solved it by updating the pom file of apps/pom.xml as below:

557394 (2) [Avatar] Offline
I found the solution to issue 5 while setting it up on eclipse. The issue was resolved by disabling project resolution in maven plugin. An old post regarding the same is:


However I used the instruction below: