Closed jamsden closed 5 years ago
Interesting. I believe the mismatch of the URLs to be the fault of the server. I would start by fixing the consistency of the server response and then handling this case as a more advanced one (fool-proof, so to speak). Could you point me to the right branch and the module you run as a server, please? Or is it an OSLC server that is built in into a product? I can try to investigate.
-- /Andrew
23 jan. 2019 kl. 21:28 skrev Jim Amsden notifications@github.com<mailto:notifications@github.com>:
The JAX-RS 2.0/Jersey implementation of oslc-java-client does not return any members when running the GenericCMSample.java program. When initializeRdf() attempts to get the membersResource, its searching the refModel for a resource whose subject is the query.getCapabilityUrl(). When invoked from GenericCMSample, that URL looks like http://192.168.1.140:8080/OSLC4JChangeManagement/services/changeRequests. However, examining the content of the Jena rdfModel, the subject URIs look like http://localhost:8080/OSLC4JChangeManagement/services/changeRequests, so these aren't matching and the membersResource is null.
All the URLs in the ServiceProvider have http://192.168.1.140:8080, so that's why the queryCapability URI starts with http://192.168.1.140:8080.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/eclipse/lyo.client/issues/23, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAD83sXIOcOm5VQhhntchnOO-jbybHXbks5vGMXQgaJpZM4aPkbG.
I'm guessing that if you don't use localhost (which is always a bad practice), it will work. I'll try that tomorrow. Busy tonight.
oslc4j-cm-sample on master is the server I used. GenericCMSample is sample client application. lyo.core and lyo.client are on branch F_jax-rs-2.0-post2.4.0.
I recall having this issue, and I suspect it is because the oslc4j-cm-sample server is not setting 2 parameters for lyo.core, namely publicURI and servletPath. These 2 parameters let the server specify how lyo.core create URIs.
Compare the method contextInitialized() from this sample adaptor-rm-webapp (https://github.com/OSLC/lyo-adaptor-sample-modelling/blob/master/adaptor-rm-webapp/src/main/java/com/sample/rm/servlet/ServletListener.java) Notice the method calls on lines 71 & 72:
OSLC4JUtils.setPublicURI(baseUrl);
OSLC4JUtils.setServletPath(servletUrlPattern);
These are missing in the servletlistener for oslc4j-cm-sample. Hence, when Lyo.core tries to create resourceURIs, it is defaulting to some other values than the ones you want to specify through these 2 parameters.
@jamsden Jad's right.
When we worked on the OSLC4JUtils.set*
methods, my preference was to crash the server so that the developer would be forced to fix this but you guys outvoted me. The problem is that the hostname should never be guessed but instead configured, especially in today's containerised world. The implementation left in the code is the one that relies on the PTR records being set correcly in the DNS. So, this would not only fail on localhost, but also behind load balancers or service meshes of some kind, behind enterprise firewalls etc.
Setting the two values as suggested by Jad should fix the problem.
In lyo.rio-oslc4j, oslc4j-cm-sample, ServletListener.contextInitializer, add the following calls to set the base URI and servlet URI pattern for use by oslc4j-core
OSLC4JUtils.setPublicURI(baseUrl);
OSLC4JUtils.setServletPath(servletUrlPattern);
Note that the host name is being calculated by InetAddress.getLocalHost().getCanonicalHostName(); This seems to be failing and returning the IP address instead of localhost when running locally. This is causing some confusion in the creation of URLs as some have localhost and some have the IP address. The issue with empty query results is a consequence of the mismatch of these otherwise equivalent URLs.
Do you mean that the adaptor still tries to figure out its canonical hostname despite you having set the URI and the path through OSLC4JUtils beforehand?
No, it's using InetAddress.getLocalHost().getCanonicalHostName();
to get the host name to use in creating the baseUri. I have't looked at this yet. Trying to get SSLContext to work in the oslc4j-client. Many hours lost on this.
In lyo.rio-oslc4j, oslc4j-cm-sample, ServletListener.contextInitializer, I added the following calls to set the base URI and servlet URI pattern for use by oslc4j-core
OSLC4JUtils.setPublicURI(baseUrl);
OSLC4JUtils.setServletPath(servletUrlPattern);
I made sure the host name is being calculated by InetAddress.getLocalHost().getCanonicalHostName();
wasn't an IP address, and set these two system properties on the oslc4j-cm-server run configuration:
-Dorg.eclipse.lyo.oslc4j.client.registryuri=http://localhost:8080/OSLC4JRegistry/catalog/singleton
-Dorg.eclipse.lyo.oslc4j.client.uiuri=http://localhost:8080/OSLC4JUI
But the ServiceProviderCatalog URI is still being calculated to use an IP address:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:oslc_data="http://open-services.net/ns/servicemanagement/1.0/"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_scm="http://open-services.net/ns/scm#"
xmlns:oslc_cm="http://open-services.net/ns/cm#"
xmlns:oslc_qm="http://open-services.net/ns/qm#"
xmlns:oslc_rm="http://open-services.net/ns/rm#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<oslc_cm:ChangeRequest>
<oslc_cm:inprogress rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>true</oslc_cm:inprogress>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2019-01-30T20:34:37.645Z</dcterms:modified>
<dcterms:title rdf:parseType="Literal">Need to update the database schema to reflect the data model changes</dcterms:title>
<oslc:serviceProvider rdf:resource="http://192.168.1.140:8080/OSLC4JRegistry/serviceProviders/2"/>
<oslc_cm:closed rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>false</oslc_cm:closed>
<oslc_cm:severity>Unclassified</oslc_cm:severity>
</oslc_cm:ChangeRequest>
</rdf:RDF>
I've perhaps exhausted my ability to fix this. Jad?
To start with, is the OslcQueryResult working as expected now? This was the original problem. The latest rdf/xml is about the catalog, which I assume is another issue. Right?
@jamsden I can help debug, but could you possible share/push the code, so I can reproduce here?
Jad, I think the problem is that some URLs have the IP address and some have the localhost name, and therefore don't match, causing the query to return no results.
I'll push code today.
Thanks for the help - I'm pretty buried in the client and spending too much time on it.
Jim Amsden, Senior Technical Staff Member OSLC and Linked Lifecycle Data 919-525-6575
From: Jad El-khoury notifications@github.com To: "eclipse/lyo.client" lyo.client@noreply.github.com Cc: Jim Amsden jamsden@us.ibm.com, Mention mention@noreply.github.com Date: 01/30/2019 05:41 PM Subject: Re: [eclipse/lyo.client] OslcQueryResult returns no members (#23)
To start with, is the OslcQueryResult working as expected now? This was the original problem. The latest rdf/xml is about the catalog, which I assume is another issue. Right? @jamsden I can help debug, but could you possible share/push the code, so I can reproduce here? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@jamsden I am trying to run the cm adaptor, and getting an exception at start up. Did you manage to get the server to run?
Jan 31, 2019 10:20:09 PM org.eclipse.lyo.oslc4j.changemanagement.servlet.ServletListener$RegistrationTask run SEVERE: Unable to register with service provider catalog java.lang.IllegalArgumentException: The values variable is missing. Verify that null is not being passed in. at org.apache.wink.common.internal.UriBuilderImpl.buildFromMap(UriBuilderImpl.java:407) at org.apache.wink.common.internal.UriBuilderImpl.buildFromMap(UriBuilderImpl.java:391) at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.resolvePathParameters(ServiceProviderFactory.java:358) at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.createQueryCapability(ServiceProviderFactory.java:222) at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.handleResourceClass(ServiceProviderFactory.java:101) at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.initServiceProvider(ServiceProviderFactory.java:82) at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.createServiceProvider(ServiceProviderFactory.java:53) at org.eclipse.lyo.oslc4j.changemanagement.servlet.ServiceProviderFactory.createServiceProvider(ServiceProviderFactory.java:48) at org.eclipse.lyo.oslc4j.changemanagement.servlet.ServletListener$RegistrationTask.run(ServletListener.java:163) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)
This is happening during the RegistrationTask scheduled task, that seems to be the one registering ServiceProviders.
Jim is using an Eclipse launch configuration supplied with the project. How are you running it?
my usual maven goal jetty:run
An update: I moved on by simply commenting out that RegistrationTask. I believe it relates to some client code, so maybe not relevant. I have some minor fixes when it comes to the publicUri, and servletUri settings. But that's details for now.
To proceed, I would need (@jamsden ) the client that you are using to produce this errors.
I am testing using a browser, and from the front page of the server at http://localhost:8086/OSLC4JChangeManagement/
So I can't really reproduce the 2 problems above. I am not sure how to deal with this oslc4j-registery stuff.
So, I now pushed a small change that I hope fixes the QueryResult problem. But it is still the case that the server returns 0 results. How can you make it produce more?
OSLC4JUtils.setPublicURI(baseUrl);
OSLC4JUtils.setServletPath(servletUrlPattern);
The baseUri should not contain the servletUrlPattern, since you were otherwise ending up with "services/services" in the rdf:about of the oslc:ResponseInfo, which is certainly NOT the orignal request URL.
The client making a query request MUST make sure it uses the same URI/L as that of baseUrl. that is, I don't think we can handle a request to http://192.168.1.140:8080/..., when the oslc:ResponseInfo is returned as "http://localhost:8080". The query libray is not that smart.
See my simple change on the rio server https://github.com/eclipse/lyo.rio/commit/7bb03c2c06bcd232e758d5970ed04bff0f782fd2
The registrationtask you have commented out generated some CM resources.
The registrationtask you have commented out generated some CM resources.
No! That only registers the ServiceProviders (to the oslc4j-registery is my guess). But it is odd, since even when I comment out this task, I still get the catalog to produce 1 SP.
Analysis:
oslc4j-registery has its own servletListener, and hence needs to set its own publichURI.
For some reason, when it does String publicURI = OSLC4JUtils.getPublicURI();
, the result is "null". This causes its to default to some "http://localhost:8080/OSLC4JRegistry/"
So, I just need to work out how to make the 2 servlets share the same result upon calling OSLC4JUtils.getPublicURI(), and we should be fine.
Alternatevly, should we remove this registery stuff?
OSLC4JUtils.get/setPublicURI() controls this static attribute, which is initilised through a system property.
private static String publicURI = System.getProperty(OSLC4JConstants.OSLC4J_PUBLIC_URI);
Would oslc4j-cm-sample and oslc4j-registery share the same class (and class attributes) OSLC4JUtils ?
Jim, this is what I get with all my fixes:
INFO [main] (GenericCMSample.java:85) - Initialising OSLC Client
INFO [main] (GenericCMSample.java:89) - Looking up Service Provider by URI=http://localhost:8080/OSLC4JRegistry/catalog/1 and title='OSLC Lyo Change Management Service Provider'
Page 1:
ERROR [main] (RDFDefaultErrorHandler.java:59) - Premature end of file.
ERROR [main] (GenericCMSample.java:144) - Unknown error
org.apache.jena.shared.JenaException: org.xml.sax.SAXParseException; Premature end of file.
at org.apache.jena.rdf.model.impl.RDFDefaultErrorHandler.fatalError(RDFDefaultErrorHandler.java:60)
at org.apache.jena.rdfxml.xmlinput.impl.ARPSaxErrorHandler.fatalError(ARPSaxErrorHandler.java:47)
at org.apache.jena.rdfxml.xmlinput.impl.XMLHandler.warning(XMLHandler.java:199)
at org.apache.jena.rdfxml.xmlinput.impl.XMLHandler.fatalError(XMLHandler.java:229)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$XMLDeclDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.jena.rdfxml.xmlinput.impl.RDFXMLParser.parse(RDFXMLParser.java:150)
at org.apache.jena.rdfxml.xmlinput.JenaReader.read(JenaReader.java:166)
at org.apache.jena.rdfxml.xmlinput.JenaReader.read(JenaReader.java:153)
at org.apache.jena.rdfxml.xmlinput.JenaReader.read(JenaReader.java:224)
at org.apache.jena.rdf.model.impl.ModelCom.read(ModelCom.java:251)
at org.eclipse.lyo.client.oslc.resources.OslcQueryResult.initializeRdf(OslcQueryResult.java:124)
at org.eclipse.lyo.client.oslc.resources.OslcQueryResult.getMembersUrls(OslcQueryResult.java:236)
at org.eclipse.lyo.client.oslc.samples.GenericCMSample.processCurrentPage(GenericCMSample.java:164)
at org.eclipse.lyo.client.oslc.samples.GenericCMSample.processPagedQueryResults(GenericCMSample.java:152)
at org.eclipse.lyo.client.oslc.samples.GenericCMSample.main(GenericCMSample.java:110)
Caused by: org.xml.sax.SAXParseException; Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
... 20 more
The response from that URI is
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<oslc:ServiceProviderCatalog rdf:about="http://localhost:8080/OSLC4JRegistry/catalog">
<dcterms:publisher>
<oslc:Publisher>
<dcterms:title rdf:parseType="Literal">Project Lyo</dcterms:title>
<dcterms:identifier>Eclipse</dcterms:identifier>
</oslc:Publisher>
</dcterms:publisher>
<dcterms:title rdf:parseType="Literal">OSLC Service Provider Catalog</dcterms:title>
<oslc:serviceProvider>
<oslc:ServiceProvider rdf:about="http://localhost:8080/OSLC4JRegistry/serviceProviders/3">
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>rdfs</oslc:prefix>
<oslc:prefixBase rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>foaf</oslc:prefix>
<oslc:prefixBase rdf:resource="http://xmlns.com/foaf/0.1/"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2019-02-01T02:06:08.133Z</dcterms:created>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>dcterms</oslc:prefix>
<oslc:prefixBase rdf:resource="http://purl.org/dc/terms/"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<dcterms:description rdf:parseType="Literal">Reference Implementation OSLC Eclipse Lyo Change Management Service Provider</dcterms:description>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/core#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_rm</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/rm#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_data</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/servicemanagement/1.0/"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>rdf</oslc:prefix>
<oslc:prefixBase rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<dcterms:title rdf:parseType="Literal">OSLC Lyo Change Management Service Provider</dcterms:title>
<dcterms:identifier>3</dcterms:identifier>
<dcterms:publisher>
<oslc:Publisher>
<dcterms:title rdf:parseType="Literal">Eclipse Lyo</dcterms:title>
<dcterms:identifier>urn:oslc:ServiceProvider</dcterms:identifier>
</oslc:Publisher>
</dcterms:publisher>
<oslc:service>
<oslc:Service>
<oslc:selectionDialog>
<oslc:Dialog>
<oslc:hintWidth>1000px</oslc:hintWidth>
<oslc:dialog rdf:resource="http://192.168.0.5:8080/OSLC4JUI/generic/genericSelection.html?queryBase=http%3A%2F%2Flocalhost%3A8080%2FOSLC4JChangeManagement%2FchangeRequests&resourceShape=http%3A%2F%2Flocalhost%3A8080%2FOSLC4JChangeManagement%2FresourceShapes%2FchangeRequest"/>
<dcterms:title rdf:parseType="Literal">Change Request List Dialog</dcterms:title>
<oslc:usage rdf:resource="http://open-services.net/ns/cm#list"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:hintHeight>600px</oslc:hintHeight>
<oslc:label>Change Request List Dialog</oslc:label>
</oslc:Dialog>
</oslc:selectionDialog>
<oslc:selectionDialog>
<oslc:Dialog>
<oslc:hintWidth>1000px</oslc:hintWidth>
<oslc:dialog rdf:resource="http://localhost:8080/OSLC4JChangeManagement/changeRequests/selector"/>
<dcterms:title rdf:parseType="Literal">Change Request Selection Dialog</dcterms:title>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:hintHeight>600px</oslc:hintHeight>
<oslc:label>Change Request Selection Dialog</oslc:label>
</oslc:Dialog>
</oslc:selectionDialog>
<oslc:queryCapability>
<oslc:QueryCapability>
<dcterms:title rdf:parseType="Literal">Change Request Query Capability</dcterms:title>
<oslc:resourceShape rdf:resource="http://localhost:8080/OSLC4JChangeManagement/resourceShapes/changeRequest"/>
<oslc:queryBase rdf:resource="http://localhost:8080/OSLC4JChangeManagement/changeRequests"/>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:label>Change Request Catalog Query</oslc:label>
</oslc:QueryCapability>
</oslc:queryCapability>
<oslc:creationFactory>
<oslc:CreationFactory>
<dcterms:title rdf:parseType="Literal">Change Request Creation Factory</dcterms:title>
<oslc:resourceShape rdf:resource="http://localhost:8080/OSLC4JChangeManagement/resourceShapes/changeRequest"/>
<oslc:creation rdf:resource="http://localhost:8080/OSLC4JChangeManagement/changeRequests"/>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:label>Change Request Creation</oslc:label>
</oslc:CreationFactory>
</oslc:creationFactory>
<oslc:creationDialog>
<oslc:Dialog>
<oslc:hintWidth>1000px</oslc:hintWidth>
<oslc:dialog rdf:resource="http://localhost:8080/OSLC4JChangeManagement/changeRequests/creator"/>
<dcterms:title rdf:parseType="Literal">Change Request Creation Dialog</dcterms:title>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:hintHeight>600px</oslc:hintHeight>
<oslc:label>Change Request Creation Dialog</oslc:label>
</oslc:Dialog>
</oslc:creationDialog>
<oslc:domain rdf:resource="http://open-services.net/ns/cm#"/>
</oslc:Service>
</oslc:service>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_qm</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/qm#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_cm</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/cm#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_scm</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/scm#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:details rdf:resource="http://localhost:8080/OSLC4JChangeManagement"/>
</oslc:ServiceProvider>
</oslc:serviceProvider>
<oslc:serviceProvider>
<oslc:ServiceProvider rdf:about="http://localhost:8080/OSLC4JRegistry/serviceProviders/2">
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_cm</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/cm#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>rdf</oslc:prefix>
<oslc:prefixBase rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:details rdf:resource="http://localhost:8080/OSLC4JChangeManagement"/>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_data</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/servicemanagement/1.0/"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/core#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<dcterms:title rdf:parseType="Literal">OSLC Lyo Change Management Service Provider</dcterms:title>
<dcterms:publisher>
<oslc:Publisher>
<dcterms:title rdf:parseType="Literal">Eclipse Lyo</dcterms:title>
<dcterms:identifier>urn:oslc:ServiceProvider</dcterms:identifier>
</oslc:Publisher>
</dcterms:publisher>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2019-02-01T02:00:54.818Z</dcterms:created>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_scm</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/scm#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_rm</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/rm#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<dcterms:identifier>2</dcterms:identifier>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>dcterms</oslc:prefix>
<oslc:prefixBase rdf:resource="http://purl.org/dc/terms/"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>rdfs</oslc:prefix>
<oslc:prefixBase rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>foaf</oslc:prefix>
<oslc:prefixBase rdf:resource="http://xmlns.com/foaf/0.1/"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:service>
<oslc:Service>
<oslc:selectionDialog>
<oslc:Dialog>
<oslc:hintWidth>1000px</oslc:hintWidth>
<oslc:dialog rdf:resource="http://192.168.0.5:8080/OSLC4JUI/generic/genericSelection.html?queryBase=http%3A%2F%2Flocalhost%3A8080%2FOSLC4JChangeManagement%2FchangeRequests&resourceShape=http%3A%2F%2Flocalhost%3A8080%2FOSLC4JChangeManagement%2FresourceShapes%2FchangeRequest"/>
<dcterms:title rdf:parseType="Literal">Change Request List Dialog</dcterms:title>
<oslc:usage rdf:resource="http://open-services.net/ns/cm#list"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:hintHeight>600px</oslc:hintHeight>
<oslc:label>Change Request List Dialog</oslc:label>
</oslc:Dialog>
</oslc:selectionDialog>
<oslc:selectionDialog>
<oslc:Dialog>
<oslc:hintWidth>1000px</oslc:hintWidth>
<oslc:dialog rdf:resource="http://localhost:8080/OSLC4JChangeManagement/changeRequests/selector"/>
<dcterms:title rdf:parseType="Literal">Change Request Selection Dialog</dcterms:title>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:hintHeight>600px</oslc:hintHeight>
<oslc:label>Change Request Selection Dialog</oslc:label>
</oslc:Dialog>
</oslc:selectionDialog>
<oslc:queryCapability>
<oslc:QueryCapability>
<dcterms:title rdf:parseType="Literal">Change Request Query Capability</dcterms:title>
<oslc:resourceShape rdf:resource="http://localhost:8080/OSLC4JChangeManagement/resourceShapes/changeRequest"/>
<oslc:queryBase rdf:resource="http://localhost:8080/OSLC4JChangeManagement/changeRequests"/>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:label>Change Request Catalog Query</oslc:label>
</oslc:QueryCapability>
</oslc:queryCapability>
<oslc:creationFactory>
<oslc:CreationFactory>
<dcterms:title rdf:parseType="Literal">Change Request Creation Factory</dcterms:title>
<oslc:resourceShape rdf:resource="http://localhost:8080/OSLC4JChangeManagement/resourceShapes/changeRequest"/>
<oslc:creation rdf:resource="http://localhost:8080/OSLC4JChangeManagement/changeRequests"/>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:label>Change Request Creation</oslc:label>
</oslc:CreationFactory>
</oslc:creationFactory>
<oslc:creationDialog>
<oslc:Dialog>
<oslc:hintWidth>1000px</oslc:hintWidth>
<oslc:dialog rdf:resource="http://localhost:8080/OSLC4JChangeManagement/changeRequests/creator"/>
<dcterms:title rdf:parseType="Literal">Change Request Creation Dialog</dcterms:title>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<oslc:hintHeight>600px</oslc:hintHeight>
<oslc:label>Change Request Creation Dialog</oslc:label>
</oslc:Dialog>
</oslc:creationDialog>
<oslc:domain rdf:resource="http://open-services.net/ns/cm#"/>
</oslc:Service>
</oslc:service>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc_qm</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/qm#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<dcterms:description rdf:parseType="Literal">Reference Implementation OSLC Eclipse Lyo Change Management Service Provider</dcterms:description>
</oslc:ServiceProvider>
</oslc:serviceProvider>
<oslc:serviceProvider>
<oslc:ServiceProvider rdf:about="http://localhost:8080/OSLC4JRegistry/serviceProviders/1">
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>dcterms</oslc:prefix>
<oslc:prefixBase rdf:resource="http://purl.org/dc/terms/"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:service>
<oslc:Service>
<oslc:selectionDialog>
<oslc:Dialog>
<oslc:hintWidth>1000px</oslc:hintWidth>
<oslc:dialog rdf:resource="http://192.168.0.5:8080/OSLC4JUI/generic/genericSelection.html?queryBase=http%3A%2F%2Flocalhost%3A8080%2FOSLC4JRegistry%2Fcatalog&resourceShape=http%3A%2F%2Flocalhost%3A8080%2FOSLC4JRegistry%2FresourceShapes%2FserviceProviderCatalog"/>
<dcterms:title rdf:parseType="Literal">Service Provider Catalog Selection Dialog</dcterms:title>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/core#ServiceProviderCatalog"/>
<oslc:hintHeight>600px</oslc:hintHeight>
<oslc:label>Service Provider Catalog Selection Dialog</oslc:label>
</oslc:Dialog>
</oslc:selectionDialog>
<oslc:queryCapability>
<oslc:QueryCapability>
<dcterms:title rdf:parseType="Literal">Service Provider Query Capability</dcterms:title>
<oslc:resourceShape rdf:resource="http://localhost:8080/OSLC4JRegistry/resourceShapes/serviceProvider"/>
<oslc:queryBase rdf:resource="http://localhost:8080/OSLC4JRegistry/serviceProviders"/>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/core#ServiceProvider"/>
<oslc:label>Service Provider Query</oslc:label>
</oslc:QueryCapability>
</oslc:queryCapability>
<oslc:queryCapability>
<oslc:QueryCapability>
<dcterms:title rdf:parseType="Literal">Service Provider Catalog Query Capability</dcterms:title>
<oslc:resourceShape rdf:resource="http://localhost:8080/OSLC4JRegistry/resourceShapes/serviceProviderCatalog"/>
<oslc:queryBase rdf:resource="http://localhost:8080/OSLC4JRegistry/catalog"/>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/core#ServiceProviderCatalog"/>
<oslc:label>Service Provider Catalog Query</oslc:label>
</oslc:QueryCapability>
</oslc:queryCapability>
<oslc:creationFactory>
<oslc:CreationFactory>
<dcterms:title rdf:parseType="Literal">Service Provider Creation Factory</dcterms:title>
<oslc:resourceShape rdf:resource="http://localhost:8080/OSLC4JRegistry/resourceShapes/serviceProvider"/>
<oslc:creation rdf:resource="http://localhost:8080/OSLC4JRegistry/serviceProviders"/>
<oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
<oslc:resourceType rdf:resource="http://open-services.net/ns/core#ServiceProvider"/>
<oslc:label>Service Provider Creation</oslc:label>
</oslc:CreationFactory>
</oslc:creationFactory>
<oslc:domain rdf:resource="http://open-services.net/ns/core#"/>
</oslc:Service>
</oslc:service>
<dcterms:description rdf:parseType="Literal">Reference Implementation OSLC Service Provider Catalog</dcterms:description>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>rdfs</oslc:prefix>
<oslc:prefixBase rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<dcterms:identifier>1</dcterms:identifier>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>rdf</oslc:prefix>
<oslc:prefixBase rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<oslc:prefixDefinition>
<oslc:PrefixDefinition>
<oslc:prefix>oslc</oslc:prefix>
<oslc:prefixBase rdf:resource="http://open-services.net/ns/core#"/>
</oslc:PrefixDefinition>
</oslc:prefixDefinition>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2019-02-01T02:00:49.504Z</dcterms:created>
<dcterms:publisher>
<oslc:Publisher>
<dcterms:title rdf:parseType="Literal">Project Lyo</dcterms:title>
<dcterms:identifier>Eclipse</dcterms:identifier>
</oslc:Publisher>
</dcterms:publisher>
<dcterms:title rdf:parseType="Literal">OSLC Service Provider Catalog</dcterms:title>
</oslc:ServiceProvider>
</oslc:serviceProvider>
<oslc:domain rdf:resource="http://open-services.net/ns/core#"/>
<oslc:domain rdf:resource="http://open-services.net/ns/cm#"/>
<dcterms:description rdf:parseType="Literal">Reference Implementation OSLC IBM Service Provider Catalog</dcterms:description>
</oslc:ServiceProviderCatalog>
</rdf:RDF>
@jamsden @jadelkhoury I forgot to ask a baseline question: does the setup work well on the JAX-RS 1.1 & Wink?
I have run oslc4j-cm-sample under both Wink and JAX-RS versions of oslc-core, and with both client implementations. I don't think its bug free, but I got it working to the point that at least it would create a service provider catalog and execute some requests - mostly what I needed to do the initial development on oslc4j-client.
Let's get some of the known issues out of the way - baseURI, servletURI, annotation inheritance, etc., then I'll hopefully have a oslc4j-client working well enough to help with the testing.
@berezovskyi are you working on this for now? I thought I can continue from where I left yesterday, especially after what you explained this afternoon. But happy to leave it for you if you insist.
I consider the issue fixes, please check and close it @jamsden .
What changes did you make to what repos on what branch? Sorry I got lost in all the issues we're covering
I have made changes to:
plus PR https://github.com/eclipse/lyo.core/pull/66 on core
On the client the change was minimal: https://github.com/eclipse/lyo.client/commit/5f71bf7a175d897707accbe29c6f687a1d732288#diff-103c53cab4ba6ad558d46e03e3e4db09
On the server, changes were made to run Registry in a standalone mode on a different container; also, files were moved around to use standard Maven layout. https://github.com/eclipse/lyo.server/commit/5e959bd97030d8d504aac39bb883295f0b99dd6a#diff-51eae2242ae1c9bb73c087d8c419ab87R29
On the RIO, a few more changes were made:
/services
path component in the generated URIs https://github.com/eclipse/lyo.rio/commit/bbce1c71c72f996dae492ff169f332827e6ea362#diff-40ec723237fc88739334468a98f500c1R109In OslcQuery.applyQueryParams and applyPagination, WebTarget.queryPath returns a new instance of WebTarget, it doesn't add the query parameter to the target WebTarget. So all OSLC queries were being executed with no query parameters.
Hmm okay, but there are some members returned, right? If that's a separate issue, let's open another issue for this?
Yes, every OSLC query returned all members. I think this can be closed now.
The JAX-RS 2.0/Jersey implementation of oslc-java-client does not return any members when running the GenericCMSample.java program. When initializeRdf() attempts to get the membersResource, its searching the refModel for a resource whose subject is the query.getCapabilityUrl(). When invoked from GenericCMSample, that URL looks like http://192.168.1.140:8080/OSLC4JChangeManagement/services/changeRequests. However, examining the content of the Jena rdfModel, the subject URIs look like http://localhost:8080/OSLC4JChangeManagement/services/changeRequests, so these aren't matching and the membersResource is null.
All the URLs in the ServiceProvider have http://192.168.1.140:8080, so that's why the queryCapability URI starts with http://192.168.1.140:8080.