Ticket #1041 (new Defect)

Opened 8 years ago

Last modified 8 years ago

calling getPlayer in a postCreateAssociaton Listener throws storage exception

Reported by: Malte Owned by: jri
Priority: Major Milestone: Release 4.9
Component: DeepaMehta Standard Distribution Version: 4.8.4
Keywords: Cc: jri
Complexity: 3 Area: Application Framework / API
Module:

Description (last modified by Malte) (diff)

Just wanted to let you know, when using the postCreateAssoc-Listener...

When adding a "Date of Birth" or "Phone Entry" to a new "Person", or creating an "Event" with a "From" and "To" topic accessing the player via getPlayer throws the following storage exception.

I am trying to tune in to specific workspace assignments.

@Override
public void postCreateAssociation(Association association) {
    if (association.getTypeUri().equals(TOPICMAP_MAPCONTEXT)) {
        ...
    } else if (association.getTypeUri().equals(AGGREGATION)) {
        log.info("Created Association " + association);
        // Topic workspace = association.getTopic(WORKSPACE);
        // When adding a "Date of Birth" or "Phone Entry" to a "Person" entry, or creating an "Event" with a "From" and "To" topic this throws ...
        DeepaMehtaObject player1 = association.getPlayer1(); // graphdb.NotFoundException: 'value' property not found for NodeImpl#6581
        if (association.getPlayer1().getTypeUri().equals(WORKSPACE) 
         || association.getPlayer2().getTypeUri().equals(WORKSPACE)) {
            DeepaMehtaObject otherElement = (association.getPlayer1().getTypeUri().equals(WORKSPACE)) ? association.getPlayer2() : association.getPlayer1();
            DeepaMehtaObject workspaceElement = (association.getPlayer1().getTypeUri().equals(WORKSPACE)) ? association.getPlayer1() : association.getPlayer2();
            log.info("Workspace Assignment of a \"" + otherElement.getTypeUri() + "\" to \"" + workspaceElement.getSimpleValue() + "\"");
        }
    }
}
Nov 17, 2016 9:42:23 AM org.deepamehta.notifications.NotificationsPlugin postCreateAssociation
INFO: Added Topic of type "dm4.events.event" to Topicmap "untitled"
Nov 17, 2016 9:42:35 AM de.deepamehta.core.impl.DeepaMehtaObjectModelImpl update
INFO: Updating topic 7118 (typeUri="dm4.events.event")
Nov 17, 2016 9:42:35 AM org.deepamehta.notifications.NotificationsPlugin postCreateAssociation
INFO: Created Association association (id=7129, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        association role (roleTypeUri="dm4.core.parent", playerId=7127), 
        topic role (roleTypeUri="dm4.core.child", playerId=2251))
Nov 17, 2016 9:42:35 AM org.deepamehta.notifications.NotificationsPlugin postCreateAssociation
INFO: Workspace Assignment of a "dm4.core.aggregation" to "DeepaMehta"
Nov 17, 2016 9:42:35 AM org.deepamehta.notifications.NotificationsPlugin postCreateAssociation
INFO: Created Association association (id=7127, uri="", typeUri="dm4.core.aggregation", value="", childTopics={dm4.workspaces.workspace=reference topic (id=2251, uri="dm4.workspaces.deepamehta", typeUri="dm4.workspaces.workspace", value="DeepaMehta", childTopics={dm4.workspaces.sharing_mode=topic (id=2237, uri="dm4.workspaces.public", typeUri="dm4.workspaces.sharing_mode", value="Public", childTopics={}), relating association (id=2257, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=2251), 
        topic role (roleTypeUri="dm4.core.child", playerId=2237)), dm4.workspaces.name=topic (id=2252, uri="", typeUri="dm4.workspaces.name", value="DeepaMehta", childTopics={}), relating association (id=2255, uri="", typeUri="dm4.core.composition", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=2251), 
        topic role (roleTypeUri="dm4.core.child", playerId=2252))}), relating association (id=7129, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        association role (roleTypeUri="dm4.core.parent", playerId=7127), 
        topic role (roleTypeUri="dm4.core.child", playerId=2251))}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=7126), 
        topic role (roleTypeUri="dm4.core.child", playerId=464))
