question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid XML character error

See original GitHub issue

Hi team!

We are observing the following error while performing a request to AdGroupAdService via the SDK:

An invalid XML character (Unicode: 0xb) was found in the element content of the document.

Looks like the service is returning the symbol 0xb that causes XML deserializer to fail. Here’s the SDK-related part of the stack trace. Is there a way to handle this on our side without making changes to the data?

Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 4743; An invalid XML character (Unicode: 0xb) was found in the element content of the document.
	at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
	at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:2443)
	at org.apache.axis.client.Call.invoke(Call.java:2366)
	at org.apache.axis.client.Call.invoke(Call.java:1812)
	at com.google.api.ads.adwords.axis.v201809.cm.AdGroupAdServiceSoapBindingStub.get(AdGroupAdServiceSoapBindingStub.java:1793)
	at sun.reflect.GeneratedMethodAccessor651.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.google.api.ads.common.lib.soap.SoapClientHandler.invoke(SoapClientHandler.java:100)
	at com.google.api.ads.common.lib.soap.axis.AxisHandler.invokeSoapCall(AxisHandler.java:234)
	at com.google.api.ads.common.lib.soap.SoapServiceClient.callSoapClient(SoapServiceClient.java:63)
	at com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:93)
	at com.sun.proxy.$Proxy70.get(Unknown Source)
	... 15 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 4743; An invalid XML character (Unicode: 0xb) was found in the element content of the document.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2923)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
	... 39 more

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nwbirniecommented, Jun 3, 2021

No problem, thanks for reporting. I’ll close for now, but please feel free to loop back if there’s further issues.

0reactions
borisenko-icommented, Jun 3, 2021

Thank you @nwbirnie, I’ll communicate this to our customer who owns the data.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging an invalid XML character error - Adeptia Help
Situation: When processing files, you may encounter the following error: · Cause: Within the source file, there's an invalid XML character.
Read more >
K45581495: Error Message: An invalid XML character (Unicode
K45581495: Error Message: An invalid XML character (Unicode: <#>) was found in the element content of the document · Description · Environment.
Read more >
Invalid XML character Error - How to find the invalid ... - Ask TOM
Hello, Oracle newbie here. I am getting this error "Character reference "&#56256" is an invalid XML character" for XML data that is printed ......
Read more >
XML parser: Invalid character was found in text content
An error may be thrown when you parse XML that contains special characters by using the Microsoft XML parser.
Read more >
ERROR: "An invalid XML character (Unicode: 0x1a ... - Search
This issue occurs due to the presence of control character in the source xml file used for import. Refer the following string in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found