Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Resolved Resolved
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Unassigned
Reporter: Ashok Mistry
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.

Tutorial for JPA for MongoDB -

Created: 27/Sep/12 07:01 PM   Updated: 08/Oct/12 03:51 PM   Resolved: 08/Oct/12 03:51 PM
Component/s: None
Affects Version/s: 3.1
Fix Version/s: None

Environment: Windows XP

Datastore: MongoDB
Severity: Production

 Description  « Hide
When running mvn compile of downloaded sample project, get the following exception...

[INFO] Scanning for projects...
[WARNING] Some problems were encountered while building the effective model for org.datanucleus.samples:datanucleus-samples-jpa-tutorial:jar:3.1
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-clean-plugin is missing. @ line 177, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 196, column 21
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] ------------------------------------------------------------------------
[INFO] Building DataNucleus Tutorial for JPA 3.1
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ datanucleus-samples-jpa-tutorial ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] Copying 0 resource
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ datanucleus-samples-jpa-tutorial ---
[INFO] Nothing to compile - all classes are up to date
[INFO] --- maven-datanucleus-plugin:3.1.0-m3:enhance (default) @ datanucleus-samples-jpa-tutorial ---
[INFO] DataNucleus Enhancer (version 3.1.0.release) : Enhancement of classes

[ERROR] --------------------
[ERROR] Standard error from the DataNucleus tool + org.datanucleus.enhancer.DataNucleusEnhancer :
[ERROR] --------------------
[ERROR] Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at Source)
at Source)
at$100(Unknown Source)
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.datanucleus.JDOClassLoaderResolver.classOrNull(
at org.datanucleus.JDOClassLoaderResolver.classForName(
at org.datanucleus.JDOClassLoaderResolver.classForName(
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(
at org.datanucleus.enhancer.DataNucleusEnhancer.main(

[ERROR] --------------------
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.706s
[INFO] Finished at: Thu Sep 27 18:00:35 BST 2012
[INFO] Final Memory: 7M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.datanucleus:maven-datanucleus-plugin:3.1.0-m3:enhance (default) on project datanucleus-samples-jpa-tutorial: The DataNucleus tool org.datanucleus.enhancer.DataNucleusEnhancer exited with a non-null exit code. -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]

Andy Jefferson added a comment - 01/Oct/12 01:34 PM - edited
works for me using the file on SourceForge. With Mongodb you need to update persistence.xml to use mongodb, update pom.xml to include mongodb deps, and update orm.xml to use "increment" strategy ("identity" is for string fields with mongodb).

Maven3 gives warnings but then they are ignorable (and down to the Maven teams inability to consider backwards compatibility - the sample is designed for Maven2).

"java.lang.UnsupportedClassVersionError: Bad version number in .class file"
is obviously related to your JRE in use (undefined). I've used 1.6 and 1.7 with no problems.

Andy Jefferson added a comment - 08/Oct/12 03:51 PM
Without further info on how this is reproduceable nothing can be done

Andy Jefferson made changes - 08/Oct/12 03:51 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]