Nov 17, 2016 9:42:35 AM de.deepamehta.core.util.UniversalExceptionMapper logException
SEVERE: Request "PUT /core/topic/7118" failed. Responding with 500 (Internal Server Error). The original exception/error is:
java.lang.RuntimeException: Updating topic 7118 failed
	at de.deepamehta.core.impl.PersistenceLayer.updateTopic(PersistenceLayer.java:180)
	at de.deepamehta.core.impl.CoreServiceImpl.updateTopic(CoreServiceImpl.java:123)
	at de.deepamehta.webservice.WebservicePlugin.updateTopic(WebservicePlugin.java:110)
	at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1480)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1411)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:339)
	at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:300)
	at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:93)
	at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:50)
	at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:31)
	at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:76)
	at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:49)
	at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:370)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Updating topic 7118 failed (typeUri="dm4.events.event")
	at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl.update(DeepaMehtaObjectModelImpl.java:408)
	at de.deepamehta.core.impl.PersistenceLayer.updateTopic(PersistenceLayer.java:173)
	... 52 more
Caused by: java.lang.RuntimeException: Updating the child topics of topic 7118 failed
	at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl._updateChildTopics(DeepaMehtaObjectModelImpl.java:529)
	at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl.update(DeepaMehtaObjectModelImpl.java:397)
	... 53 more
Caused by: java.lang.RuntimeException: Creating topic 7125 failed (typeUri="dm4.datetime")
	at de.deepamehta.core.impl.PersistenceLayer.createTopic(PersistenceLayer.java:160)
	at de.deepamehta.core.impl.PersistenceLayer.createTopic(PersistenceLayer.java:129)
	at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl.createAndAssociateChildTopic(DeepaMehtaObjectModelImpl.java:799)
	at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl.createChildTopicOne(DeepaMehtaObjectModelImpl.java:784)
	at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl.updateCompositionOne(DeepaMehtaObjectModelImpl.java:686)
	at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl.updateChildTopics(DeepaMehtaObjectModelImpl.java:546)
	at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl._updateChildTopics(DeepaMehtaObjectModelImpl.java:523)
	... 54 more
Caused by: java.lang.RuntimeException: Storing the child topics of object 7125 failed ({dm4.datetime.time=topic (id=-1, uri="null", typeUri="dm4.datetime.time", value="null", childTopics={dm4.datetime.hour=reference topic (id=596, uri="null", typeUri="null", value="null", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null), dm4.datetime.minute=reference topic (id=668, uri="null", typeUri="null", value="null", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null)}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null), dm4.datetime.date=topic (id=7126, uri="", typeUri="dm4.datetime.date", value="", childTopics={dm4.datetime.month=reference topic (id=464, uri="", typeUri="dm4.datetime.month", value="2", childTopics={}), relating association (id=7127, uri="", typeUri="dm4.core.aggregation", value="", childTopics={dm4.workspaces.workspace=reference topic (id=2251, uri="dm4.workspaces.deepamehta", typeUri="dm4.workspaces.workspace", value="DeepaMehta", childTopics={dm4.workspaces.sharing_mode=topic (id=2237, uri="dm4.workspaces.public", typeUri="dm4.workspaces.sharing_mode", value="Public", childTopics={}), relating association (id=2257, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=2251), 
        topic role (roleTypeUri="dm4.core.child", playerId=2237)), dm4.workspaces.name=topic (id=2252, uri="", typeUri="dm4.workspaces.name", value="DeepaMehta", childTopics={}), relating association (id=2255, uri="", typeUri="dm4.core.composition", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=2251), 
        topic role (roleTypeUri="dm4.core.child", playerId=2252))}), relating association (id=7129, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        association role (roleTypeUri="dm4.core.parent", playerId=7127), 
        topic role (roleTypeUri="dm4.core.child", playerId=2251))}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=7126), 
        topic role (roleTypeUri="dm4.core.child", playerId=464)), dm4.datetime.day=reference topic (id=500, uri="null", typeUri="null", value="null", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null), dm4.datetime.year=reference topic (id=590, uri="null", typeUri="null", value="null", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null)}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null)})
	at de.deepamehta.core.impl.ValueStorage.storeChildTopics(ValueStorage.java:135)
	at de.deepamehta.core.impl.ValueStorage.storeValue(ValueStorage.java:95)
	at de.deepamehta.core.impl.PersistenceLayer.createTopic(PersistenceLayer.java:143)
	... 60 more
