NetBeans 8.2 - Weblogic - Ant build

When I try to create my Enterprise Project in Netbeans using ant, I got this exception:

warning: the supported source version is 'RELEASE_6' from the annotation processor 'Org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' less than -source '1.8' Note. Creating static factory metadata ...

An annotation handler threw an uncaught exception. See the following stack trace for more information. java.lang.ClassFormatError: Missing code attribute in a method that is not native or abstract in the javax / save / PersistenceException class file

There are only entity classes in my ejb module.

+7
java java-ee netbeans ant
source share
2 answers

This error is reported as an error in NetBeans (with resolved status, since it is considered a "user error"). The following is the main comment that explains the problem and gives a solution:

"ClassFormatError: Missing code attribute in method ..." always indicates that javaee-api-6.0.jar is used to execute at runtime. The box contains only method signatures (method bodies are deleted) and is suitable only for compilation. In future versions of javac, you may receive an error message.

The problem is that javaee-api-6.0.jar is on the class path in front of the EclipseLink banks, and when you start the EclipseLink comment handler, classes from javaee-api-6.0.jar are used instead of classes from EclipseLink. The first thing that javaee-api-6.0.jar should be removed from the class path of the EJB project - it should not be necessary, because the EJB project has a selected application server, and the project accepts the EE 6 API from this server.

As I understand the comment, you should try to remove any link to javaee-api-6.0.jar (which contains only the "dummy" classes) from the project class path, because the EclipseLink library must provide the correct classes used by the annotation processor.

Also, this question seems to solve the same problem.

+4
source share

when using the embed code and automatically creating a bean, it adds the Java EE 6 API library. I removed the library and add the Java EE 7 API.

0
source share

All Articles