OpenJPA
  1. OpenJPA
  2. OPENJPA-1121

Enums cause a ClassNotFoundException in the MappingTool

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.3.0, 2.0.0-M3
    • Component/s: jpa, tooling
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      see: http://n2.nabble.com/mapping-tool---enums--trunk-td2138657.html#a2138657

      ant trace:
      Buildfile: C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build.xml
      clean:
      [delete] Deleting directory C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build
      init:
      build:
      [mkdir] Created dir: C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build\model
      [mkdir] Created dir: C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build\java
      [mkdir] Created dir: C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build\conf
      [javac] Compiling 3 source files to C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build\model
      [javac] Compiling 1 source file to C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build\java
      [copy] Copying 1 file to C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build\conf
      schema:
      [mkdir] Created dir: C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build\sql
      [openjpa:mappingtool] 10 default TRACE [main] openjpa.Runtime - Setting the following properties from "file:/C:/Development/projects/oopex/projectroot/image/openjpa1-jpa/fields-enum/build/conf/META-INF/persistence.xml" into configuration:

      {openjpa.ConnectionPassword=, openjpa.ConnectionDriverName=org.h2.Driver, javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl, openjpa.MetaDataFactory=jpa(Types=oopex.openjpa1.jpa.fields.model.Person), openjpa.jdbc.Schema=TEST, openjpa.Log=File=stdout, DefaultLevel=WARN, Runtime=TRACE, SQL=TRACE, DataCache=TRACE, Tool=INFO, openjpa.jdbc.DBDictionary=oracle(MaxEmbeddedBlobSize=-1), openjpa.ConnectionUserName=sa, openjpa.ConnectionURL=jdbc:h2:tcp://localhost:9092/sample, openjpa.Id=default}

      [openjpa:mappingtool] 36 default INFO [main] openjpa.Tool - No targets were given. Running on all classes listed in your configuration, or all persistent classes in the classpath if no classes are configured. Use -help to display tool usage information.
      [openjpa:mappingtool] 48 default TRACE [main] openjpa.Runtime - No cache marshaller found for id org.apache.openjpa.conf.MetaDataCacheMaintenance.
      [openjpa:mappingtool] 259 default INFO [main] openjpa.Tool - Mapping tool running on type "class oopex.openjpa1.jpa.fields.model.Person" with action "buildSchema".
      [openjpa:mappingtool] 259 default TRACE [main] openjpa.Runtime - No cache marshaller found for id org.apache.openjpa.conf.MetaDataCacheMaintenance.
      [openjpa:mappingtool] java.lang.NoClassDefFoundError: Loopex/openjpa1/jpa/fields/enums/State;
      [openjpa:mappingtool] at java.lang.Class.getDeclaredFields0(Native Method)
      [openjpa:mappingtool] at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
      [openjpa:mappingtool] at java.lang.Class.getDeclaredFields(Class.java:1743)
      [openjpa:mappingtool] at org.apache.openjpa.lib.util.J2DoPrivHelper$7.run(J2DoPrivHelper.java:270)
      [openjpa:mappingtool] at java.security.AccessController.doPrivileged(Native Method)
      [openjpa:mappingtool] at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.getAccessType(PersistenceMetaDataDefaults.java:262)
      [openjpa:mappingtool] at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.getAccessType(PersistenceMetaDataDefaults.java:250)
      [openjpa:mappingtool] at org.apache.openjpa.meta.AbstractMetaDataDefaults.populate(AbstractMetaDataDefaults.java:155)
      [openjpa:mappingtool] at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.populate(PersistenceMetaDataDefaults.java:227)
      [openjpa:mappingtool] at org.apache.openjpa.meta.MetaDataRepository.addMetaData(MetaDataRepository.java:794)
      [openjpa:mappingtool] at org.apache.openjpa.meta.MetaDataRepository.addMetaData(MetaDataRepository.java:780)
      [openjpa:mappingtool] at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.getMetaData(AnnotationPersistenceMetaDataParser.java:657)
      [openjpa:mappingtool] at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parseClassAnnotations(AnnotationPersistenceMetaDataParser.java:480)
      [openjpa:mappingtool] at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parse(AnnotationPersistenceMetaDataParser.java:352)
      [openjpa:mappingtool] at org.apache.openjpa.persistence.PersistenceMetaDataFactory.load(PersistenceMetaDataFactory.java:229)
      [openjpa:mappingtool] at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:474)
      [openjpa:mappingtool] at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:294)
      [openjpa:mappingtool] at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:285)
      [openjpa:mappingtool] at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:676)
      [openjpa:mappingtool] at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool.java:748)
      [openjpa:mappingtool] at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:646)
      [openjpa:mappingtool] at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1072)
      [openjpa:mappingtool] at org.apache.openjpa.jdbc.ant.MappingToolTask.executeOn(MappingToolTask.java:205)
      [openjpa:mappingtool] at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:172)
      [openjpa:mappingtool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [openjpa:mappingtool] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [openjpa:mappingtool] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [openjpa:mappingtool] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [openjpa:mappingtool] at java.lang.reflect.Method.invoke(Method.java:597)
      [openjpa:mappingtool] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      [openjpa:mappingtool] at org.apache.tools.ant.Task.perform(Task.java:348)
      [openjpa:mappingtool] at org.apache.tools.ant.Target.execute(Target.java:357)
      [openjpa:mappingtool] at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [openjpa:mappingtool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      [openjpa:mappingtool] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      [openjpa:mappingtool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [openjpa:mappingtool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
      [openjpa:mappingtool] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
      [openjpa:mappingtool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
      [openjpa:mappingtool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
      [openjpa:mappingtool] Caused by: java.lang.ClassNotFoundException: oopex.openjpa1.jpa.fields.enums.State
      [openjpa:mappingtool] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1383)
      [openjpa:mappingtool] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1324)
      [openjpa:mappingtool] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1072)
      [openjpa:mappingtool] at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      [openjpa:mappingtool] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      [openjpa:mappingtool] at java.lang.Class.forName0(Native Method)
      [openjpa:mappingtool] at java.lang.Class.forName(Class.java:247)
      [openjpa:mappingtool] at org.apache.openjpa.lib.util.TemporaryClassLoader.loadClass(TemporaryClassLoader.java:77)
      [openjpa:mappingtool] at org.apache.openjpa.lib.util.TemporaryClassLoader.loadClass(TemporaryClassLoader.java:44)
      [openjpa:mappingtool] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      [openjpa:mappingtool] ... 40 more

      BUILD FAILED
      C:\Development\projects\oopex\projectroot\image\openjpa1-jpa\fields-enum\build.xml:91: java.lang.NoClassDefFoundError: Loopex/openjpa1/jpa/fields/enums/State;

      Total time: 2 seconds

      1. fields-enum.zip
        27 kB
        Frank Schwarz
      2. fields-enum-trunk.zip
        19 kB
        Frank Schwarz
      3. TemporaryClassLoader.patch
        1 kB
        Frank Schwarz

        Activity

          People

          • Assignee:
            Donald Woods
            Reporter:
            Frank Schwarz
          • Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development