Caused by: java.lang.RuntimeException: Creating topic 7126 failed (typeUri="dm4.datetime.date")
	at de.deepamehta.core.impl.PersistenceLayer.createTopic(PersistenceLayer.java:160)
	at de.deepamehta.core.impl.PersistenceLayer.createTopic(PersistenceLayer.java:129)
	at de.deepamehta.core.impl.ValueStorage.storeChildTopic(ValueStorage.java:145)
	at de.deepamehta.core.impl.ValueStorage.storeChildTopics(ValueStorage.java:121)
	... 62 more
Caused by: java.lang.RuntimeException: Storing the child topics of object 7126 failed ({dm4.datetime.month=reference topic (id=464, uri="", typeUri="dm4.datetime.month", value="2", childTopics={}), relating association (id=7127, uri="", typeUri="dm4.core.aggregation", value="", childTopics={dm4.workspaces.workspace=reference topic (id=2251, uri="dm4.workspaces.deepamehta", typeUri="dm4.workspaces.workspace", value="DeepaMehta", childTopics={dm4.workspaces.sharing_mode=topic (id=2237, uri="dm4.workspaces.public", typeUri="dm4.workspaces.sharing_mode", value="Public", childTopics={}), relating association (id=2257, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=2251), 
        topic role (roleTypeUri="dm4.core.child", playerId=2237)), dm4.workspaces.name=topic (id=2252, uri="", typeUri="dm4.workspaces.name", value="DeepaMehta", childTopics={}), relating association (id=2255, uri="", typeUri="dm4.core.composition", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=2251), 
        topic role (roleTypeUri="dm4.core.child", playerId=2252))}), relating association (id=7129, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        association role (roleTypeUri="dm4.core.parent", playerId=7127), 
        topic role (roleTypeUri="dm4.core.child", playerId=2251))}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=7126), 
        topic role (roleTypeUri="dm4.core.child", playerId=464)), dm4.datetime.day=reference topic (id=500, uri="null", typeUri="null", value="null", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null), dm4.datetime.year=reference topic (id=590, uri="null", typeUri="null", value="null", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null)})
	at de.deepamehta.core.impl.ValueStorage.storeChildTopics(ValueStorage.java:135)
	at de.deepamehta.core.impl.ValueStorage.storeValue(ValueStorage.java:95)
	at de.deepamehta.core.impl.PersistenceLayer.createTopic(PersistenceLayer.java:143)
	... 65 more
