It's all about the answers!

Ask a question

Exception : The reference to entity "etag" must end with the ';' delimiter.


Chandan M B (1132963) | asked Sep 15 '15, 4:48 a.m.
My code looks like below

Please provide me solution

HttpGet query = new HttpGet(catalogURI);
        query.addHeader("Accept", "application/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());
        }
        // Define the XPath evaluation environment
        XPath xpath = getXpathNamespace();
        String serviceProviderXPath = "//oslc:ServiceProvider[dcterms:title=\""
                + paName + "\"]/@rdf:about";
        

        // Retrieve the designated Service Provider
        InputSource source = new InputSource(response.getEntity().getContent());
        Node paNode = (Node) (xpath.evaluate(serviceProviderXPath, source,XPathConstants.NODE));

OSLC Output in Rest (FireFox)
<oslc:serviceProvider>
<oslc:ServiceProvider rdf:about="https://korvm066.apac.bosch.com:9443/rm/oslc_rm/_o_4IMkGiEeWZVf7TKpPoBQ/services.xml">
<dcterms:title rdf:parseType="Literal">IBM DEMO</dcterms:title>
<jp:consumerRegistry rdf:resource="https://korvm066.apac.bosch.com:9443/rm/process/project-areas/_o_4IMkGiEeWZVf7TKpPoBQ/links"/>
<oslc:details rdf:resource="https://korvm066.apac.bosch.com:9443/rm/process/project-areas/_o_4IMkGiEeWZVf7TKpPoBQ"/>
</oslc:ServiceProvider>
</oslc:serviceProvider>

Exception:
Fatal Error] :17:78: The reference to entity "etag" must end with the ';' delimiter.
org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 78; 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.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(Unknown Source)
    at com.bosch.dngintegration.cscrm.QueryingRequirements.getServiceProvider(QueryingRequirements.java:180)
    at com.bosch.dngintegration.cscrm.QueryingRequirements.run(QueryingRequirements.java:90)
    at com.bosch.dngintegration.cscrm.QueryingRequirements.main(QueryingRequirements.java:81)
--------------- linked to ------------------
javax.xml.xpath.XPathExpressionException: org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 78; The reference to entity "etag" must end with the ';' delimiter.
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(Unknown Source)
    at com.bosch.dngintegration.cscrm.QueryingRequirements.getServiceProvider(QueryingRequirements.java:180)
    at com.bosch.dngintegration.cscrm.QueryingRequirements.run(QueryingRequirements.java:90)
    at com.bosch.dngintegration.cscrm.QueryingRequirements.main(QueryingRequirements.java:81)
Caused by: org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 78; 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)
    ... 4 more

One answer



permanent link
Donald Nong (14.5k314) | answered Sep 15 '15, 11:42 p.m.
You should have the source code and debug to find out the cause.
com.bosch.dngintegration.cscrm.QueryingRequirements.getServiceProvider(QueryingRequirements.java:180)


Comments
Chandan M B commented Sep 16 '15, 12:16 a.m.

Hello Donald,

I have provide you the source code as well in my question. tell me what is the meaning of that exception.


Donald Nong commented Sep 16 '15, 1:08 a.m.

What is line 180 in your code?

Your answer


Register or to post your answer.