Level 4
December 8, 2015
Solved
java.lang.NoClassDefFoundError in OSGi even when dependencies are added in POM CQ5
- December 8, 2015
- 10 replies
- 9887 views
I am trying to convert an .docx file to html using apache POI. Now the case is when I deploy my bundle to OSGi felix in CQ5 I am getting the exception as :
java.lang.NoClassDefFoundError: org/openxmlformats/schemas/wordprocessingml/x2006/main/impl/CTSectPrImpl$1HeaderReferenceList at org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTSectPrImpl.getHeaderReferenceList(Unknown Source) at org.apache.poi.xwpf.converter.core.MasterPageManager.visitHeadersFooters(MasterPageManager.java:200) at org.apache.poi.xwpf.converter.core.MasterPageManager.addSection(MasterPageManager.java:178) at org.apache.poi.xwpf.converter.core.MasterPageManager.compute(MasterPageManager.java:125) at org.apache.poi.xwpf.converter.core.MasterPageManager.initialize(MasterPageManager.java:95) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitBodyElements(XWPFDocumentVisitor.java:226) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.start(XWPFDocumentVisitor.java:193) at org.apache.poi.xwpf.converter.xhtml.XHTMLConverter.convert(XHTMLConverter.java:68) at org.apache.poi.xwpf.converter.xhtml.XHTMLConverter.doConvert(XHTMLConverter.java:58) at org.apache.poi.xwpf.converter.xhtml.XHTMLConverter.doConvert(XHTMLConverter.java:38) at org.apache.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:45) at com.maximintegrated.wcm.handlers.SoftwarePartDownloadHandler.wordFileFrmURLToHTML(SoftwarePartDownloadHandler.java:112) at com.maximintegrated.wcm.handlers.SoftwarePartDownloadHandler.activate(SoftwarePartDownloadHandler.java:56)
- I tried creating the simple java project and that works like a charm when I added all the required jars in configure build path -> external jars .
- I created a maven project also and added all the dependencies in its POM and this also worked fine. POM file dependencies are pom.xml.
- But when I create a maven project for AEM6 with the same dependencies and deploy to OSGi felix, there is no compile time error but at runtime I get the above exception. have tried it in various CQ instances. Still no luck.
Also I tried building the ooxml-schemas-1.1.jar as bundle and installing it separately in felix OSGi because thats the jar where that class in coming from, but that also gives the same error.