Caused by: java.lang.RuntimeException: Creating association failed (association (id=7127, uri="", typeUri="dm4.core.aggregation", value="", childTopics={dm4.workspaces.workspace=reference topic (id=2251, uri="dm4.workspaces.deepamehta", typeUri="dm4.workspaces.workspace", value="DeepaMehta", childTopics={dm4.workspaces.sharing_mode=topic (id=2237, uri="dm4.workspaces.public", typeUri="dm4.workspaces.sharing_mode", value="Public", childTopics={}), relating association (id=2257, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=2251), 
        topic role (roleTypeUri="dm4.core.child", playerId=2237)), dm4.workspaces.name=topic (id=2252, uri="", typeUri="dm4.workspaces.name", value="DeepaMehta", childTopics={}), relating association (id=2255, uri="", typeUri="dm4.core.composition", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=2251), 
        topic role (roleTypeUri="dm4.core.child", playerId=2252))}), relating association (id=7129, uri="", typeUri="dm4.core.aggregation", value="", childTopics={}, 
        association role (roleTypeUri="dm4.core.parent", playerId=7127), 
        topic role (roleTypeUri="dm4.core.child", playerId=2251))}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=7126), 
        topic role (roleTypeUri="dm4.core.child", playerId=464)))
	at de.deepamehta.core.impl.PersistenceLayer.createAssociation(PersistenceLayer.java:330)
	at de.deepamehta.core.impl.ValueStorage.associateChildTopic(ValueStorage.java:187)
	at de.deepamehta.core.impl.ValueStorage.storeChildTopic(ValueStorage.java:147)
	at de.deepamehta.core.impl.ValueStorage.storeChildTopics(ValueStorage.java:121)
	... 67 more
Caused by: java.lang.RuntimeException: An error occurred in the PostCreateAssociationListener of plugin "DeepaMehta 4 Notifications"
	at de.deepamehta.core.impl.EventManager.dispatchEvent(EventManager.java:96)
	at de.deepamehta.core.impl.EventManager.fireEvent(EventManager.java:59)
	at de.deepamehta.core.impl.PersistenceLayer.createAssociation(PersistenceLayer.java:327)
	... 70 more
Caused by: org.neo4j.graphdb.NotFoundException: 'value' property not found for NodeImpl#7126.
	at org.neo4j.kernel.impl.core.Primitive.newPropertyNotFoundException(Primitive.java:184)
	at org.neo4j.kernel.impl.core.Primitive.getProperty(Primitive.java:179)
	at org.neo4j.kernel.impl.core.NodeImpl.getProperty(NodeImpl.java:52)
	at org.neo4j.kernel.impl.core.NodeProxy.getProperty(NodeProxy.java:155)
	at de.deepamehta.storage.neo4j.Neo4jStorage.simpleValue(Neo4jStorage.java:1093)
	at de.deepamehta.storage.neo4j.Neo4jStorage.buildTopic(Neo4jStorage.java:902)
	at de.deepamehta.storage.neo4j.Neo4jStorage.fetchTopic(Neo4jStorage.java:118)
	at de.deepamehta.core.impl.StorageDecorator.fetchTopic(StorageDecorator.java:48)
	at de.deepamehta.core.impl.TopicRoleModelImpl.getPlayer(TopicRoleModelImpl.java:118)
	at de.deepamehta.core.impl.TopicRoleImpl.getPlayer(TopicRoleImpl.java:28)
	at de.deepamehta.core.impl.AssociationImpl.getPlayer1(AssociationImpl.java:65)
	at org.deepamehta.notifications.NotificationsPlugin.postCreateAssociation(NotificationsPlugin.java:278)
	at de.deepamehta.core.impl.CoreEvent$8.dispatch(CoreEvent.java:104)
	at de.deepamehta.core.impl.EventManager.dispatchEvent(EventManager.java:83)
	... 72 more

Nov 17, 2016 9:42:35 AM de.deepamehta.core.impl.TransactionFactory$TransactionResourceFilter$2 filter
WARNING: ### Rollback transaction of de.deepamehta.webservice.WebservicePlugin#updateTopic()

Change History

comment:1 Changed 8 years ago by Malte

  • Description modified (diff)

Changed the stacktrace to correspond with the actual code snippet.
Source code see also https://github.com/mukil/dm4-notifications/commit/29e36b199ec48705e35630b684feba20cb78db92#diff-ae97910b50035c13c2ef8686e101ab1cR264

Note: See TracTickets for help on using tickets.