DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Chris Colman
Votes: 0
Watchers: 0

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

NumberFormatException when discriminator not supplied for an intermediate abstract base class where discriminator type is Integer

Created: 14/Jan/14 10:51 PM   Updated: 13/Apr/14 10:45 AM   Resolved: 13/Apr/14 10:44 AM
Component/s: None
Affects Version/s: 3.2.10
Fix Version/s: None

Linux Cent OS 5 and Windows XP
Java 7
Tomcat 7

Datastore: MySQL
Severity: Production

 Description  « Hide
We use Integer discriminators (cos why would you have a column value that's a often long, fully qualified classname in *every* object that you persist, ever? - but that's for another discussion ;0 ).

With recent versions of DN giving warnings when a discriminator value is provided for an abstract class we recently removed all discriminator values for abstract classes. We are now experiencing the exception below at frequent intervals.

The class in question is an abstract class but it has superclasses some of which are concrete and some are abstract denoted by (C) or (A) respectively in this ASCII graphics class diagram:

EV (C)
N (C)
ND (C)
PB (A)
Category (A)
Concrete subclasses extend Category

When performing a query on this object we get this rather strange exception. It seems as if DiscriminatorMapping.setObject() is assuming the discriminator is an int (which it should) but somehow it has been passed a String discriminator - the fully qualified class name.

Speculation, I know, and test case will be coming as soon as I get a chance, but it appears as though there is an edge case where, in the absence of the integer discriminator for an abstract class the default "fully qualified classname" is being provided and that obviously fails any number parsing method.

I don't understand why any part of the code would still be requiring a discriminator for an abstract class.

java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(
        at java.lang.Long.parseLong(
        at java.lang.Long.valueOf(
        at org.datanucleus.api.jdo.JDOQuery.execute(
        at org.apache.wicket.Component.fireInitialize(

This is happening on the 3.3.6 release of 1/1/2014 as well as December snapshots

Andy Jefferson made changes - 15/Jan/14 06:13 AM
Field Original Value New Value
Priority Major [ 3 ] No Testcase [ 6 ]
Andy Jefferson added a comment - 13/Apr/14 10:44 AM
No testcase provided. No way of seeing anything

Andy Jefferson made changes - 13/Apr/14 10:44 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
Andy Jefferson made changes - 13/Apr/14 10:45 AM
Status Resolved [ 5 ] Closed [ 6 ]