Community
Participate
Working Groups
Build Identifier: Hello, I have a GMF diagram stored in my repository that causes the following stack trace (on commit after modification on a connection): org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore: java.lang.NullPointerException at org.eclipse.gmf.runtime.notation.impl.NotationFactoryImpl.convertRelativeBendpointListToString(NotationFactoryImpl.java:1221) at org.eclipse.gmf.runtime.notation.impl.NotationFactoryImpl.convertToString(NotationFactoryImpl.java:288) at org.eclipse.emf.cdo.server.internal.db.mapping.CoreTypeMappings$TMCustom.getDefaultValue(CoreTypeMappings.java:847) at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.setDefaultValue(AbstractTypeMapping.java:99) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.detachAttributes(HorizontalBranchingClassMapping.java:691) ... It appears that in CoreTypeMappings$TMCustom.getDefaultValue() the expression getFeature().getDefaultValue(); returns a null value. Is it possible to test if it is null? It seems to be tested in CoreTypeMappings$TMEnum.getDefaultValue(). Note that this exception happens on the server side, not on a client. Thanks, Steve Reproducible: Always
Stefan will eventually look into it. You should be able to work around it in the meantime by not deploying GMF to the server.
Created attachment 199586 [details] A small patch to fix this issue
Thanks for your patch, Steve. Yet, it's not entirely correct. Your patch will store the empty string in the database ("") if the default value of a feature is null. This eliminates the storing problem and works in all cases in which createFromString() -- which is called during reading from the DB -- can handle the empty string. But there might be custom data types which cannot serialize to the empty string (or worse: in which the empty string has a different meaning than null!) Therefor, I've created a test case and slightly modified your patch: If the default value is null, we write a null value to the database. This passes my testcase. Would you be so kind and test this patch for your situation and give feedback?
Created attachment 199782 [details] Patch-v2 Modified Patch and Testcase.
Hi, I tested your patch, Stefan. It works fine for my situation. Is it possible to have this fix on the 4.0 branch as well? Thanks
I see no problem in backporting it to 4.0, after it has gone into 4.1. I think we need a separate Bugzilla for this, if I am not mistaken.
Created attachment 199838 [details] Patch-v3 synchronized with TRUNK
Created attachment 200139 [details] Patch v4
Committed revision 8808: - trunk/plugins/org.eclipse.emf.cdo.server.db - trunk/plugins/org.eclipse.emf.cdo.tests
Created attachment 200205 [details] Patch-v5 synced with Trunk. Ready to be committed.
Note: Commit of comment#9 was done using patch-v5
Is this possible to apply this fix on the 4.0.X maintenance version ? It would be great, thanks !
Closing.