Welcome to the Jazz Community Forum
CLM 6.0 and OSLC 2.0 compatibility

I have a CLM 6.0 installed on WAS 8.5.5. I am trying to connect to the Requirements Management (RRC) using OSLC version 2.0. The code is failing at the getServiceProvider function. The exception that I am getting is-
[Fatal Error] :17:78: The reference to entity "etag" must end with the ';' delimiter.
org.xml.sax.SAXParseException: The reference to entity "etag" must end with the ';' delimiter.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.tut.data.RRCConnector.parse(RRCConnector.java:1350)
at com.tut.data.RRCConnector.getServiceProvider(RRCConnector.java:261)
at com.tut.data.RRCConnector.setProjectArea(RRCConnector.java:162)
at com.tut.data.RRCConnector.<init>(RRCConnector.java:152)
at com.tut.data.CallRRC.<init>(CallRRC.java:33)
at com.tut.data.CallRRC.main(CallRRC.java:269)
The getServiceProvider method has the following code-
public String getServiceProvider(String catalogURI, String paName) throws InvalidCredentialsException, IOException, XPathExpressionException {
HttpGet query = new HttpGet(catalogURI);
query.addHeader("Accept", "application/rdf+xml");
query.addHeader("OSLC-Core-Version", "2.0");
// Access to the Service Providers catalog
HttpResponse response = HttpUtils.sendGetForSecureDocument(
server, query, login, password, httpclient, JTS_Server);
if (response.getStatusLine().getStatusCode() != 200) {
response.getEntity().consumeContent();
throw new HttpResponseException(response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase());
}
// System.out.println(" !!! Service Providers catalog");
// printEntity(response.getEntity());
// Define the XPath evaluation environment
XPath xpath = getXpathNamespace();
String serviceProviderXPath = "//oslc:ServiceProvider[dc:title=\""+paName+"\"]/@rdf:about";
// Retrieve the designated Service Provider
InputSource source = new InputSource(response.getEntity().getContent());
Document doc = parse(source);
Node paNode = (Node)(xpath.evaluate(serviceProviderXPath, doc, XPathConstants.NODE));
if (paNode == null) {
if (DEBUG)
System.out.println("!!! using alternative service provider file format");
serviceProviderXPath = "//oslc_disc:ServiceProvider[dc:title=\""+paName+"\"]/oslc_disc:services/@rdf:resource";
// Retrieve the designated Service Provider
paNode = (Node)(xpath.evaluate(serviceProviderXPath, doc, XPathConstants.NODE));
}
if (paNode == null) {
response.getEntity().consumeContent();
throw new RuntimeException("Unknown Project Area: "+paName);
}
response.getEntity().consumeContent();
return paNode.getTextContent();
}
The service provider is coming as null. Do I need to make any change in the service provider code to make it work for CLM 6.0?
[Fatal Error] :17:78: The reference to entity "etag" must end with the ';' delimiter.
org.xml.sax.SAXParseException: The reference to entity "etag" must end with the ';' delimiter.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.tut.data.RRCConnector.parse(RRCConnector.java:1350)
at com.tut.data.RRCConnector.getServiceProvider(RRCConnector.java:261)
at com.tut.data.RRCConnector.setProjectArea(RRCConnector.java:162)
at com.tut.data.RRCConnector.<init>(RRCConnector.java:152)
at com.tut.data.CallRRC.<init>(CallRRC.java:33)
at com.tut.data.CallRRC.main(CallRRC.java:269)
The getServiceProvider method has the following code-
public String getServiceProvider(String catalogURI, String paName) throws InvalidCredentialsException, IOException, XPathExpressionException {
HttpGet query = new HttpGet(catalogURI);
query.addHeader("Accept", "application/rdf+xml");
query.addHeader("OSLC-Core-Version", "2.0");
// Access to the Service Providers catalog
HttpResponse response = HttpUtils.sendGetForSecureDocument(
server, query, login, password, httpclient, JTS_Server);
if (response.getStatusLine().getStatusCode() != 200) {
response.getEntity().consumeContent();
throw new HttpResponseException(response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase());
}
// System.out.println(" !!! Service Providers catalog");
// printEntity(response.getEntity());
// Define the XPath evaluation environment
XPath xpath = getXpathNamespace();
String serviceProviderXPath = "//oslc:ServiceProvider[dc:title=\""+paName+"\"]/@rdf:about";
// Retrieve the designated Service Provider
InputSource source = new InputSource(response.getEntity().getContent());
Document doc = parse(source);
Node paNode = (Node)(xpath.evaluate(serviceProviderXPath, doc, XPathConstants.NODE));
if (paNode == null) {
if (DEBUG)
System.out.println("!!! using alternative service provider file format");
serviceProviderXPath = "//oslc_disc:ServiceProvider[dc:title=\""+paName+"\"]/oslc_disc:services/@rdf:resource";
// Retrieve the designated Service Provider
paNode = (Node)(xpath.evaluate(serviceProviderXPath, doc, XPathConstants.NODE));
}
if (paNode == null) {
response.getEntity().consumeContent();
throw new RuntimeException("Unknown Project Area: "+paName);
}
response.getEntity().consumeContent();
return paNode.getTextContent();
}
The service provider is coming as null. Do I need to make any change in the service provider code to make it work for CLM 6.0?
One answer

Are you using the Jazz Authorization Server by any chance? If yes, the log in sequence is different and your existing code will not work.
Also, RDNG 6.0 requires a new HTTP request header, and you will need to include it in your code.
https://jazz.net/forum/questions/206957/what-is-vvcconfiguration-in-header-while-fetching-dng-60-list-of-artifact-links
Also, RDNG 6.0 requires a new HTTP request header, and you will need to include it in your code.
https://jazz.net/forum/questions/206957/what-is-vvcconfiguration-in-header-while-fetching-dng-60-list-of-artifact-links
Comments

Hi,
Thanks for the response.
I understand that the new parameter is vvc.configuration. How can I obtain the same?

It's an "HTTP Request Header". So you add it with the query.addHeader() function, same as the "Accept" header. Its value depends on the configuration, so you first need to find it out via other means such as a browser session.