Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parser has reached the entity expansion limit "64,000"

Status
Not open for further replies.

codezombie

Programmer
Jan 23, 2004
6
US
When I run an XML file with a lot of &'s in it (more than 64,000), i get this error:

Parser has reached the entity expansion limit "64,000" set by the Application.

I've read up on this and it seems that everyone's solution is to just set it higher.

The problem is that I need to set it to unlimited since all of the XML that I process is "friendly" XML, and it is possible for it to have a lot of &'s in it. Does anyone know how to set this to unlimited?
 
I assume you're using a DOM?

You may have to switch to a SAX parser, which doesn't (or shouldn't!) keep a count of the number of entities.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Are you sure it's complaining about & amp;s, and not & errors? (I.e., ampersand characters that should have been converted to the general entity but were not.)

That error message could be a symptom that your data is unintentionally defining hordes of entities (or an extremely long entity-looking string) causing an overflow of the parser's symbol table for user-defined general entities.

It makes no more sense for a parser to complain about the number of occurrences of a general entity than to complain about too many occurrences of any single character.
 
Yes. It is definitly &'s that it is complaining about. I know this because I have 108,000 in the document I'm parsing and if I set the -DentityExpansionLimit=128000 on my java command line it works just fine, or if I do a find and replace on & with, say, "and" it works okay.

The problem is that what do I do with I get an XML document with 130,000 &'s in it.
 
Was there ever any solution to this problem?
I'm seeing the same error using a ColdFusion-built web service component...

Code:
AxisFault faultCode: {[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/}Server.userException[/URL] faultSubcode: faultString: org.xml.sax.SAXParseException: Parser has reached the entity expansion limit "64,000" set by the Application. faultActor: faultNode: faultDetail: {[URL unfurl="true"]http://xml.apache.org/axis/}stackTrace:[/URL] org.xml.sax.SAXParseException: Parser has reached the entity expansion limit "64,000" set by the Application. at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3339) at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3333) at org.apache.crimson.parser.Parser2.expandEntityInContent(Parser2.java:2667) at org.apache.crimson.parser.Parser2.maybeReferenceInContent(Parser2.java:2569) at org.apache.crimson.parser.Parser2.content(Parser2.java:1980) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654) at org.apache.crimson.parser.Parser2.content(Parser2.java:1926) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654) at org.apache.crimson.parse...


-Carl
 
Unfortunately no. We just set it up to be large, and hoped it was never a problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top