Issue Details (XML | Word | Printable)

Key: NUCCORE-825
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

If user defines root class with inheritance strategy of SUPERCLASS_TABLE then get obscure NPE

Created: 21/Mar/12 12:57 PM   Updated: 30/Mar/12 09:25 AM   Resolved: 21/Mar/12 01:05 PM
Component/s: MetaData
Affects Version/s: 3.0.9, 3.1.0.m1
Fix Version/s: 3.1.0.m2


 Description  « Hide
Ought to throw sensible error rather than getting

java.lang.NullPointerException
        at org.datanucleus.metadata.AbstractClassMetaData.getClassManagingTable(AbstractClassMetaData.java:1237)
        at org.datanucleus.metadata.AbstractClassMetaData.validateUserInputForInheritanceMetaData(AbstractClassMetaData.java:945)
        at org.datanucleus.metadata.ClassMetaData.populate(ClassMetaData.java:201)
        at org.datanucleus.metadata.MetaDataManager$1.run(MetaDataManager.java:2676)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.datanucleus.metadata.MetaDataManager.populateAbstractClassMetaData(MetaDataManager.java:2670)
        at org.datanucleus.metadata.MetaDataManager.populateFileMetaData(MetaDataManager.java:2493)
        at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:1100)
        at org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:542)
        at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:799)
        at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:590)
        at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1390)

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 21/Mar/12 01:05 PM
SVN trunk fixes the exception message to

Class "org.datanucleus.test.A" has been specified with an inheritance strategy of "superclass-table", yet no superclass exists or none exists with its own table!