javamavenjboss-eap-6

ClassNotFoundException: org.apache.poi.xwpf.converter.core.Options Module deployment.ear


I have a problem with a maven dependency

I use org.apache.poi.xwpf.converter.pdf maven dependency to pass .docx to .pdf. The library is download by maven but JBoss throws next exception:

java.lang.ClassNotFoundException: org.apache.poi.xwpf.converter.core.Options from [Module "deployment.EARAdmContractRest.ear:main" from Service Module Loader]
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
net.solser.admc.service.purchasingflow.PurchasingRequisitionService.sendFileToDownload(PurchasingRequisitionService.java:1174)
net.solser.admc.service.purchasingflow.PurchasingRequisitionService.sendFileToDownloadAndDeleteFile(PurchasingRequisitionService.java:1185)
net.solser.admc.service.purchasingflow.PurchasingRequisitionService.downloadDraftContract(PurchasingRequisitionService.java:347)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
net.solser.admc.filter.RequestSecurityFilter.doFilter(RequestSecurityFilter.java:48)
net.solser.filter.compress.GzipFilter.doFilter(GzipFilter.java:35)

I tried adding jars to Jboss or Ear lib, but not works.

Any ideas. Tanks.


Solution

  • You need to add module dependencies in the MANIFEST.MF file i.e org.apache.poi.xwpf.converter.pd.

    You can check JBoss docs on generating entries using Maven