Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Critical Critical
Assignee: Unassigned
Reporter: FireSign
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
DataNucleus Enhancer (ARCHIVED)

java.lang.RuntimeException: Unknown tag : "entity-mappings"

Created: 26/Mar/11 06:55 PM   Updated: 01/Apr/11 03:27 PM   Resolved: 26/Mar/11 07:08 PM
Component/s: ASM Enhancer
Affects Version/s: 3.0.0.m1
Fix Version/s: None

Datastore: Apache Derby
Severity: Proof of Concept

 Description  « Hide
Enhancer throws Exception during parsing an orm.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns=""



Maven Plugin configuration:

          <mappingIncludes>**/*.jdo, **/*.class</mappingIncludes>

The Exception:

SEVERE: Parser error with file "file:/C:/eclipse35/workspace/datanucleus-test
/target/classes/META-INF/orm.xml" has cause Unknown tag : "entity-mappings"
java.lang.RuntimeException: Unknown tag : "entity-mappings"
        at org.datanucleus.api.jdo.metadata.JDOMetaDataHandler.startElement(JDOM
        at javax.xml.parsers.SAXParser.parse(
        at javax.xml.parsers.SAXParser.parse(
        at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataStream(MetaD
        at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataURL(MetaData
        at org.datanucleus.api.jdo.metadata.JDOMetaDataManager.parseFile(JDOMeta
        at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaData
        at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(
        at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhan
        at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 26/Mar/11 07:08 PM
If user requests enhancer to use JDO metadata then it expects JDO metadata and it is users fault if it can't find JPA metadata. Read the docs

FireSign added a comment - 26/Mar/11 11:25 PM

It's not really advertised on citylights, that the maven plugin enhances the classes for JDO by default.
Strangely enough, this default configuration copes well with JPA-annotated entities, however kicks off the above exception for metadata-configured persistence units.

The maven plugin configuration defined at therefore only suitable for JDO projects. This in not indicated though.

So the proper solution for my case is to add <api>JPA</api> to the maven plugin configuration.