Ticket #889 (new Defect)

Opened 5 years ago

Last modified 4 years ago

unable to automatically assign topics to "private workspace" after user account creation

Reported by: Malte Owned by: jri
Priority: Major Milestone:
Component: DeepaMehta Standard Distribution Version: 4.7
Keywords: Cc:
Complexity: 3 Area:
Module: deepamehta-core

Description

Consuming the postCreateTopic()-hook to listen on user account creation one is unable to fetch the "private workspace" of the user:

The following exception is thrown:

Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.accesscontrol.AccessControlPlugin createUserAccount
INFORMATION: Creating user account "kalle"
Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.config.ConfigPlugin createConfigTopic
INFORMATION: ### Creating config topic of type "dm4.files.disk_quota" for topic 4111
Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 4114 (typeUri="dm4.files.disk_quota", uri="") SUPPRESSED
Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for association 4117 (typeUri="dm4.config.configuration") SUPPRESSED
Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.config.ConfigPlugin createConfigTopic
INFORMATION: ### Creating config topic of type "dm4.accesscontrol.login_enabled" for topic 4111
Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 4121 (typeUri="dm4.accesscontrol.login_enabled", uri="") SUPPRESSED
Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for association 4124 (typeUri="dm4.config.configuration") SUPPRESSED
Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 4111 (typeUri="dm4.accesscontrol.username", uri="") SUPPRESSED
Nov 17, 2015 4:02:23 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 4128 (typeUri="de.mikromedia.site", uri="") SUPPRESSED
Nov 17, 2015 4:02:23 PM de.deepamehta.core.util.UniversalExceptionMapper logException
SCHWERWIEGEND: Request "POST /accesscontrol/user_account" failed. Responding with 500 (Internal Server Error). The original exception/error is:
java.lang.RuntimeException: Creating user account "kalle" failed
	at de.deepamehta.plugins.accesscontrol.AccessControlPlugin.createUserAccount(AccessControlPlugin.java:252)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	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: Creating topic failed (topic (id=4110, uri="", typeUri="dm4.accesscontrol.user_account", value="", childTopics={dm4.accesscontrol.username=topic (id=4111, uri="", typeUri="dm4.accesscontrol.username", value="kalle", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null), dm4.accesscontrol.password=topic (id=-1, uri="null", typeUri="dm4.accesscontrol.password", value="-SHA256-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null)}))
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:740)
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:157)
	at de.deepamehta.plugins.accesscontrol.AccessControlPlugin$3.call(AccessControlPlugin.java:219)
	at de.deepamehta.plugins.accesscontrol.AccessControlPlugin$3.call(AccessControlPlugin.java:216)
	at de.deepamehta.core.impl.AccessControlImpl.runWithoutWorkspaceAssignment(AccessControlImpl.java:208)
	at de.deepamehta.plugins.accesscontrol.AccessControlPlugin.createUserAccount(AccessControlPlugin.java:216)
	... 51 more
Caused by: java.lang.RuntimeException: Storing the child topics of object 4110 failed ({dm4.accesscontrol.username=topic (id=4111, uri="", typeUri="dm4.accesscontrol.username", value="kalle", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null), dm4.accesscontrol.password=topic (id=-1, uri="null", typeUri="dm4.accesscontrol.password", value="-SHA256-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null)})
	at de.deepamehta.core.impl.ValueStorage.storeChildTopics(ValueStorage.java:224)
	at de.deepamehta.core.impl.ValueStorage.storeValue(ValueStorage.java:104)
	at de.deepamehta.core.impl.EmbeddedService.topicFactory(EmbeddedService.java:763)
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:736)
	... 56 more
Caused by: java.lang.RuntimeException: Creating topic failed (topic (id=4111, uri="", typeUri="dm4.accesscontrol.username", value="kalle", childTopics={}), relating association (id=-1, uri="null", typeUri="null", value="null", childTopics={}, null, null))
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:740)
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:157)
	at de.deepamehta.core.impl.ValueStorage.storeChildTopic(ValueStorage.java:234)
	at de.deepamehta.core.impl.ValueStorage.storeChildTopics(ValueStorage.java:210)
	... 59 more
Caused by: java.lang.RuntimeException: An error occurred in the PostCreateTopicListener of plugin "Mikromedia DM 4 Webpages"
	at de.deepamehta.core.impl.EventManager.deliverEvent(EventManager.java:110)
	at de.deepamehta.core.impl.EventManager.fireEvent(EventManager.java:63)
	at de.deepamehta.core.impl.EmbeddedService.fireEvent(EmbeddedService.java:531)
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:737)
	... 62 more
Caused by: java.lang.RuntimeException: Data inconsistency: there is no User Account topic for username "kalle" (usernameTopic=topic (id=4111, uri="", typeUri="dm4.accesscontrol.username", value="kalle", childTopics={}))
	at de.deepamehta.core.impl.AccessControlImpl._getUserAccount(AccessControlImpl.java:333)
	at de.deepamehta.core.impl.AccessControlImpl.getPasswordTopic(AccessControlImpl.java:321)
	at de.deepamehta.core.impl.AccessControlImpl.getPrivateWorkspace(AccessControlImpl.java:266)
	at de.mikromedia.webpages.WebpagePlugin.postCreateTopic(WebpagePlugin.java:189)
	at de.deepamehta.core.impl.CoreEvent$5.deliver(CoreEvent.java:72)
	at de.deepamehta.core.impl.EventManager.deliverEvent(EventManager.java:97)
	... 65 more

Nov 17, 2015 4:02:23 PM de.deepamehta.core.impl.TransactionFactory$TransactionResourceFilter$2 filter
WARNUNG: ### Rollback transaction of AbstractSubResourceMethod(AccessControlPlugin#createUserAccount)

Thanks for your help.

Change History

comment:1 Changed 5 years ago by jri

Oh, that's interesting!
You're revealing a general issue here, in conjunction with postCreateTopic listeners and composite structures.

Generally: in the moment the postCreateTopic event is fired for a child topic it is not yet attached to its parent.

Access Control: accessing a user's private workspace requires the corresponding user account to be created completely (that is 3 topics: User Account, Username, Password, as well as the 2 respective child associations).

So, you must not react before the entire user account is created. Unfortunately there is no such event at the moment. And I'm hesitating to introduce a proprietary postCreateUserAccount event as this is a general issue (as indicated above).

A possible workaround might be to not listen for a postCreateTopic event but to postCreateAssociation. The idea is that you know that the final operation that makes a user account complete is the creation of a child association.

    public void postCreateAssociation(Association assoc) {
        if (assoc.getTypeUri().equals("dm4.core.composition")) {
            Topic topic = assoc.getTopic("dm4.core.child");
            if (topic != null && topic.getTypeUri().equals("dm4.accesscontrol.username")) {
                ....
            }
        }
    }

However, at the moment I don't actually know if the order in which the child topics (Username, Password) are created is deterministic. You must be sure that both are attached already. So the required logic might be more complicated than sketched out here.

Thank you for revealing this crucial general issue!
I need to think about a general solution.

comment:2 Changed 5 years ago by Malte

Now, what i tried is listening to the creation of the composite (dm4.accesscontrol.user_account) and with that there does not seem to be sucha n issue.

Nonetheless the error is just shifted to the next topic (missing).

g! Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.accesscontrol.AccessControlPlugin createUserAccount
INFORMATION: Creating user account "god"
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.config.ConfigPlugin createConfigTopic
INFORMATION: ### Creating config topic of type "dm4.files.disk_quota" for topic 5618
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 5621 (typeUri="dm4.files.disk_quota", uri="") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for association 5624 (typeUri="dm4.config.configuration") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.config.ConfigPlugin createConfigTopic
INFORMATION: ### Creating config topic of type "dm4.accesscontrol.login_enabled" for topic 5618
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 5628 (typeUri="dm4.accesscontrol.login_enabled", uri="") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for association 5631 (typeUri="dm4.config.configuration") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 5618 (typeUri="dm4.accesscontrol.username", uri="") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for association 5635 (typeUri="dm4.core.composition") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 5637 (typeUri="dm4.accesscontrol.password", uri="") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for association 5640 (typeUri="dm4.core.composition") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 5617 (typeUri="dm4.accesscontrol.user_account", uri="") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.mikromedia.webpages.WebpagePlugin postCreateTopic
INFORMATION: User Account Creation Post Create Listener: {"id":5617,"uri":"","type_uri":"dm4.accesscontrol.user_account","value":"god","childs":{"dm4.accesscontrol.username":{"id":5618,"uri":"","type_uri":"dm4.accesscontrol.username","value":"god","childs":{},"assoc":{"id":5635,"uri":"","type_uri":"dm4.core.composition","value":"","childs":{},"role_1":{"topic_id":5617,"role_type_uri":"dm4.core.parent"},"role_2":{"topic_id":5618,"role_type_uri":"dm4.core.child"}}},"dm4.accesscontrol.password":{"id":5637,"uri":"","type_uri":"dm4.accesscontrol.password","value":"-SHA256-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","childs":{},"assoc":{"id":5640,"uri":"","type_uri":"dm4.core.composition","value":"","childs":{},"role_1":{"topic_id":5617,"role_type_uri":"dm4.core.parent"},"role_2":{"topic_id":5637,"role_type_uri":"dm4.core.child"}}}}}
Nov 22, 2015 8:49:55 PM de.deepamehta.plugins.workspaces.WorkspacesPlugin workspaceAssignmentIsSuppressed
INFORMATION: Standard workspace assignment for topic 5644 (typeUri="de.mikromedia.site", uri="") SUPPRESSED
Nov 22, 2015 8:49:55 PM de.mikromedia.webpages.WebpagePlugin postCreateTopic
INFORMATION: Trying to fetch private workspace of new user: god
Nov 22, 2015 8:49:55 PM de.deepamehta.core.util.UniversalExceptionMapper logException
SCHWERWIEGEND: Request "POST /accesscontrol/user_account" failed. Responding with 500 (Internal Server Error). The original exception/error is:
java.lang.RuntimeException: Creating user account "god" failed
	at de.deepamehta.plugins.accesscontrol.AccessControlPlugin.createUserAccount(AccessControlPlugin.java:252)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	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: Creating topic failed (topic (id=5617, uri="", typeUri="dm4.accesscontrol.user_account", value="god", childTopics={dm4.accesscontrol.username=topic (id=5618, uri="", typeUri="dm4.accesscontrol.username", value="god", childTopics={}), relating association (id=5635, uri="", typeUri="dm4.core.composition", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=5617), 
        topic role (roleTypeUri="dm4.core.child", playerId=5618)), dm4.accesscontrol.password=topic (id=5637, uri="", typeUri="dm4.accesscontrol.password", value="-SHA256-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", childTopics={}), relating association (id=5640, uri="", typeUri="dm4.core.composition", value="", childTopics={}, 
        topic role (roleTypeUri="dm4.core.parent", playerId=5617), 
        topic role (roleTypeUri="dm4.core.child", playerId=5637))}))
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:740)
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:157)
	at de.deepamehta.plugins.accesscontrol.AccessControlPlugin$3.call(AccessControlPlugin.java:219)
	at de.deepamehta.plugins.accesscontrol.AccessControlPlugin$3.call(AccessControlPlugin.java:216)
	at de.deepamehta.core.impl.AccessControlImpl.runWithoutWorkspaceAssignment(AccessControlImpl.java:208)
	at de.deepamehta.plugins.accesscontrol.AccessControlPlugin.createUserAccount(AccessControlPlugin.java:216)
	... 51 more
