You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2018/01/11 23:43:44 UTC
[Bug 61991] New: Simple instantiation of XWPFDocument causes
reflection warning and method not found exception
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
Bug ID: 61991
Summary: Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Product: POI
Version: 3.17-FINAL
Hardware: PC
Status: NEW
Severity: blocker
Priority: P2
Component: XWPF
Assignee: dev@poi.apache.org
Reporter: wcgrnway@cox.net
Target Milestone: ---
This simple code:
FileInputStream fis = new FileInputStream(filename);
document = new XWPFDocument(fis);
Using Tiki the mime of the file being attempted:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
Generates:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by
org.apache.poi.openxml4j.util.ZipSecureFile$1
(file:/C:/javadev/workspace/poi-3.17/poi-ooxml-3.17.jar) to field
java.io.FilterInputStream.in
WARNING: Please consider reporting this to the maintainers of
org.apache.poi.openxml4j.util.ZipSecureFile$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal
reflective access operations
WARNING: All illegal access operations will be denied in a future release
--> the blocker
java.lang.NoSuchMethodException:
org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTPictureBaseImpl.<init>(org.apache.xmlbeans.SchemaType,
boolean)
Jar files in use:
POI Core came from
file:/C:/javadev/workspace/poi-3.17/poi-3.17.jar!/org/apache/poi/poifs/filesystem/POIFSFileSystem.class
POI OOXML came from
file:/C:/javadev/workspace/poi-3.17/poi-ooxml-3.17.jar!/org/apache/poi/POIXMLDocument.class
POI Scratchpad came from
file:/C:/javadev/workspace/poi-3.17/poi-scratchpad-3.17.jar!/org/apache/poi/hslf/usermodel/HSLFSlideShow.class
I have tried work arounds nothing so far successful. I've tried switching
between JVMs 1.7,1.8,1.9. Looking for jar dependencies and tried different
files.
I am building / running in Eclipse version: Oxygen.2 Release (4.7.2) Build id:
20171218-0600
Libraries on build path:
dom4j-2.1.0.jar
poi-3.17.jar
poi-ooxml-3.17.jar
poi-ooxml-schemas-3.17.jar
poi-scratchpad-3.17.jar
stax-api-1.0.1.jar
tika-eval-1.17.jar
xmlbeans-2.6.0.jar
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
--- Comment #6 from Tim Allison <ta...@mitre.org> ---
Added triggering file from TIKA-2549 to include CTPictureBaseImpl in our
smaller ooxml jar.
r1822033
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
--- Comment #4 from Nick Burch <ap...@gagravarr.org> ---
(In reply to Will Greenway from comment #3)
> If the full version is necessary just to instantiate XWPFDocument, shouldn't
> it be a little easier to find (or included with the download)?
Almost all files should be processable by the standard "minimum" smaller
poi-ooxml-schemas jar. However, there's always the odd one that uses something
else...
Please see this FAQ for more details on the why, the how, and how to get the
smaller schemas jar updated to handle your odd file:
http://poi.apache.org/faq.html#faq-N10025
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
Will Greenway <wc...@cox.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #1 from Will Greenway <wc...@cox.net> ---
Many of the examples for OOXML (XWPFDocument) refer to version 3.9. I gathered
all the 3.9 jars, recompiled. Code works.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
--- Comment #3 from Will Greenway <wc...@cox.net> ---
I was able to get 3.17 to work by adding this to the VM Arguments page of the
project:
-Xmx1524m --add-modules=java.xml.bind
--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED -Duser.language=en
-Duser.country=US -Djava9addmods=--add-modules=java.xml.bind
-Djavadoc9addmods=--add-modules=java.xml.bind
-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true
-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED
-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED
-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED
-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED
-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED
-Djava.locale.providers=JRE,CLDR -Dcoverage.enabled=true
I also added the ooxml-schemas-1.3.jar to the classpath.
If the full version is necessary just to instantiate XWPFDocument, shouldn't it
be a little easier to find (or included with the download)?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
PJ Fanning <fa...@yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|NEW |RESOLVED
--- Comment #5 from PJ Fanning <fa...@yahoo.com> ---
*** This bug has been marked as a duplicate of bug 61572 ***
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
--- Comment #7 from Will Greenway <wc...@cox.net> ---
Wanted to add that the file I was reading that caused the issue was docx output
from GoogleDocs, which I'd take to be fairly common.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
Will Greenway <wc...@cox.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wcgrnway@cox.net
OS| |Windows 10
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: [Bug 61991] Simple instantiation of XWPFDocument causes
reflection warning and method not found exception
Posted by frankv <fr...@gmail.com>.
I'm seeing something similar with v3.17, although it looks like the text is
correctly read:
java.lang.NoSuchMethodException:
org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTPictureBaseImpl.<init>(org.apache.xmlbeans.SchemaType,
boolean)
at java.lang.Class.getConstructor0(Class.java:2706)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.getJavaImplConstructor2(SchemaTypeImpl.java:1817)
at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedSubclass(SchemaTypeImpl.java:1961)
at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1950)
at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createElementType(SchemaTypeImpl.java:1051)
at
org.apache.xmlbeans.impl.values.XmlObjectBase.create_element_user(XmlObjectBase.java:938)
at org.apache.xmlbeans.impl.store.Xobj.getUser(Xobj.java:1675)
at org.apache.xmlbeans.impl.store.Cur.getUser(Cur.java:2659)
at org.apache.xmlbeans.impl.store.Cur.getObject(Cur.java:2652)
at org.apache.xmlbeans.impl.store.Cursor._getObject(Cursor.java:995)
at org.apache.xmlbeans.impl.store.Cursor.getObject(Cursor.java:2904)
at
org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:162)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:169)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:119)
at documents.WordDoc.<init>(WordDoc.java:118)
--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
--- Comment #8 from Tim Allison <ta...@mitre.org> ---
Interesting. Note that the content was still extracted without exception, but
the exception was logged. Now we're good -- Java 9 aside. :) Thank you!
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 61991] Simple instantiation of XWPFDocument causes reflection
warning and method not found exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61991
--- Comment #2 from Andreas Beeker <ki...@apache.org> ---
For the Java 9 warning check [1] and add the addOpens & Co. to your java
command.
Don't use POI 3.9.
This basic example should work - for other cases try the full schema instead of
poi-ooxml-schema.
[1] http://poi.apache.org/faq.html#faq-N102B0
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org