Discussion:
Help! Fatal Exception when 'wb.write(fileOut)' is called
ranzhang35
2018-09-26 21:14:57 UTC
Permalink
I have the following jar files in my class path:
poi-4.0.0.jar
activation-1.1.1.jar
commons-codec-1.11.jar'
commons-collections4-4.2.jar
commons-compress-1.18.jar
commons-compress-1.18-javadoc.jar
commons-logging-1.2.jar
commons-math3-3.6.1.jar
log4j-1.2.17.jar
curvesapi-1.05.jar
junit-4.12.jar
log4j-1.2.17.ja
ooxml-schemas-1.4.jar
poi-excelant-4.0.0.jar
poi-ooxml-4.0.0.jar
poi-scratchpad-4.0.0.jar
xmlbeans-3.0.1.jar


I get the following Exception when 'wb.write(fileOut)' is called:

2018-09-26 14:01:22.582 8569-8569/com.example.mkproduct.myapplication2
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.mkproduct.myapplication2, PID: 8569
java.lang.ExceptionInInitializerError
at
org.apache.poi.ooxml.util.DocumentHelper.createDocument(DocumentHelper.java)
at
org.apache.poi.openxml4j.opc.internal.ContentTypeManager.save(ContentTypeManager.java:428)
at
org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:518)
at
org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1493)
at
org.apache.poi.ooxml.POIXMLDocument.write(POIXMLDocument.java:242)
at
com.example.mkproduct.myapplication2.MainActivity.onCreate(MainActivity.java:101)
at android.app.Activity.performCreate(Activity.java:6679)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalArgumentException:
http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit
at
org.apache.harmony.xml.parsers.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:86)
at
org.apache.poi.ooxml.util.DocumentHelper.trySetXercesSecurityManager(DocumentHelper.java:143)
at
org.apache.poi.ooxml.util.DocumentHelper.<clinit>(DocumentHelper.java:108)
at
org.apache.poi.ooxml.util.DocumentHelper.createDocument(DocumentHelper.java) 
at
org.apache.poi.openxml4j.opc.internal.ContentTypeManager.save(ContentTypeManager.java:428) 
at
org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:518) 
at
org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1493) 
at
org.apache.poi.ooxml.POIXMLDocument.write(POIXMLDocument.java:242) 
at
com.example.mkproduct.myapplication2.MainActivity.onCreate(MainActivity.java:101) 
at android.app.Activity.performCreate(Activity.java:6679) 
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) 
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618) 
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 






--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
pj.fanning
2018-09-26 21:40:15 UTC
Permalink
https://stackoverflow.com/questions/52218278/after-update-apache-poi-4-0-property-http-www-oracle-com-xml-jaxp-propertie



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
ranzhang35
2018-09-26 21:55:43 UTC
Permalink
pj.fanning:

are you suggesting to add 'xercesImpl-2.12.0.jar' ?



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
pj.fanning
2018-09-26 22:00:14 UTC
Permalink
yes, please add xerces-2.12 dependency



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
ranzhang35
2018-09-26 22:04:45 UTC
Permalink
pj.fanning:

I added 'xercesImpl-2.12.0.jar', still crashes. can i send you the
project ? it is really simple project. what's your email?



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org

Loading...