Message: JAXP00010001: The parser has encountered more than "64000" entity expansions

12 views
Skip to first unread message

Roman Sova

unread,
Jun 13, 2014, 6:47:05 PM6/13/14
to sta...@clarkparsia.com
I am trying to load an ontology (owl file) into a stardog's database and getting this error:
 Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; 

After a quick research it looks like this has something to do with with bug in Java JDK and the workaround is recommended as the following steps:

The workaround is to disable FPS or entity expansion limit (be careful now your code can be vulnerable to denial of service attack, see replies on Bug ID: JDK-4843787 org.xml.sax.SAXException was thrown when parsing large file ) 

  1. set system property jdk.xml.entityExpansionLimit to 0
  2. disable FPS in XMLSecurityManager for XMLInputFactory: 

        XMLInputFactory factory = XMLInputFactory.newInstance();

        XMLSecurityManager securityManager = new XMLSecurityManager(false);

        factory.setProperty("http://apache.org/xml/properties/security-manager", securityManager);

(here is a link to the source: https://community.oracle.com/thread/2594170)

Any suggestion how I can change the startup script to make this change?

My other option is to chop the owl file to peaces to load it in, but this would not be cool :)

Hope to hear from you soon, and thanks for all you hard work.

Cheers,

Roman  

Mike Grove

unread,
Jun 16, 2014, 7:36:11 AM6/16/14
to stardog
On Fri, Jun 13, 2014 at 6:47 PM, Roman Sova <sova....@gmail.com> wrote:
I am trying to load an ontology (owl file) into a stardog's database and getting this error:
 Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; 

After a quick research it looks like this has something to do with with bug in Java JDK and the workaround is recommended as the following steps:

The workaround is to disable FPS or entity expansion limit (be careful now your code can be vulnerable to denial of service attack, see replies on Bug ID: JDK-4843787 org.xml.sax.SAXException was thrown when parsing large file ) 

  1. set system property jdk.xml.entityExpansionLimit to 0
  2. disable FPS in XMLSecurityManager for XMLInputFactory: 

        XMLInputFactory factory = XMLInputFactory.newInstance();

        XMLSecurityManager securityManager = new XMLSecurityManager(false);

        factory.setProperty("http://apache.org/xml/properties/security-manager", securityManager);

(here is a link to the source: https://community.oracle.com/thread/2594170)

Any suggestion how I can change the startup script to make this change?

You can try setting the system property for the Java XML parser (-DentityExpansionLimit=1000000) as part of the STARDOG_JAVA_ARGS environment variable.

Cheers,

Mike 

My other option is to chop the owl file to peaces to load it in, but this would not be cool :)

Hope to hear from you soon, and thanks for all you hard work.

Cheers,

Roman  

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Roman Sova

unread,
Jun 18, 2014, 3:54:11 AM6/18/14
to sta...@clarkparsia.com
Thanks Mike,
I will give it a try.
I ended up splitting the ontologies into smaller subfiles.
You help is greatly appreciated.
Roman
Reply all
Reply to author
Forward
0 new messages