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
Liferay DXP - Debug JSPs in OSGi bundles
Hi everyone,
I use Liferay DXP and IntelliJ IDEA (with Liferay Intellij Plugin).
Question - how can I debug JSPs inside OSGi jar modules?
(it was working "by default" for Liferay 6.x WARs, but debug doest not work for jars - perhaps, some additional configuration needed?)
Also, how can I debug JSPs from Liferay sources?
In 6.x I could include the entire webapps/ROOT as module to IDE, and debug required parts of code.
In DXP those JSPs are inside jars (which are inside lpkg files), for example:
../osgi/marketplace/Liferay Web Experience - Liferay Asset - Impl.lpkg!/com.liferay.asset.publisher.web-2.0.40.jar!/META-INF/resources/view.jsp
Is it possible to debug such parts of Liferay code?
(I need to check which JSPs are invoked, which values are passed, etc. in order to understand better how things work internally).
Any help appreciated
Regards,
Vitaliy
I use Liferay DXP and IntelliJ IDEA (with Liferay Intellij Plugin).
Question - how can I debug JSPs inside OSGi jar modules?
(it was working "by default" for Liferay 6.x WARs, but debug doest not work for jars - perhaps, some additional configuration needed?)
Also, how can I debug JSPs from Liferay sources?
In 6.x I could include the entire webapps/ROOT as module to IDE, and debug required parts of code.
In DXP those JSPs are inside jars (which are inside lpkg files), for example:
../osgi/marketplace/Liferay Web Experience - Liferay Asset - Impl.lpkg!/com.liferay.asset.publisher.web-2.0.40.jar!/META-INF/resources/view.jsp
Is it possible to debug such parts of Liferay code?
(I need to check which JSPs are invoked, which values are passed, etc. in order to understand better how things work internally).
Any help appreciated

Regards,
Vitaliy
Hello Vitaly,
at the moment it is not possible to debug JSPs from the Liferay Sources in IntelliJ IDEA (I think it is not possible in Eclipse as well, but not sure).
To be able to debug JSPs the directories containing the JSPs must be detected as "Web Context". For WAR-style modules IntelliJ detects those automatically e.g. in /src/main/web. For OSGi-based JAR-modules IntelliJ does not know which directory contains the JSPs files.
When you are using the Liferay IntelliJ plugin that plugin tells IntelliJ IDEA that the directory META-INF/resources contains JSP files and declares this folder as "Web Context". By this, it should be possible to debug inside those JSPs. So for your own modules it is possible to debug.
Unfortunately you cannot define "Web Context"s to be present inside libraries. So even if you add a dependency to an existing Liferay module (e.g. using gradle or maven), you cannot define that the META-INF/resouces folder inside that library should be a "Web Context". Those have to be in a relative path to an existing module inside IntelliJ IDEA.
It may be possible to add such a functionality to the Liferay Intellij plugin. I will try to find out if it is possible to influence the debugger behaviour of IntelliJ to make it possible to debug JSPs inside libraries.
Regards,
Dominik
at the moment it is not possible to debug JSPs from the Liferay Sources in IntelliJ IDEA (I think it is not possible in Eclipse as well, but not sure).
To be able to debug JSPs the directories containing the JSPs must be detected as "Web Context". For WAR-style modules IntelliJ detects those automatically e.g. in /src/main/web. For OSGi-based JAR-modules IntelliJ does not know which directory contains the JSPs files.
When you are using the Liferay IntelliJ plugin that plugin tells IntelliJ IDEA that the directory META-INF/resources contains JSP files and declares this folder as "Web Context". By this, it should be possible to debug inside those JSPs. So for your own modules it is possible to debug.
Unfortunately you cannot define "Web Context"s to be present inside libraries. So even if you add a dependency to an existing Liferay module (e.g. using gradle or maven), you cannot define that the META-INF/resouces folder inside that library should be a "Web Context". Those have to be in a relative path to an existing module inside IntelliJ IDEA.
It may be possible to add such a functionality to the Liferay Intellij plugin. I will try to find out if it is possible to influence the debugger behaviour of IntelliJ to make it possible to debug JSPs inside libraries.
Regards,
Dominik
Hello Vitaly,
I have to add that if you are using the IntelliJ plugin and you create a "Liferay Server" Run Configuration, it is not possible to debug inside JSPs (not even in your own modules).
If you create a "Tomcat" Run Configuration instead (if you are using a tomcat bundle), you can at least debug inside the JSPs in your own modules.
Does this help you?
I have to add that if you are using the IntelliJ plugin and you create a "Liferay Server" Run Configuration, it is not possible to debug inside JSPs (not even in your own modules).
If you create a "Tomcat" Run Configuration instead (if you are using a tomcat bundle), you can at least debug inside the JSPs in your own modules.
Does this help you?
Hello Vitaliy,
I have implemented the functionality to debug JSPs from your own modules, from any dependency and from the liferay sources (if you are using the target workspace plugin) into the IntelliJ plugin.
The latest plugin has been released today, so you can try it.
https://plugins.jetbrains.com/plugin/10739-liferay-intellij-plugin
I have implemented the functionality to debug JSPs from your own modules, from any dependency and from the liferay sources (if you are using the target workspace plugin) into the IntelliJ plugin.
The latest plugin has been released today, so you can try it.
https://plugins.jetbrains.com/plugin/10739-liferay-intellij-plugin
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™