Hi Andi,
> We could try to provide a new XmlBeans version and/or POI schemas with custom
> packages, to get rid of the name clash.
It would be a great help and timesaver if you can provide me with such a
version. At the moment we are just reading and writing data to existing excel
files, and create a simple data containing file with both, xls and xlsx. In
addition there will be a docx word replacement in the near future.
I would let you know if those tasks are still working.
I was just trying to use the repackage parameter you mentioned in the ant
script: <property name="repackage_arg" value="-repackage
org.apache.xmlbeans:mybeans"/> but this was the result:
typeimpl.classes:
[javac] Compiling 381 source files to
L:\Apache-Poi\xmlbeans\build\classes\typeimpl
[javac] warning: [options] bootstrap class path not set in conjunction with
-source 1.6
[javac]
L:\Apache-Poi\xmlbeans\build\src\xsdschema\org\apache\xmlbeans\impl\xb\xsdschema\AppinfoDocument.java:17:
error: duplicate class: mybeans.impl.xb.xsdschema.AppinfoDocument
[javac] public interface AppinfoDocument extends mybeans.XmlObject
[javac] ^
[javac]
L:\Apache-Poi\xmlbeans\src\typeimpl\org\apache\xmlbeans\impl\schema\SchemaAnnotationImpl.java:28:
error: cannot access AppinfoDocument
[javac] import org.apache.xmlbeans.impl.xb.xsdschema.AppinfoDocument;
[javac] ^
[javac] bad source file:
L:\Apache-Poi\xmlbeans\build\src\xsdschema\org\apache\xmlbeans\impl\xb\xsdschema\AppinfoDocument.java
[javac] file does not contain class
org.apache.xmlbeans.impl.xb.xsdschema.AppinfoDocument
[javac] Please remove or make sure it appears in the correct
subdirectory of the sourcepath.
BUILD FAILED
L:\Apache-Poi\xmlbeans\build.xml:622: Compile failed; see the compiler error
output for details.
I used the zipped source distribution as I wasn't able to connect to the SVN
from my working desktop. I will try it on the weekend from my private computer.
But please don't waste your time in explaining it to me when it is easier for
you to build it by yourself and not necessary for me to understand. I am not
even familiar with the schema topic yet.
> Don't delete the schema files - the other subdirectories like
> "attribute","element" ... are also duplicated and needed.
Jlink/jigsaw don't mind empty same named packages. As far as I know the only
package which is causing the problem is schemaorg_apache_xmlbeans\src
> I assumed merging/shading various schemas would work, but you've tested it
> and it didn't work.
Don't get me wrong here. I just merged the two jar files via WinRar. As the log
file wasn't attached last time, here it is as text:
XML-BEANS compiled schema: Could not locate compiled schema resource
schemaorg_apache_xmlbeans/system/sD023D6490046BA0250A839A9AD24C443/index.xsb
(schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443.index) -
code 0
org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Could
not locate compiled schema resource
schemaorg_apache_xmlbeans/system/sD023D6490046BA0250A839A9AD24C443/index.xsb
(schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443.index) -
code 0
at
ooxml.schemas/org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.<init>(SchemaTypeSystemImpl.java:1519)
at
ooxml.schemas/org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:273)
at
ooxml.schemas/org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(SchemaTypeSystemImpl.java:185)
at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at
ooxml.schemas/schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443.TypeSystemHolder.loadTypeSystem(Unknown
Source)
at
ooxml.schemas/schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443.TypeSystemHolder.<clinit>(Unknown
Source)
at
java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
at
java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1042)
at
java.base/jdk.internal.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at
java.base/jdk.internal.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:186)
at
java.base/java.lang.reflect.Field.acquireFieldAccessor(Field.java:1105)
at
java.base/java.lang.reflect.Field.getFieldAccessor(Field.java:1086)
at java.base/java.lang.reflect.Field.get(Field.java:418)
at
ooxml.schemas/org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:771)
at
ooxml.schemas/org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument.<clinit>(Unknown
Source)
at
ooxml.schemas/org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument$Factory.parse(Unknown
Source)
at
poi.ooxml/org.apache.poi.xssf.model.ThemesTable.<init>(ThemesTable.java:86)
at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at
poi.ooxml/org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:56)
at
poi.ooxml/org.apache.poi.ooxml.POIXMLFactory.createDocumentPart(POIXMLFactory.java:63)
at
poi.ooxml/org.apache.poi.ooxml.POIXMLDocumentPart.read(POIXMLDocumentPart.java:657)
at
poi.ooxml/org.apache.poi.ooxml.POIXMLDocument.load(POIXMLDocument.java:180)
at
poi.ooxml/org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:286)
at
poi.ooxml/org.apache.poi.xssf.usermodel.XSSFWorkbookFactory.createWorkbook(XSSFWorkbookFactory.java:88)
at
poi.ooxml/org.apache.poi.xssf.usermodel.XSSFWorkbookFactory.createWorkbook(XSSFWorkbookFactory.java:135)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at
poi/org.apache.poi.ss.usermodel.WorkbookFactory.createWorkbook(WorkbookFactory.java:339)
at
poi/org.apache.poi.ss.usermodel.WorkbookFactory.createXSSFWorkbook(WorkbookFactory.java:314)
at
poi/org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:232)
at
poi/org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:198)
at
benthin.fxclient/de.benthin.fxgui.application.DefaultWorkSheet$InternalCustomerfabricExcelHandler.getVersion(DefaultWorkSheet.java:478)
at
benthin.fxclient/de.benthin.fxgui.application.DefaultWorkSheet.checkFabricsFile(DefaultWorkSheet.java:401)
at
benthin.fxclient/de.benthin.fxgui.application.DefaultWorkSheet.lambda$start$2(DefaultWorkSheet.java:246)
at
javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native
Method)
at
javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at
javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at
javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at
javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Best regards
Achim