Message Boards

migrated 6.2 portlet to 7.2?

charlie garrett-jones, modified 4 Years ago.

migrated 6.2 portlet to 7.2?

New Member Posts: 4 Join Date: 5/17/19 Recent Posts
hi there, I have a portlet that was developed in 6.2 and was migrated to function in 7.1. should I be able to deploy this portlet to 7.2 as well? or are there additional architectural changes required?
when I do attempt to deploy I get the following error:
2019-08-16 17:09:33.880 ERROR [fileinstall-/opt/liferay-ce-portal-7.2.0-ga1/osgi/war][LogService:93] Error while starting bundle: webbundle:/opt/liferay-ce-portal-7.2.0-ga1/osgi/war/swts-portlet.war?Bundle-SymbolicName=swts-portlet&Web-ContextPath=/swts-portlet&protocol=file
org.osgi.framework.BundleException: Could not resolve module: swts-portlet [1080]_  Unresolved requirement: Import-Package: COM.newmonics.PercClassLoader; resolution:="optional"_  Unresolved requirement: Import-Package: EDU.oswego.cs.dl.util.concurrent; resolution:="optional"_  Unresolved requirement: Import-Package: android.os; resolution:="optional"_
...
 Unresolved requirement: Import-Package: com.liferay.portal.osgi.web.servlet.jsp.compiler; resolution:="optional"_  Unresolved requirement: Import-Package: com.liferay.portal.spring.context; resolution:="optional"_  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=9))"_ [Sanitized]
        at org.eclipse.osgi.container.Module.start(Module.java:444)
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1264)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1237)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316)

any direction most appreciated.
thumbnail
Mohammed Yasin, modified 4 Years ago.

RE: migrated 6.2 portlet to 7.2?

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
charlie garrett-jones, modified 4 Years ago.

RE: migrated 6.2 portlet to 7.2?

New Member Posts: 4 Join Date: 5/17/19 Recent Posts
thanks for that. i did solve the problem by doing a maven clean and redeploying my app.
Philippe Tran, modified 4 Years ago.

RE: migrated 6.2 portlet to 7.2?

New Member Posts: 20 Join Date: 1/22/09 Recent Posts
Hi, I have the exact same problem, rebuilding a 6.2 portlet for 7.1.

Can you please detail the operation: how to "maven clean" ? from within Liferay Studio ?

Thanks
thumbnail
Olaf Kock, modified 4 Years ago.

RE: migrated 6.2 portlet to 7.2?

Liferay Legend Posts: 6396 Join Date: 9/23/08 Recent Posts
Philippe Tran:

<p>Hi, I have the exact same problem, rebuilding a 6.2 portlet for 7.1.</p>
The missing dependency? Most often when I've seen this, there was a mismatch of JDK versions at some point. Make sure you use a matching one (e.g. don't run Java11-compiled code on Java8 - the other way around works just fine), also make sure you use either Java 8 or Java 11. Check the compatibility matrix, which states that you should build with Java 8. Also note that only the LTS Java versions are supported at all, e.g. no Java 9 or 10.
Philippe Tran, modified 4 Years ago.

RE: migrated 6.2 portlet to 7.2?

New Member Posts: 20 Join Date: 1/22/09 Recent Posts
Olaf, thanks for answering.
In my case, there should be no JDK mismatch, because I only use "pure" (oracle) Java 8 - without any install of Java 9+. I guess the build has embedded some other maven or gradle stuff, because I have also, in my machine, an old eclipse with maven (for liferay 6.2) and Android Studio with another gradle version.
Please note that I have re-created a new liferay 7.1 environment (with workplace), a new war-portlet module from scratch, and migrated elements from the "old" portlet: resources, jsp, classes... one by one (with extreme care).
In the error log, I can see "Import-Package": EDU.oswego.cs.dl.util.concurrent, android.app, bsh, etc... Is it normal for them to be there ?
UPDATE:
Using "module.framework.web.generator.generated.wabs.store=true", I have traced the "wab" file, and found in MANIFEST.MF
Import-Package: EDU.oswego.cs.dl.util.concurrent;resolution:=optional, android.app;resolution:=optional, bsh;resolution:=optional, ...
Philippe Tran, modified 4 Years ago.

RE: migrated 6.2 portlet to 7.2?

New Member Posts: 20 Join Date: 1/22/09 Recent Posts
I just found my solution.
PROBLEM When deploying my Spring MVC (war) portlet, I have the error: Unresolved requirement: Require-Capability: osgi.extender; filter:="(&(osgi.extender=jsp.taglib)(uri=/META-INF/my-taglib.tld))"
CONTEXT I use a custom taglib described in "/META-INF/my-taglib.tld", referenced in "web.xml" and imported in jsp files.
SOLUTION In "liferay-plugin-package.properties", I added: Provide-Capability=osgi.extender;osgi.extender="jsp.taglib";uri="/META-INF/my-taglib.tld"
Thanks to the post https://liferay.dev/forums/-/message_boards/message/91937048
Note that adding a "bnd.bnd" description (with Provide-Capability) to a Spring MVC portlet will not work, because Liferay will try (and fail) to build a jar when deploying.
Hope this will help.
Mithun Seal, modified 3 Years ago.

RE: migrated 6.2 portlet to 7.2?

New Member Posts: 4 Join Date: 10/16/19 Recent Posts
Hi Philippe, I tried to solve the issue using below line but sometimes post deployment and while accessing the application, I am getting ome freemarker error. Do you remember if you faced same issue? If yes, how did you resolve the issue?
Provide-Capability=osgi.extender;osgi.extender="jsp.taglib";uri="/WEB-INF/tld/my-custom.tld"

Error:
[FreeMarkerManager:216] Unable to add taglib liferay_portlet to context
freemarker.template.TemplateModelException: Error while loading tag library for URI "/META-INF/liferay-portlet-ext.tld" from TLD location "servletContext:/META-INF/liferay-portlet-ext.tld"; see cause exception.

Caused by: freemarker.ext.jsp.TaglibFactory$TldParsingSAXException: In bundleresource://1113.fwk948623530:31/META-INF/liferay-portlet-ext.tld, at line 528, column 8:_Can't load class "com.liferay.taglib.portletext.RuntimeTag" for custom tag "runtime". [Sanitized]

Thanks,Mithun Seal