RE: Exception while deploying a portlet

Vasudev Ganesan, modified 7 Years ago. New Member Posts: 2 Join Date: 8/23/18 Recent Posts

Hello there,

 

I was following the documentation for creating a portlet module app which can be deployed on Liferay dxp 7.1.0 version. 

 

Having reached the final stage of the documentation (https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/fitting-it-all-together) where we combine all the portlet web , api and service layer, then on deploying it i am facing the following exception:

 

org.osgi.framework.BundleException: Could not resolve module: com.liferay.docs.guestbook.service [979]_  Unresolved requirement: Import-Package: com.liferay.docs.guestbook.exception; version="[1.0.0,2.0.0)"_    -> Export-Package: com.liferay.docs.guestbook.exception; bundle-symbolic-name="com.liferay.docs.guestbook.api"; bundle-version="1.0.0"; version="1.0.0"; uses:="com.liferay.portal.kernel.exception"_       com.liferay.docs.guestbook.api [978]_         Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[1.0.0,1.1.0)"_ [Sanitized]

 

I tried searching on various community forum for any answers and one of the suggestions was to add compileInclude in all of the build.gradle file. But that introduced a new exception as below:

 

org.osgi.framework.BundleException: Could not resolve module: com.liferay.docs.guestbook.portlet [982]_  Unresolved requirement: Import-Package: com.liferay.portal.freemarker_ [Sanitized]
    at org.eclipse.osgi.container.Module.start(Module.java:429)
 

Kindly please suggest a solution to this.

 

Thanks !

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Vasu Gan:
Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[1.0.0,1.1.0)"

The version of com.liferay.portal.kernel.model that shipped with 7.1 GA1 is 2.0.0, so it sounds like you have the wrong version of com.liferay.portal:com.liferay.portal.kernel declared as a dependency in your build.gradle. You can try using 3.6.0 (which is the API version released with 7.1.0 GA1) to see if your sample will deploy.

Vasu Gan, modified 7 Years ago. New Member Posts: 2 Join Date: 8/23/18 Recent Posts

Hello there,

 

Thank you so much for your reply!

 

The version I was using for com.liferay.portal.kernel.model for 2.6.0 so increased it to 3.6.0. But i am getting the following error now :

 

org.osgi.framework.BundleException: Could not resolve module: com.liferay.docs.guestbook.portlet [985]_  Unresolved requirement: Import-Package: com.liferay.portal.freemarker_ [Sanitized]

Regards,

Vas 

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Vasu Gan:
Unresolved requirement: Import-Package: com.liferay.portal.freemarker_ [Sanitized]

In theory, that package comes from com.liferay.portal.impl, but it is specifically excluded in system.packages.extra.bnd so it will never be available.

Your only option is to avoid using FreeMarkerUtil. However, if you're feeling adventurous, you can try adding the package to the value for module.framework.system.packages.extra in portal-ext.properties, but it's not clear whether Liferay will still work if you re-include something that someone felt we should specifically exclude.