Re: REST Web Service

2017-03-30 Thread Tech

We are still working on the Rest connector.

Modifying the CreateScript.groovy we inserted some log and we detected 
that we are not able to retrieve any id information.


From the logs we have the feeling that the " 
node.set("key",node.textNode(id)) " is not able to retrieve any value: 
we can read the information about the user like firstname, surname, etc, 
but we get a UnsupportedOperationException when we try to run the key = 
node.get(¨key¨).textValue();
where the key is "null" and we are not able to correctly create the 
value key.


We want to mention that we are not able yet to arrive to contact the 
REST ws, we still need to get out from Syncope.


Thanks





On 29.03.17 20:34, Tech wrote:

Hello Francesco,

thanks for the reply, and actually the tips of the 
ReloadScriptOnExecution was really useful to debug the code.


Regards




On 21.03.17 08:59, Francesco Chicchiriccò wrote:

On 20/03/2017 15:45, Tech wrote:

Dear experts,

we are trying to configure a REST Web Service, but we don't how it 
should be deployed.


We found in the /test directory some groovy script to 
Create/Update/etc, but we don't understand in a real environment 
where these script should be copied before compiling.


Hi,
both the Scripted REST [1] and the Scripted SQL [2] connector bundles 
share the same approach: the actual implementation of the ConnId 
operations (e.g. the child classes of [3], as CREATE, UPDATE, DELETE, 
SEARCH, SYNC, AUTHENTICATE, ...) is delegated to individual Groovy 
scripts.


The immediate benefit of this approach is that you can adapt the 
actual logic for dealing with a specific REST service or a given 
database, thus achieving the maximum flexibility; the downside is 
that you need to code the scripts, and this requires some skills.


You can find some samples of scripts for the REST connector in the 
folder


core/src/test/resources/rest

of your generated Maven project, or at [4], and scripts for the 
Scripted SQL connector in the folder


core/src/test/resources/scriptedsql

of your generated Maven project, or at [5].
As you can easily figure out, the actual script content only makes 
sense when dealing with the specific REST service / database they 
were designed for, e.g. [6] and [7] respectively.


An important feature for speeding up the development of these scripts 
is the 'Reload Script On Execution' connector property: when set to 
true, each script is reloaded and recompiled every time it is called, 
e.g. every time that the corresponding ConnId operation is invoked by 
Syncope.
In this way one can immediately check if the script is running fine 
or find out errors.

Please do not forge to disable this property once running in production!

Finally, consider that each script can be passed - in the connector 
configuration - either as actual content or as absolute file path: 
this is the reason why there are "Create Script" and "Create Script 
Filename", "Update Script" and "Update Script Filename", etc.


Hope this clarifies.
Regards.

[1] https://connid.atlassian.net/wiki/display/BASE/REST
[2] https://connid.atlassian.net/wiki/display/BASE/Scripted+SQL
[3] 
http://connid.tirasa.net/apidocs/1.4/org/identityconnectors/framework/spi/operations/SPIOperation.html
[4] 
https://github.com/apache/syncope/tree/2_0_X/fit/core-reference/src/test/resources/rest
[5] 
https://github.com/apache/syncope/tree/2_0_X/fit/core-reference/src/test/resources/scriptedsql
[6] 
https://github.com/apache/syncope/blob/2_0_X/fit/build-tools/src/main/java/org/apache/syncope/fit/buildtools/cxf/UserService.java
[7] 
https://github.com/apache/syncope/blob/2_0_X/fit/build-tools/src/main/resources/testdb.sql#L46-L51








Error with openJPA multithreading

2017-03-30 Thread rajkumar
Hi All,

i have configured syncope in 2 environment (Dev and Prod). in DEV
environment i am not facing any issues but In production environment below
issues i am facing. Kindly help me to solve the issue.

I am running the Task and i am able to update and create users, but after
the step when i try to go to any other page, window keep on loading and
getting timeout to read error. In log file i am getting below error.


*09:31:15.459 ERROR org.apache.syncope.client.console.widgets.JobWidget -
Unexpected error while checking for updated Job info
org.apache.syncope.common.lib.SyncopeClientException: Unknown
[PersistenceException: Multiple concurrent threads attempted to access a
single broker. By default brokers are not thread safe; if you require and/or
intend a broker to be accessed by more than one thread, set the
openjpa.Multithreaded property to true to override the default behavior.]
at
org.apache.syncope.common.lib.SyncopeClientException.build(SyncopeClientException.java:37)
~[syncope-common-lib-2.0.2.jar:2.0.2]*


Kindly help me with this issue to resolve. In my search i found that, we
need to change the openJPA.Multithreading property to true. Kindly assist me
where i can find the exact path to change the same or let me know if any
alternate solution there.

Thanks in advance.

--
View this message in context: 
http://syncope-user.1051894.n5.nabble.com/Error-with-openJPA-multithreading-tp5709137.html
Sent from the syncope-user mailing list archive at Nabble.com.