Caused by: java.lang.RuntimeException: An error occurred in the PostCreateTopicListener of plugin "Mikromedia DM 4 Webpages"
	at de.deepamehta.core.impl.EventManager.deliverEvent(EventManager.java:110)
	at de.deepamehta.core.impl.EventManager.fireEvent(EventManager.java:63)
	at de.deepamehta.core.impl.EmbeddedService.fireEvent(EmbeddedService.java:531)
	at de.deepamehta.core.impl.EmbeddedService.createTopic(EmbeddedService.java:737)
	... 56 more
Caused by: java.lang.RuntimeException: User "god" has no private workspace
	at de.deepamehta.core.impl.AccessControlImpl.getPrivateWorkspace(AccessControlImpl.java:269)
	at de.mikromedia.webpages.WebpagePlugin.postCreateTopic(WebpagePlugin.java:161)
	at de.deepamehta.core.impl.CoreEvent$5.deliver(CoreEvent.java:72)
	at de.deepamehta.core.impl.EventManager.deliverEvent(EventManager.java:97)
	... 59 more

Nov 22, 2015 8:49:55 PM de.deepamehta.core.impl.TransactionFactory$TransactionResourceFilter$2 filter
WARNUNG: ### Rollback transaction of AbstractSubResourceMethod(AccessControlPlugin#createUserAccount)

So, may be then the solution (for my specific case is) to listen to the creation of a "Private Workspaces" (as such is created _also_ on every user account creation). I would just need to check if it's the "Private Workspace" of a user, i have at hand.

comment:3 Changed 5 years ago by Malte

Furthermore, it just occurred to me because i installed my plugin into an existing installation, i must be able to cover another case, too!

In this case (if there are already "User Accounts" in the database, atm of installation of my plugin), my plugin must be able to iterate over all existing "Usernames" in an imperative Migration and create its topic in each "Private workspace".

comment:4 Changed 4 years ago by jri

  • Milestone Release 4.7 deleted
Note: See TracTickets for help on using tickets.