[Polarion] Connection between OSLC-Server and Consumer [message #1769986] |
Mon, 07 August 2017 09:48  |
Eclipse User |
|
|
|
Hello,
we are trying to connect to the Polarion OSLC-Server with a new OSLC-Client to get, edit and insert (new) requirements. We were able to set up the Eclipse Lyo Development Environment following the Tutorial http://wiki.eclipse.org/Lyo/BuildClient. Following up, we tested the connection routine from one of the examples:
public static void main(String[] args) throws ParseException {
String webContextUrl = "h t t p://[...]/polarion/oslc/rootservices";
try {
//STEP 1: Initialize a Jazz rootservices helper and indicate we're looking for the RequirementManagement catalog
// The root services for DOORs is found at /public level
JazzRootServicesHelper helper = new JazzRootServicesHelper(webContextUrl, OSLCConstants.OSLC_RM_V2);
//STEP 2: Create a new OSLC OAuth capable client, the parameter of following call should be provided
// by the system administrator of the DOORs Web Access server
OslcOAuthClient client = helper.initOAuthClient("Lyo_App", generated_Key);
Though, this already crashes while creating the new helper object. We are getting the following error code:
log4j:WARN No appenders could be found for logger (org.eclipse.lyo.client.oslc.jazz.JazzRootServicesHelper).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See h t t p://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.eclipse.lyo.client.exception.RootServicesException: OSLCC003: An error occurred processing the root services document. Server location: h t t p:/[...]/polarion/oslc/rootservices.
at org.eclipse.lyo.client.oslc.jazz.JazzRootServicesHelper.processRootServices(JazzRootServicesHelper.java:200)
at org.eclipse.lyo.client.oslc.jazz.JazzRootServicesHelper.<init>(JazzRootServicesHelper.java:117)
at oslc.client.oslc.client.App.test1(App.java:72)
at oslc.client.oslc.client.App.main(App.java:26)
Caused by: org.eclipse.lyo.client.exception.ResourceNotFoundException: OSLCC004: The requested resource could not be found. Resource: h t t p://[...]/polarion/oslc/rootservices Value: h t t p://open-services.net/xmlns/rm/1.0/rmServiceProviders.
at org.eclipse.lyo.client.oslc.jazz.JazzRootServicesHelper.getRootServicesProperty(JazzRootServicesHelper.java:215)
at org.eclipse.lyo.client.oslc.jazz.JazzRootServicesHelper.processRootServices(JazzRootServicesHelper.java:176)
... 3 more
When browsing h t t p://[...]/polarion/oslc/rootservices we can see that the RM-ServiceProvider is listed and we can use (manually) to get to the different Service-UIs.
rdf:Description rdf:about="h t t p://[...]/polarion/oslc/rootservices">
<dc:title xml:lang="en">Polarion OSLC Root Services</dc:title>
<jfs:oauthRealmName>Polarion</jfs:oauthRealmName>
<jfs:oauthDomain>h t tp://[...]</jfs:oauthDomain>
<jfs:oauthRequestConsumerKeyUrl rdf:resource="h t t p://[...]/polarion/oslc/services/oauth/requestKey"/>
<jfs:oauthApprovalModuleUrl rdf:resource="h t t p://[...]/polarion/oslc/services/oauth/approveKey"/>
<jfs:oauthRequestTokenUrl rdf:resource="h t t p://[...]/polarion/oslc/services/oauth/requestToken"/>
<jfs:oauthUserAuthorizationUrl rdf:resource="h t t p://[...]/polarion/oslc/services/oauth/authorize"/>
<jfs:oauthAccessTokenUrl rdf:resource="h t t p://[...]/polarion/oslc/services/oauth/accessToken"/>
<oslc_cm:cmServiceProviders rdf:resource="h t t p://[...]/polarion/oslc/services/catalog"/>
<oslc_rm:rmServiceProviders rdf:resource="h t t p://[...]/polarion/oslc/services/catalog"/>
<jd:oslcCatalogs>
<oslc:ServiceProviderCatalog rdf:about="h t t p://[...]/polarion/oslc/services/catalog">
<oslc:domain rdf:resource="h t t p://open-services.net/ns/cm#"/>
<oslc:domain rdf:resource="h t t p://open-services.net/ns/rm#"/>
</oslc:ServiceProviderCatalog>
</jd:oslcCatalogs>
</rdf:Description>
Did we miss some configuration of the OSLC-Server or the Lyo-Project that causes these connection errors? Any help would be appreciated!
Thank you very much in advance!
|
|
|
Re: [Polarion] Connection between OSLC-Server and Consumer [message #1770201 is a reply to message #1769986] |
Wed, 09 August 2017 05:38   |
Eclipse User |
|
|
|
Hi
How are you deducing the values of the generated_key paramter before your call to helper.initOAuthClient("Lyo_App", generated_Key) ?
Just to be sure, you need to follow the instructions on https://jazz.net/wiki/bin/view/Main/RootServicesSpecAddendum2 to obtain a consumer key. Namely,
you need to first POST some content to the jfs:oauthRequestConsumerKeyUrl uri, such as
* {
* "name": "some consumer name",
* "secretType": "string",
* "secret": "some secret",
* "trusted": "false",
* "userId": "admin_user_id"
* }
this will give you some key value (example {"key":"631f0101-d1d1-4f56-a3d9-68b4e2be3078"}, which you can then insert as a value in your code!
I also noticed that you are calling new JazzRootServicesHelper(webContextUrl, OSLCConstants.OSLC_RM_V2).
This might work. But what worked for me for sure is OSLCConstants.OSLC_CM
|
|
|
|
Re: [Polarion] Connection between OSLC-Server and Consumer [message #1770204 is a reply to message #1770203] |
Wed, 09 August 2017 05:50   |
Eclipse User |
|
|
|
Finally, I would be interested to know if you succeed in your original plan to get, edit and insert (new) requirements.
I have recently experimented with Polarion (and still am), and what I found so far is that Polarion only provides DelegatedUI services. There were no CreationFactories for example to let you create workItems.
|
|
|
Re: [Polarion] Connection between OSLC-Server and Consumer [message #1770432 is a reply to message #1770204] |
Fri, 11 August 2017 09:19   |
Eclipse User |
|
|
|
Hello Jad,
thank you very much for the information. We were now able to establish a connection to the OSLC-Server of Polarion.
Though, as you already commented, we are not able to get, edit and create requirements (yet), since currently only UIs are provided. I also asked the Polarion Support Team whether/how the oslc:CreationFactory and oslc:QueryCapabilities could be activated on the Polarion-OSLC-Server. This is their reply:
We consulted your question here and we received the following info for you:
Polarion does not support Creation Factories and Query Capabilities as of now.
The next Polarion release 17.2 will have a very basic implementation of creation factories but not a full implementation.
Furthermore, refering to your comment on the OSLC.Constants.CM/RM topic:
When browsing h t t p://[...]/polarion/oslc/rootservices, our Polarion-OSLC-Server only provided a <oslc_cm:cmServiceProviders rdf:resource="http://[...]/polarion/oslc/services/catalog"/> but no rmServiceProvider. To activate the rmServiceProvider, it is necessary to enable it in the polarion.properties of the server-configuration (it is disabled by default), by adding the following line:
com.siemens.polarion.oslc.rmProvider.enabled=true
|
|
|
|
Powered by
FUDForum. Page generated in 0.04434 seconds