Liferay DXP 2026.Q4    |    Release Webinar: 18 November 2026    |    Replay coming soon! 

Blogs

Third party library to Bundle OSGi on Liferay DPX/7

Ignacio Roncero Bazarra
Ignacio Roncero Bazarra
5 Minuutin Luku

Short explanation

If you want to convert a third party library of your portlets (modules) into a Bundle OSGi to be used by all modules, you could create a new module with your third party library and dependences and be used by your modules.

To explain this we will use JasperReport third party library. Supose that you have a module that uses JasperReport to generate PDF files. Probably you have these dependencies in the build.gradle file of your module:

Sivun kommentit
Hi nice post but it would probably worth to mention compileInclude. This will do a lot of the mentioned stuff for you automatically.
Thank you very much for your comment Miroslav. After reading your comment, I've done some tests to better understand the difference between common types of compile directives. And I modified the post accordingly. As you say it is possible to use compileInclude instead of the Export-Package combination.

Hi, thanks for  your knowledge , consult i am using liferay 7.2 messagelistener with jasperreport and method receive  of messagelistener when execute generate jasperreport, show me error : 

Exception in thread "logging/export-1" java.lang.ExceptionInInitializerError     at net.sf.jasperreports.engine.DefaultJasperReportsContext.getExtensions(DefaultJasperReportsContext.java:268)     at net.sf.jasperreports.engine.util.MessageUtil.getMessageProvider(MessageUtil.java:70)     at net.sf.jasperreports.engine.JRRuntimeException.resolveMessage(JRRuntimeException.java:166)     at net.sf.jasperreports.engine.JRRuntimeException.getMessage(JRRuntimeException.java:146)     at net.sf.jasperreports.engine.JRRuntimeException.getMessage(JRRuntimeException.java:138)     at pe.com.pacifico.portal.corredores.admin.logging.messaging.impl.LoggingReportsMessagingImpl.receive(LoggingReportsMessagingImpl.java:90)     at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)     at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56)     at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752)     at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)     at java.lang.Thread.run(Thread.java:748)

 

 

Related Assets...

Tuloksia Ei Löytynyt

More Blog Entries...

Himanshu Chauhan
marraskuuta 20, 2026
Tony Lim
marraskuuta 19, 2026