Parse error occurs via OSLC-CM using example source code
I would like to run the Example source code in https://jazz.net/library/article/635 to get project areas from workitems catalog.
However, Example03.java does not work due to the following parse error. The target RTC server version is 3.0 iFix1. -- javax.xml.xpath.XPathExpressionException: org.xml.sax.SAXParseException: The element type "link" must be terminated by the matching end-tag "</link>". at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:136) at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:237) at net.jazz.oslc.consumer.examples.Example03.main(Example03.java:104) Caused by: org.xml.sax.SAXParseException: The element type "link" must be terminated by the matching end-tag "</link>". at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:132) ... 2 more -- I discovered the difference between my catalog and original catalog from workshop text at the beginning. <?xml version="1.0" encoding="UTF-8"?> <oslc_disc:ServiceProviderCatalog xmlns:oslc_disc="http://open-services.net/xmlns/discovery/1.0/" xmlns:dc="http://purl.org/dc/terms/" xmlns:ns1="http://jazz.net/xmlns/prod/jazz/process/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="https://jazz-server:9443/jazz/oslc/workitems/catalog.xml"> <dc:title>Project Areas</dc:title> <oslc_disc:entry> <oslc_disc:ServiceProvider> <dc:title>Conversion</dc:title> ... <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:ns1="http://jazz.net/xmlns/prod/jazz/process/1.0/" xmlns:oslc="http://open-services.net/ns/core#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <oslc:ServiceProviderCatalog rdf:about="https://jazz.server.com:9443/ccm/oslc/workitems/catalog"> <oslc:serviceProvider> <oslc:ServiceProvider rdf:about= "https://jazz.server.com:9443/ccm/oslc/.../services.xml"> <dcterms:title rdf:parseType="Literal">JUnit Project</dcterms:title>... I changed the namespace from oslc to oslc_disc and from dcterms to dc, but it did not work. Thank you. |
2 answers
I am having the same problem with the example source code in https://jazz.net/library/article/635 to get project areas from workitems catalog. running 3.0.1 also. Exampl03.java:
I turned on debug in HttpUtils and the first get has happy headers and works: >> GET(1) https://localhost:9443/ccm/rootservices But the second get has authorization failure: >> GET(1) https://192.168.1.148:9443/ccm/oslc/workitems/catalog If I print the content, its javascript laden html that seems to be telling me that I am not authorized :) . I am happy to hack at this, and have been, but haven't made any progress yet. I need suggestons. Thanks, Dan I would like to run the Example source code in https://jazz.net/library/article/635 to get project areas from workitems catalog. |
OK. I was looking at my own posting and notices that one of the gets was to localhost and the other to the machine IP address (not sure where that translation takes place). So I changed the example to use the IP address instead of localhost and it got me past this problem! Hopefully this will help others. Thanks, Dan I am having the same problem with the example source code in https://jazz.net/library/article/635 to get project areas from workitems catalog. running 3.0.1 also. Exampl03.java: I would like to run the Example source code in https://jazz.net/library/article/635 to get project areas from workitems catalog. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.