Issue Details (XML | Word | Printable)

Key: NUCNEOFORJ-20
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Jim White
Votes: 0
Watchers: 0
Operations

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

Running JDO tutorial a second time throws exception on deletion

Created: 01/Aug/12 08:56 AM   Updated: 02/Aug/12 03:08 PM   Resolved: 01/Aug/12 09:40 AM
Component/s: Persistence
Affects Version/s: 3.1.0.m1
Fix Version/s: 3.1.0.m2

Datastore: Other


 Description  « Hide
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:java (default-cli) on project datanucleus-samples-jdo-tutorial: An exception occured while executing the Java class. null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. null
at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:345)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:290)
at java.lang.Thread.run(Thread.java:680)
Caused by: javax.jdo.JDODataStoreException: Exception deleting object for StateManager[pc=org.datanucleus.samples.jdo.tutorial.Inventory@1e79edfe, lifecycle=P_DELETED]
NestedThrowables:
java.lang.NullPointerException
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:421)
at org.datanucleus.api.jdo.JDOPersistenceManager.jdoDeletePersistent(JDOPersistenceManager.java:810)
at org.datanucleus.api.jdo.JDOPersistenceManager.deletePersistent(JDOPersistenceManager.java:823)
at org.datanucleus.samples.jdo.tutorial.Main.main(Main.java:154)
... 6 more
Caused by: java.lang.NullPointerException
at org.datanucleus.store.neo4j.Neo4jPersistenceHandler.deleteObject(Neo4jPersistenceHandler.java:403)
at org.datanucleus.state.JDOStateManager.internalDeletePersistent(JDOStateManager.java:3423)
at org.datanucleus.state.JDOStateManager.deletePersistent(JDOStateManager.java:3382)
at org.datanucleus.ObjectManagerImpl.deleteObjectInternal(ObjectManagerImpl.java:2223)
at org.datanucleus.ObjectManagerImpl.deleteObjectWork(ObjectManagerImpl.java:2145)
at org.datanucleus.ObjectManagerImpl.deleteObject(ObjectManagerImpl.java:2096)
at org.datanucleus.api.jdo.JDOPersistenceManager.jdoDeletePersistent(JDOPersistenceManager.java:805)
... 8 more


Jim White added a comment - 01/Aug/12 09:06 AM
This is on my version modified to get the insertion done, so maybe the problem is earlier. Neo4jPersistenceHandler.deleteObject is called for an object that Neo4jUtils.getNodeForObjectProvider returns throws NotFound (in my version) or null (which would then result in an NPE). I tried catching the NotFound exception but then there are other weird errors on repeated runs on same tempDB file store. Gonna have to wait for this to cook a while longer I guess...

Andy Jefferson added a comment - 01/Aug/12 09:40 AM
Fixed in SVN trunk by simply commenting out the attempt to locate a Node for this object to be persisted.

Andy Jefferson made changes - 01/Aug/12 09:40 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.1.0.m2 [ 11637 ]
Resolution Fixed [ 1 ]
Jim White added a comment - 01/Aug/12 09:46 AM
Works! Guess I will try this out on my application... Thanks for the super quick response!

Andy Jefferson added a comment - 01/Aug/12 10:31 AM
Actually the problem was one of when deleting a Node, it has to be removed from any indexes that refer to it (there was I naively thinking that would be automatic). SVN trunk (and nightly build) does that and re-enables the check on duplicate objects, and you can run the tutorial as many times as wished

Andy Jefferson made changes - 02/Aug/12 03:08 PM
Status Resolved [ 5 ] Closed [ 6 ]