0

I am not able to Clean and Build my NetBeans java project. Output says:

error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor could not be instantiated: java.lang.NoClassDefFoundError: org/eclipse/persistence/internal/sessions/AbstractSession

Here:

.../nbproject/build-impl.xml:930: The following error occurred while executing this line: .../nbproject/build-impl.xml:270: Compile failed; see the compiler error output for details.

Lines from build-impl.xml:
Line 270 -

<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> 

Line 930 -

<j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>

I am trying to find some help on forums, but i am so hopeless. Thank you for your help.

4
  • Make sure that the eclipse.persistence.core*.jar is in your classpath. Commented Oct 26, 2017 at 16:53
  • I have NB under Ubuntu 16.04 (just info). How to check this classpath please? (any link to guide) Commented Oct 26, 2017 at 18:31
  • 1
    Possible duplicate of Java, How to add library files in netbeans? Commented Oct 26, 2017 at 18:38
  • I've found some answer about including EclipseLink (JPA 2.0) library to my project. It seems that this error disappear. Will see if this solve the problem. Commented Oct 26, 2017 at 18:56

1 Answer 1

0

Try to create a constructor in your class. I've faced the same problem and that simple action solved the problem.

Sign up to request clarification or add additional context in comments.

2 Comments

Welcome to Stack Overflow! Your answer would be better if you included some example code to illustrate the solution.
Your answer has the potential to be a good answer. You are familiar with the problem and you have solved it. Just edit your question and add some sample code demonstrating how you create a constructor in your class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.