You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by vic neiman <lo...@gmail.com> on 2013/01/25 10:02:58 UTC

MappingTool ClassNotFoundException

Hi all,

I'm having trouble with the MappingTool, it keeps on throwing
java.lang.ClassNotFoundException when I run it on a Java source file. It
feels like it's a classpath issue but I am not certain. Please have  a look
below:

I run it like this:
java -cp .:openjpa-2.2.1.jar:openjpa-all-2.2.1.jar:/home/vic/tmp/test/src
org.apache.openjpa.jdbc.meta.MappingTool -p ~/tmp/test/persistence.xml
~/tmp/test/src/java/org/mag/Magazine.java

It returns this:
Exception in thread "main" java.lang.IllegalArgumentException:
java.lang.ClassNotFoundException: org.mag.Magazine
    at serp.util.Strings.toClass(Strings.java:164)
    at serp.util.Strings.toClass(Strings.java:108)
    at
org.apache.openjpa.lib.meta.ClassArgParser.parseTypes(ClassArgParser.java:164)
    at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1035)
    at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1001)
    at org.apache.openjpa.jdbc.meta.MappingTool$1.run(MappingTool.java:937)
    at
org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:748)
    at
org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:738)
    at org.apache.openjpa.jdbc.meta.MappingTool.main(MappingTool.java:932)

The Magazine.java looks like this:
package org.mag;

@Entity
@IdClass(Magazine.MagazineId.class)
public class Magazine {


    public static class MagazineId {

    }
}

Regards
Victor

Re: MappingTool ClassNotFoundException

Posted by lostvicking <lo...@gmail.com>.
Turns out the complied class files were not on the classpath. After adding
the compiled .class files to the classpath the ClassNotFoundException  has
gone away. 



--
View this message in context: http://openjpa.208410.n2.nabble.com/MappingTool-ClassNotFoundException-tp7582641p7582646.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.