Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK. #87

Open
sjlacroix opened this issue Jul 7, 2014 · 2 comments

Comments

@sjlacroix
Copy link

I keep getting this issue and seems to be related to the Amazon sdk version used:

Related Issues: ​aws/aws-sdk-java#123
, yegor256/s3auth#136

We are using this Java version:

java version "1.7.0_51"
OpenJDK Runtime Environment (amzn-2.4.4.1.36.amzn1-x86_64 u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

Exception

014-07-06 20:19:55,841 [Thread-8] ERROR o.s.n.j.c.a.AmazonAwsSQSConnector.handleAWSException - Unable to retrieve message from queue https://sqs.us-east-1.amazonaws.com/******/: Unable to unmarshall response (ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.)
com.amazonaws.AmazonClientException: Unable to unmarshall response (ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.)
at com.amazonaws.http.AmazonHttpClient.handleResponse(AmazonHttpClient.java:708) ~[aws-java-sdk-1.6.12.jar:na]
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:392) ~[aws-java-sdk-1.6.12.jar:na]
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:228) ~[aws-java-sdk-1.6.12.jar:na]
at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:1001) ~[aws-java-sdk-1.6.12.jar:na]
at com.amazonaws.services.sqs.AmazonSQSClient.receiveMessage(AmazonSQSClient.java:706) ~[aws-java-sdk-1.6.12.jar:na]
at org.skyscreamer.nevado.jms.connector.amazonaws.AmazonAwsSQSQueue.receiveMessage(AmazonAwsSQSQueue.java:102) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.connector.amazonaws.AmazonAwsSQSQueue.receiveMessage(AmazonAwsSQSQueue.java:19) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.connector.AbstractSQSConnector.receiveSQSMessage(AbstractSQSConnector.java:178) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.connector.AbstractSQSConnector.receiveMessage(AbstractSQSConnector.java:109) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.NevadoSession.getUnfilteredMessage(NevadoSession.java:471) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.NevadoSession.receiveMessage(NevadoSession.java:434) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.NevadoMessageConsumer.processAsyncMessage(NevadoMessageConsumer.java:133) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.AsyncConsumerRunner.processMessage(AsyncConsumerRunner.java:77) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.AsyncConsumerRunner.run(AsyncConsumerRunner.java:38) [nevado-jms-1.3.1.jar:1.3.1]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:219) ~[na:1.7.0_51]
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.(XMLStreamReaderImpl.java:189) ~[na:1.7.0_51]
at com.sun.xml.internal.stream.XMLInputFactoryImpl.getXMLStreamReaderImpl(XMLInputFactoryImpl.java:277) ~[na:1.7.0_51]
at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:129) ~[na:1.7.0_51]
at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLEventReader(XMLInputFactoryImpl.java:78) ~[na:1.7.0_51]
at com.amazonaws.http.StaxResponseHandler.handle(StaxResponseHandler.java:89) ~[aws-java-sdk-1.6.12.jar:na]
at com.amazonaws.http.StaxResponseHandler.handle(StaxResponseHandler.java:42) ~[aws-java-sdk-1.6.12.jar:na]
at com.amazonaws.http.AmazonHttpClient.handleResponse(AmazonHttpClient.java:684) ~[aws-java-sdk-1.6.12.jar:na]
... 14 common frames omitted
2014-07-06 20:19:55,842 [Thread-8] ERROR o.s.n.j.AsyncConsumerRunner.processMessage - Unable to process message for consumer on PROD-Events
javax.jms.JMSException: Unable to retrieve message from queue https://sqs.us-east-1.amazonaws.com/212921568335/PROD-Events: Unable to unmarshall response (ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.)
at org.skyscreamer.nevado.jms.connector.amazonaws.AmazonAwsSQSConnector.handleAWSException(AmazonAwsSQSConnector.java:268) ~[nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.connector.amazonaws.AmazonAwsSQSQueue.receiveMessage(AmazonAwsSQSQueue.java:106) ~[nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.connector.amazonaws.AmazonAwsSQSQueue.receiveMessage(AmazonAwsSQSQueue.java:19) ~[nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.connector.AbstractSQSConnector.receiveSQSMessage(AbstractSQSConnector.java:178) ~[nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.connector.AbstractSQSConnector.receiveMessage(AbstractSQSConnector.java:109) ~[nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.NevadoSession.getUnfilteredMessage(NevadoSession.java:471) ~[nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.NevadoSession.receiveMessage(NevadoSession.java:434) ~[nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.NevadoMessageConsumer.processAsyncMessage(NevadoMessageConsumer.java:133) ~[nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.AsyncConsumerRunner.processMessage(AsyncConsumerRunner.java:77) [nevado-jms-1.3.1.jar:1.3.1]
at org.skyscreamer.nevado.jms.AsyncConsumerRunner.run(AsyncConsumerRunner.java:38) [nevado-jms-1.3.1.jar:1.3.1]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
2014-07-06 20:19:55,842 [Thread-8] INFO o.s.j.l.SimpleMessageListenerContainer.onException - Trying to recover from JMS Connection exception: javax.jms.JMSException: Unable to retrieve message from queue https://sqs.us-east-1.amazonaws.com/*******/
: Unable to unmarshall response (ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.)

@sjlacroix
Copy link
Author

This seemed to solve the problem, set the following custom JVM property. But is it just a temporary work around?
jdk.xml.entityExpansionLimit = 0

@frontierpsycho
Copy link

According to the discussion on that other issue you posted, it is not a temporary workaround, but it does open your server up for DoS attacks, if the XML you parse comes from unreliable sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants