Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: dependency issue on reading xlsx file in Liferay 7.3
Hi,
I am using Liferay 7.3 DXP, while reading xlsx file i am getting dependency issue.Provided below the more details.
My code:
XSSFWorkbook wb = new XSSFWorkbook(xlsFile);
XSSFSheet sheet =
wb.getSheetAt(0);
XSSFRow row;
Build.gradle file:
compileOnly group: 'org.apache.poi', name:
'poi-ooxml', version: '3.9'
Exception:
org.osgi.framework.BundleException: Could not
resolve module: com.test [1659]_ Unresolved requirement:
Import-Package: org.apache.poi.ss.usermodel_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444)
at
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
at
com.liferay.portal.file.install.internal.DirectoryWatcher._startBundle(DirectoryWatcher.java:1119)
at
com.liferay.portal.file.install.internal.DirectoryWatcher._startBundles(DirectoryWatcher.java:1152)
at
com.liferay.portal.file.install.internal.DirectoryWatcher._process(DirectoryWatcher.java:1014)
at com.liferay.portal.file.install.internal.DirectoryWatcher.run(DirectoryWatcher.java:265)
Can any one help me in resolving this issue.
You can compile the code, based on your compiler dependencies. But at runtime, you'll also need to provide poi (and its transitive dependencies).
If poi is distributed as OSGi-bundle: deploy it as well.
If it isn't, you might want to check if somebody did that work for you and has an alternative distribution to Apache's, file an issue with the POI project to include the metadata in their releases, or use compileInclude (but remember to also bring in the transitive dependencies)
There's a chapter on this on Liferay University's "OSGi basics" course by yours truly.
Powered by Liferay™