[syncope-dev] Issue 186 in syncope: Cannot add a resource to an existing user

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[syncope-dev] Issue 186 in syncope: Cannot add a resource to an existing user

syncope
Status: Accepted
Owner: [hidden email]
Labels: Type-Defect Priority-High Component-Logic Component-UI  
Milestone-Release-201112

New issue 186 by [hidden email]: Cannot add a resource to an  
existing user
http://code.google.com/p/syncope/issues/detail?id=186

What steps will reproduce the problem?
1. Create a new user from the console
2. Assign a resource to that user
3. Click Save

What is the expected output? What do you see instead?

I see no error on the console, but have the following stacktrace in  
Syncope's logs:

16:05:06.991 ERROR org.syncope.core.rest.controller.AbstractController -  
Exception thrown by REST methods
org.hibernate.LazyInitializationException: failed to lazily initialize a  
collection of role:  
org.syncope.core.persistence.beans.TargetResource.mappings, no session or  
session was closed
         at  
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)  
~[hibernate-core-3.6.7.Final.jar:3.6.7.Final]
         at  
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)  
~[hibernate-core-3.6.7.Final.jar:3.6.7.Final]
         at  
org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)  
~[hibernate-core-3.6.7.Final.jar:3.6.7.Final]
         at  
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)  
~[hibernate-core-3.6.7.Final.jar:3.6.7.Final]
         at  
org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272)  
~[hibernate-core-3.6.7.Final.jar:3.6.7.Final]
         at  
org.syncope.core.persistence.propagation.PropagationManager.prepareAttributes(PropagationManager.java:470)  
~[PropagationManager.class:na]
         at  
org.syncope.core.persistence.propagation.PropagationManager.provision(PropagationManager.java:220)  
~[PropagationManager.class:na]
         at  
org.syncope.core.persistence.propagation.PropagationManager.update(PropagationManager.java:165)  
~[PropagationManager.class:na]
         at  
org.syncope.core.workflow.ActivitiUserWorkflowAdapter.update(ActivitiUserWorkflowAdapter.java:214)  
~[ActivitiUserWorkflowAdapter.class:na]
...
at  
org.syncope.core.rest.controller.UserController.update(UserController.java:305)  
~[UserController.class:na]


Reply | Threaded
Open this post in threaded view
|

[syncope-dev] Re: Issue 186 in syncope: Cannot add a resource to an existing user

syncope
Updates:
        Status: Started

Comment #1 on issue 186 by [hidden email]: Cannot add a resource to  
an existing user
http://code.google.com/p/syncope/issues/detail?id=186

(No comment was entered for this change.)

Reply | Threaded
Open this post in threaded view
|

[syncope-dev] Re: Issue 186 in syncope: Cannot add a resource to an existing user

syncope

Comment #2 on issue 186 by [hidden email]: Cannot add a resource to  
an existing user
http://code.google.com/p/syncope/issues/detail?id=186

Using attached files it is easy to reproduce the problem.
Assuming you've saved all four files under /tmp, issue (having mvn -P dev):

curl -v -u admin:password -X POST -H "Content-Type: application/json"  
--data @/tmp/createOK.json  
http://localhost:9080/syncope/rest/user/create.json
curl -v -u admin:password -X POST -H "Content-Type: application/json"  
--data @/tmp/updateOK.json  
http://localhost:9080/syncope/rest/user/update.json

This will work.
If, instead you issue:

curl -v -u admin:password -X POST -H "Content-Type: application/json"  
--data @/tmp/createFAIL.json  
http://localhost:9080/syncope/rest/user/create.json
curl -v -u admin:password -X POST -H "Content-Type: application/json"  
--data @/tmp/updateFAIL.json  
http://localhost:9080/syncope/rest/user/update.json

you will face the exception reported.

Since updateOK.json and updateFAIL.json are almost equals (only user id is  
different), the difference must be in create*.json.
createFAIL.json does not provide values for type and firstname; type and cn  
(derived for "surname + ', ' + firstname") are mandatory for selected  
resource (ws-target-resource-2) mapping.

Attachments:
        createOK.json  1.5 KB
        updateOK.json  874 bytes
        createFAIL.json  1.2 KB
        updateFAIL.json  874 bytes

Reply | Threaded
Open this post in threaded view
|

[syncope-dev] Re: Issue 186 in syncope: Cannot add a resource to an existing user

syncope
Updates:
        Status: Fixed

Comment #3 on issue 186 by [hidden email]: Cannot add a resource to  
an existing user
http://code.google.com/p/syncope/issues/detail?id=186

(No comment was entered for this change.)