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.

p31r
  • 23
  • 5
  • Make sure that the eclipse.persistence.core*.jar is in your classpath. – sinclair Oct 26 '17 at 16:53
  • I have NB under Ubuntu 16.04 (just info). How to check this classpath please? (any link to guide) – p31r Oct 26 '17 at 18:31
  • 1
    Possible duplicate of [Java, How to add library files in netbeans?](https://stackoverflow.com/questions/5893349/java-how-to-add-library-files-in-netbeans) – sinclair Oct 26 '17 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. – p31r Oct 26 '17 at 18:56

1 Answers1

0

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

  • 7
    Welcome to Stack Overflow! Your answer would be better if you included some example code to illustrate the solution. – Adrian Mole Dec 22 '19 at 08:43
  • 5
    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_. – Abra Dec 22 '19 at 10:56