com.ctc.wstx.exc.WstxParsingException: Undeclared general entity "nbsp"

562 views
Skip to first unread message

geoff....@object-matrix.com

unread,
Sep 12, 2016, 11:00:18 AM9/12/16
to Spectra Logic S3 SDKs and APIs
Hello all.

I've just started on our Black Pearl integration, using the 3.2.3 Java SDK and the Black Pearl simulator 3.0.1. My first little test program looks like this (give or take some extra newlines):


    public static void main(String[] args) throws IOException


    {


        String endpoint = "10.0.20.110";    // simulator


        Credentials creds = new Credentials("spectra", "spectra");


        try


        {


            Ds3Client ds3 = Ds3ClientBuilder.create(endpoint, creds)


                    .withCertificateVerification(false) // need for simulator, which has a weak certificate


                    .build();


   


            SystemInformation sysinfo = ds3.getSystemInformationSpectraS3(new GetSystemInformationSpectraS3Request()).getSystemInformationResult();


        }


        catch(UnknownHostException e)


        {


            System.err.println("Bad endpoint "+endpoint);


        }


    }



 Running it gives me this:
Enter code here...

15:33:19.887 [main] INFO  c.s.ds3client.Ds3ClientBuilder - Making connection details for endpoint [10.0.20.110] using this authorization id [spectra]


15:33:25.386 [main] INFO  c.s.d.networking.NetworkClientImpl - Sending request: GET https://10.0.20.110:443 /_rest_/capacity_summary


15:33:25.454 [main] DEBUG c.s.ds3client.utils.Signature - String to sign: GET\n\napplication/xml; charset=ISO-8859-1\nMon, 12 Sep 2016 14:33:25 +0000\n/_rest_/capacity_summary


15:33:26.075 [main] INFO  c.s.d.networking.NetworkClientImpl - Server responded with 200 for request #Unknown


15:33:26.141 [main] DEBUG c.s.d.c.interfaces.AbstractResponse - Did not find a content checksum header


Exception in thread "main" java.io.IOException: com.ctc.wstx.exc.WstxParsingException: Undeclared general entity "nbsp"


 at [row,col {unknown-source}]: [71,75]


        at com.fasterxml.jackson.dataformat.xml.util.StaxUtil.throwXmlAsIOException(StaxUtil.java:24)


        at com.fasterxml.jackson.dataformat.xml.deser.XmlTokenStream.next(XmlTokenStream.java:164)


        at com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser.nextToken(FromXmlParser.java:477)


        at com.fasterxml.jackson.core.base.ParserMinimalBase.skipChildren(ParserMinimalBase.java:147)


        at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1088)


        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1389)


        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1367)


        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:266)


        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)


        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3788)


        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2849)


        at com.spectralogic.ds3client.serializer.XmlOutput.fromXml(XmlOutput.java:116)


        at com.spectralogic.ds3client.commands.spectrads3.GetSystemCapacitySummarySpectraS3Response.processResponse(GetSystemCapacitySummarySpectraS3Response.java:42)


        at com.spectralogic.ds3client.commands.interfaces.AbstractResponse.<init>(AbstractResponse.java:58)


        at com.spectralogic.ds3client.commands.spectrads3.GetSystemCapacitySummarySpectraS3Response.<init>(GetSystemCapacitySummarySpectraS3Response.java:31)


        at com.spectralogic.ds3client.Ds3ClientImpl.getSystemCapacitySummarySpectraS3(Ds3ClientImpl.java:210)


        at com.om.move2.plugin.bp.TestBlackPearl.main(TestBlackPearl.java:36)


Looks like the request succeeded but there's something wrong with the XML parsing of the response in my client - any ideas? I'm using the Woodstox libraries that are parcelled up with ds3-sdk-3.2.3.jar in the repository. I tried some other requests like GetSystemCapacity with the same results.



Geoff.

jeffbr

unread,
Sep 12, 2016, 5:40:13 PM9/12/16
to Spectra Logic S3 SDKs and APIs
Hi Geoff,

Hopefully this code sample will help you out:

https://gist.github.com/jeffbr/76d370b153017f2cbf3119a87316a656

A couple of things to note:

  • The BlackPearl simulator uses port 8080. A real BlackPearl typically uses port 80 or 443
  • The credentials you provide are the user's S3 Access ID and Secret Key. You do not use the actual user information (spectra/spectra). Each BlackPearl has different credentials for a given user. You can get the user's S3 credentials in the BlackPearl web management interface by going to Configuration > Users. Click on a user account and then go to Action > Show S3 Credentials.

Let us know if you need any other assistance.


Thanks, Jeff

Reply all
Reply to author
Forward
0 new messages