Issue Details (XML | Word | Printable)

Key: NUCCORE-591
Type: Improvement Improvement
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: tom howe
Votes: 0
Watchers: 0
Operations

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

Improve clarity of exception message 'column xxx exists in table yyy and has invalid metadata. The existing column is "<column/>"

Created: 27/Oct/10 11:43 PM   Updated: 13/Nov/10 12:17 PM   Resolved: 06/Nov/10 09:38 PM
Component/s: MetaData
Affects Version/s: 2.2.0.m2
Fix Version/s: None

Severity: Production


 Description  « Hide
The following exception message is not particularly helpful or useful in understanding what the problem is or how to fix it.

org.datanucleus.exceptions.NucleusUserException: The column "USER_USER_ID_EID" exists in table "`DOMAINOBJECT`" and has invalid metadata. The existing column is "<column/>
"
at org.datanucleus.store.rdbms.table.AbstractTable.addDatastoreField(AbstractTable.java:281)
at org.datanucleus.store.mapped.ColumnCreator.createColumnsForField(ColumnCreator.java:221)
at org.datanucleus.store.mapped.mapping.ReferenceMapping.createPerImplementationColumnsForReferenceField(ReferenceMapping.java:462)
at org.datanucleus.store.mapped.mapping.ReferenceMapping.prepareDatastoreMapping(ReferenceMapping.java:197)
at org.datanucleus.store.mapped.mapping.ReferenceMapping.initialize(ReferenceMapping.java:107)
at org.datanucleus.store.mapped.mapping.InterfaceMapping.initialize(InterfaceMapping.java:52)
at org.datanucleus.store.mapped.mapping.MappingFactory.createMapping(MappingFactory.java:98)
at org.datanucleus.store.mapped.mapping.AbstractMappingManager.getMapping(AbstractMappingManager.java:248)
at org.datanucleus.store.rdbms.table.ClassTable.manageMembers(ClassTable.java:568)
at org.datanucleus.store.rdbms.table.ClassTable.manageClass(ClassTable.java:448)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.initializeClassTables(RDBMSStoreManager.java:2593)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:2484)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2134)
at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113)
at org.datanucleus.store.rdbms.RDBMSStoreManager.addClassesForSchemaTool(RDBMSStoreManager.java:955)
at org.datanucleus.store.rdbms.SchemaTool.createSchema(SchemaTool.java:757)
at org.datanucleus.store.rdbms.SchemaTool.main(SchemaTool.java:311)


Andy Jefferson added a comment - 28/Oct/10 06:45 AM
Testcase as per the problem reporting guide?
http://www.datanucleus.org/project/problem_jdo_testcase.html

tom howe added a comment - 28/Oct/10 08:50 AM
Can you point me to a test-case that tests the usefulness of an error message and i'll base it on that.

Andy Jefferson added a comment - 28/Oct/10 09:19 AM
A testcase **demonstrates** something whether that is some error, an exception, an incorrect result, or whatever. The link defines a testcase. Without a way of seeing something nobody has time to look at something.

Andy Jefferson made changes - 28/Oct/10 09:19 AM
Field Original Value New Value
Priority Minor [ 4 ] Incomplete [ 6 ]
tom howe added a comment - 28/Oct/10 10:29 AM
So what do you think *this* test should demonstrate?

My experience is that tests demonstrate something that appears to be broken and that can be programmatically tested to ensure the fix has been made.

I don't see the point of writing a test that does not try to assert anything or has no chance of being fixed.

I'm not reporting a bug here - i'm suggesting the contents of error above should be improved to make it clearer what the error is and why the exception has been raised. This is one of a number of DN errors that are not particularly helpful.

'invalid metadata' is vague.

'The existing column is "<column/>' means nothing to me.

I'm guessing a bit, but I suspect the error should say something like :

Mappings for AAA and BBB both want to create a column called CCC in table DDDD therefore you will need to either manually specify a column name by doing EEE (as shown at http://...) or using TABLE_PER_CLASS strategy instead (see http:/...).





Andy Jefferson added a comment - 28/Oct/10 10:42 AM
It's obvious what this test should demonstrate isn't it ? You quote some exception, and nobody else can see that (aka reproduce), so they want to be able to see the same as you're seeing (i.e run SchemaTool with sample classes and metadata and get some exception out). Without the ability to see such a thing how can you possibly expect anyone to understand anything ?

Failing that then one of these
http://www.datanucleus.org/servlet/forum/viewthread_thread,4601

Andy Jefferson added a comment - 06/Nov/10 09:38 PM
If you manage to generate a testcase that shows us how to get this message then we can understand your problem, and in that case attach it here and I'll reopen this issue

Andy Jefferson made changes - 06/Nov/10 09:38 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
Andy Jefferson made changes - 13/Nov/10 12:17 PM
Status Resolved [ 5 ] Closed [ 6 ]