Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Unresolved reference: CTPageMar #9

Open
Andrey-Morenkov opened this issue Mar 15, 2020 · 0 comments
Open

Unresolved reference: CTPageMar #9

Andrey-Morenkov opened this issue Mar 15, 2020 · 0 comments

Comments

@Andrey-Morenkov
Copy link

I tried to set custom page margins to document using
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPageMar

But there is and issue that this is unresolved reference. I searching in web this issue and detected that this is missing dependency in your project
implementation "org.apache.poi:ooxml-schemas:1.3"

I added this in my forked repo and all references is OK, but i cathing runtime issue every time:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/poi/javax/xml/stream/XMLEventFactory; at org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.<clinit>(PackagePropertiesMarshaller.java:41) at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:161) at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:141) at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:72) at org.apache.poi.openxml4j.opc.OPCPackage.create(OPCPackage.java:394) at org.apache.poi.xwpf.usermodel.XWPFDocument.newPackage(XWPFDocument.java:132) at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:123) at ru.hryasch.coachnotes.repository.tools.JournalDocument.generateDocument(DocExporter.kt:82) at ru.hryasch.coachnotes.repository.tools.JournalDocument$Companion.generate-Alf2mtc(DocExporter.kt:61) at ru.hryasch.coachnotes.repository.tools.DocExporter.export-Alf2mtc(DocExporter.kt:40) at ru.hryasch.coachnotes.domain.journal.interactors.impl.JournalInteractorImpl.exportJournal-djkruGA(JournalInteractorImpl.kt:61) at ru.hryasch.coachnotes.journal.presenters.impl.JournalPresenterImpl$onExportButtonClicked$1.invokeSuspend(JournalPresenterImpl.kt:112) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:561) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:727) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:667) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:655) Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.poi.javax.xml.stream.XMLEventFactory" on path: DexPathList[[zip file "/data/app/ru.hryasch.coachnotes-QqhV5YU1zgEki6gvl2p2YA==/base.apk"],nativeLibraryDirectories=[/data/app/ru.hryasch.coachnotes-QqhV5YU1zgEki6gvl2p2YA==/lib/x86, /data/app/ru.hryasch.coachnotes-QqhV5YU1zgEki6gvl2p2YA==/base.apk!/lib/x86, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.<clinit>(PackagePropertiesMarshaller.java:41)  at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:161)  at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:141)  at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:72)  at org.apache.poi.openxml4j.opc.OPCPackage.create(OPCPackage.java:394)  at org.apache.poi.xwpf.usermodel.XWPFDocument.newPackage(XWPFDocument.java:132)  at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:123) 

Can you fix it?
p.s i added this but this not helps
System.setProperty("org.apache.poi.javax.xml.stream.XMLInputFactory", "com.fasterxml.aalto.stax.InputFactoryImpl") System.setProperty("org.apache.poi.javax.xml.stream.XMLOutputFactory", "com.fasterxml.aalto.stax.OutputFactoryImpl") System.setProperty("org.apache.poi.javax.xml.stream.XMLEventFactory", "com.fasterxml.aalto.stax.EventFactoryImpl")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant