It's all about the answers!

Ask a question

Parse error occurs via OSLC-CM using example source code


Nozomu Matsushita (1756) | asked Aug 23 '11, 3:40 a.m.
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



permanent link
Dan Rasmussen (11) | answered Aug 24 '11, 6:51 p.m.
Solved

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 turned on debug in HttpUtils and the first get has happy headers and works:

>> GET(1) https://localhost:9443/ccm/rootservices

>> Response Headers:
- Server: Apache-Coyote/1.1
- Cache-Control: public
- Expires: Wed, 24 Aug 2011 22:11:56 GMT
- ETag: "ouOvgyP9jgFS7d4aHb0iCfoEpBk="
- Date: Wed, 24 Aug 2011 22:06:56 GMT
- Content-Type: application/rdf+xml;charset=UTF-8
- Transfer-Encoding: chunked


But the second get has authorization failure:

>> GET(1) https://192.168.1.148:9443/ccm/oslc/workitems/catalog

>> Response Headers:
- Server: Apache-Coyote/1.1
- Cache-Control: private
- Expires: Wed, 31 Dec 1969 19:00:00 EST
- Set-Cookie: JazzFormAuth=Form; Path=/ccm
- X-com-ibm-team-repository-web-auth-msg: authrequired
- Content-Type: text/html;charset=UTF-8
- Content-Length: 2605
- Date: Wed, 24 Aug 2011 22:07:36 GMT


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.
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>
<oslc_disc>
<dc>Project Areas</dc>
<oslc_disc>
<oslc_disc>
<dc>Conversion</dc>
...


<xml>
<rdf>
<oslc>
<oslc>
<oslc>
<dcterms>JUnit Project</dcterms>...

I changed the namespace from oslc to oslc_disc and from dcterms to dc, but it did not work.

Thank you.

permanent link
Dan Rasmussen (11) | answered Aug 24 '11, 6:20 p.m.
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

>> Response Headers:
- Server: Apache-Coyote/1.1
- Cache-Control: public
- Expires: Wed, 24 Aug 2011 22:11:56 GMT
- ETag: "ouOvgyP9jgFS7d4aHb0iCfoEpBk="
- Date: Wed, 24 Aug 2011 22:06:56 GMT
- Content-Type: application/rdf+xml;charset=UTF-8
- Transfer-Encoding: chunked


But the second get has authorization failure:

>> GET(1) https://192.168.1.148:9443/ccm/oslc/workitems/catalog

>> Response Headers:
- Server: Apache-Coyote/1.1
- Cache-Control: private
- Expires: Wed, 31 Dec 1969 19:00:00 EST
- Set-Cookie: JazzFormAuth=Form; Path=/ccm
- X-com-ibm-team-repository-web-auth-msg: authrequired
- Content-Type: text/html;charset=UTF-8
- Content-Length: 2605
- Date: Wed, 24 Aug 2011 22:07:36 GMT


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.
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>
<oslc_disc>
<dc>Project Areas</dc>
<oslc_disc>
<oslc_disc>
<dc>Conversion</dc>
...


<xml>
<rdf>
<oslc>
<oslc>
<oslc>
<dcterms>JUnit Project</dcterms>...

I changed the namespace from oslc to oslc_disc and from dcterms to dc, but it did not work.

Thank you.

Your answer


Register or to post your answer.