Forums de discussion

LR6-to-LR7 WAR migration - Where are the portlets?

thumbnail
Ronny M.J. Diels, modifié il y a 7 années.

LR6-to-LR7 WAR migration - Where are the portlets?

New Member Publications: 13 Date d'inscription: 20/01/17 Publications récentes
Hi,

I would like to perform an upgrade from Liferay 6.0 to 7.0
After we have made our first LR6 war LR7 compliant, I am now trying to deploy it using the Liferay WAB extender.
It seems that WAB extender is OK with what I did, because the converted war file is copied to the osgi\wabs folder and there are no errors or warnings in any of the logs.

However, when I sign-in to the Liferay portal as admin, I cannot find our portlets and our portlet categories?

Here's what I did to make the LR6 war LR7 compliant:
I fixed all compilation problems and made a new build using the LR7 runtime libraries instead of those from LR6.
PortletPreferencesFactoryUtil (com.liferay.portlet => com.liferay.portal.kernel.portlet)
Fix ConfigurationAction child classes (render() out, include() in)
User (com.liferay.portal.model => com.liferay.portal.kernel.model)
UserServiceUtil (com.liferay.portal.service => com.liferay.portal.kernel.service)


I added portal-ext.properties at ...servers\liferay-ce-portal-7.0-ga3\
module.framework.web.generator.generated.wabs.store=true
module.framework.web.generator.generated.wabs.store.dir=${module.framework.base.dir}/wabs



I noticed the following, each time I restart the server :
- a new copy of the war file is added to osgi\wabs
- a new bundle-id is installed (as can be seen via telnet client to Apache Felix Gogo)
I don't know if that is normal.

Logs
...
07:20:29,920 INFO [localhost-startStop-1][AutoDeployDir:252] Processing verzekeringen-portlet-6.0.6.1.war
07:20:29,922 INFO [localhost-startStop-1][AutoDeployDir:185] Auto deploy scanner started for D:\RD\Dev\servers\liferay-ce-portal-7.0-ga3\deploy
...
07:21:11,076 TRACE [elasticsearch[Ryder][bulk][T#1]][index:158] took[626.4ms], took_millis[626], type[LiferayDocumentType], id[com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_PORTLET_com.liferay.portal.osgi.web.wab.extender.internal.configuration.WabExtenderConfiguration], routing[] , source[{"uid":"com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_PORTLET_com.liferay.portal.osgi.web.wab.extender.internal.configuration.WabExtenderConfiguration","companyId":"0","configurationModelId":"com.liferay.portal.osgi.web.wab.extender.internal.configuration.WabExtenderConfiguration","entryClassName":"com.liferay.configuration.admin.web.internal.model.ConfigurationModel","configurationModelFactoryPid":"com.liferay.portal.osgi.web.wab.extender.internal.configuration.WabExtenderConfiguration","title_zh_CN":"WAB???","title_es_ES":"Extensor WAB","title_ja_JP":"WAB Extender","title_iw_IL":"WAB Extender","title_nl_NL":"WAB-verlenger","title_fi_FI":"WAB Extender -laite","title_ca_ES":"Estensor WAB","title_hu_HU":"WAB bovíto","title_fr_FR":"Extendeur WAB","title":"WAB Extender","title_en_US":"WAB Extender","title_pt_BR":"Extensor WAB","title_de_DE":"WAB Extender","configurationModelAttributeName":"Stop timeout"}]
07:21:14,214 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:42] Copying portlets for d:\RD\Dev\servers\liferay-ce-portal-7.0-ga3\tomcat-8.0.32\temp\20170328072106950MPOTMIJG\verzekeringen-portlet-6.0.6.1.war
07:21:15,112 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseDeployer:873] Deploying verzekeringen-portlet-6.0.6.1.war
...
07:22:20,777 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:50] Portlets for d:\RD\Dev\servers\liferay-ce-portal-7.0-ga3\tomcat-8.0.32\temp\20170328072106950MPOTMIJG\verzekeringen-portlet-6.0.6.1.war copied successfully
07:32:12,404 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BundleStartStopLogger:35] STARTED
...


I also did a small test with the demo war (provided via https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/using-the-wab-generator).
For this one, the portlet is available and works fine:
07:32:15,055 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][HotDeployImpl:226] Deploying comliferayhellouserjsfportlet-10-SNAPSHOT from queue
07:32:15,058 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][PluginPackageUtil:1006] Reading plugin package for comliferayhellouserjsfportlet-10-SNAPSHOT
07:32:15,073 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][PortletHotDeployListener:202] Registering portlets for comliferayhellouserjsfportlet-10-SNAPSHOT
07:32:15,274 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][PortletHotDeployListener:331] 1 portlet for comliferayhellouserjsfportlet-10-SNAPSHOT is available for use



Does anyone have any idea why my portlets and portlet categories are not shown in the portal admin pages?
thumbnail
Ronny M.J. Diels, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

New Member Publications: 13 Date d'inscription: 20/01/17 Publications récentes
Some more information.
If I compare the logs for our war (verzekeringen-portlet-6.0.6.1) with the logs for the demo war (com.liferay.hello.user.jsf.portlet-1.0), then I notice that the "bold part" is missing for our war.
So it seems that the portlets are only copied, but not really deployed and registered!?
Is there any way (extra logging, ...) of finding out what could be the exact cause of this?


verzekeringen-portlet-6.0.6.1.war
09:15:00,764 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:42] Copying portlets for d:\RD\Dev\servers\liferay-ce-portal-7.0-ga3\tomcat-8.0.32\temp\20170328091455214MAMEDVEY\verzekeringen-portlet-6.0.6.1.war
09:15:01,098 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseDeployer:873] Deploying verzekeringen-portlet-6.0.6.1.war
...
28-Mar-2017 09:15:24.750 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 125595 ms
...
09:16:01,231 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:50] Portlets for d:\RD\Dev\servers\liferay-ce-portal-7.0-ga3\tomcat-8.0.32\temp\20170328091455214MAMEDVEY\verzekeringen-portlet-6.0.6.1.war copied successfully


com.liferay.hello.user.jsf.portlet-1.0-SNAPSHOT.war
09:14:51,510 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:42] Copying portlets for d:\RD\Dev\servers\liferay-ce-portal-7.0-ga3\tomcat-8.0.32\temp\20170328091451329URQZVBHT\com.liferay.hello.user.jsf.portlet-1.0-SNAPSHOT.war
09:14:52,001 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseDeployer:873] Deploying com.liferay.hello.user.jsf.portlet-1.0-SNAPSHOT.war
09:14:52,908 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:50] Portlets for d:\RD\Dev\servers\liferay-ce-portal-7.0-ga3\tomcat-8.0.32\temp\20170328091451329URQZVBHT\com.liferay.hello.user.jsf.portlet-1.0-SNAPSHOT.war copied successfully
...
28-Mar-2017 09:15:24.750 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 125595 ms
...
09:25:49,374 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][HotDeployImpl:226] Deploying comliferayhellouserjsfportlet-10-SNAPSHOT from queue
09:25:49,375 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][PluginPackageUtil:1006] Reading plugin package for comliferayhellouserjsfportlet-10-SNAPSHOT
09:25:49,394 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][PortletHotDeployListener:202] Registering portlets for comliferayhellouserjsfportlet-10-SNAPSHOT
09:25:49,591 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][PortletHotDeployListener:331] 1 portlet for comliferayhellouserjsfportlet-10-SNAPSHOT is available for use
09:25:49,642 INFO [BridgeSessionListener:73] Context initialized for contextPath=[/o/com.liferay.hello.user.jsf.portlet-1.0-SNAPSHOT]
09:25:50,274 INFO [fileinstall-D:/RD/Dev/servers/liferay-ce-portal-7.0-ga3/osgi/war][BundleStartStopLogger:35] STARTED com.liferay.hello.user.jsf.portlet-1.0-SNAPSHOT_1.0.0 [511]
thumbnail
Neil Griffin, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Hi Ronny,

As a first step to figuring out the problem, please download our jsf-applicant-portlet.war demo from Maven Central and copy it to the $LIFERAY_HOME/deploy folder in your environment. After that, please let us know if you are able to add the "JSF Applicant" portlet to a portal page.

Thanks,

Neil
thumbnail
Ronny M.J. Diels, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

New Member Publications: 13 Date d'inscription: 20/01/17 Publications récentes
Hi Neil,

The jsf-applicant-portlet.war is deployed, but not started automatically.
Apache Felix Gogo> 521|Installed | 10|com.liferay.faces.demo.jsf.spring.applicant.portlet-3.0.0 (1.0.0)

When I try to start it, (start 521), I get :
07:58:50,617 INFO [ContextLoader:305] Root WebApplicationContext: initialization started
07:58:50,714 INFO [XmlWebApplicationContext:578] Refreshing Root WebApplicationContext: startup date [Wed Mar 29 07:58:50 GMT 2017]; root of context hierarchy
07:58:50,716 INFO [XmlBeanDefinitionReader:317] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
07:58:50,927 INFO [AutowiredAnnotationBeanPostProcessor:153] JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
07:58:50,961 INFO [ContextLoader:345] Root WebApplicationContext: initialization completed in 338 ms
07:58:51,073 INFO [BridgeImpl] Initializing Liferay Faces Bridge Implementation 3.0.0 (Aug 30, 2016 AD)
07:58:51,131 INFO [BridgeSessionListener:73] Context initialized for contextPath=[/o/com.liferay.faces.demo.jsf.spring.applicant.portlet-3.0.0]
07:58:51,253 ERROR [BridgeExtDependencyVerifier:40] Liferay Faces Bridge Ext 2.0.0 (Aug 29, 2016 AD) is designed to be used with Liferay Portal 6.2 but detected 7.0


I got it from https://maven2repo.com/com.liferay.faces.demo/com.liferay.faces.demo.jsf.spring.applicant.portlet/3.0.0/war
Wrong version?

Thanks,
Ronny
thumbnail
Neil Griffin, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Hi Ronny,

Apologies -- I should have provided the link to the jsf-applicant-portlet from our demos page. As the demos page indicates, version 4.0.0 is for Liferay Portal 7.0 and version 3.0.0 is for Liferay Portal 6.2, which would explain the error message that you saw on deploy.

So after removing $LIFERAY_HOME/osgi/war/jsf-applicant-portlet-3.0.0.war please download version 4.0.0 and copy to $LIFERAY_HOME/deploy and let us know how it works out.

Thanks,

Neil
thumbnail
Ronny M.J. Diels, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

New Member Publications: 13 Date d'inscription: 20/01/17 Publications récentes
No problem :-)
com.liferay.faces.demo.jsf.applicant.portlet-4.0.0.war works fine.
No issues at all during deploy .. start .. add.
Thanks!
thumbnail
Ronny M.J. Diels, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

New Member Publications: 13 Date d'inscription: 20/01/17 Publications récentes
Hi Neil,

Here are some more findings on my issue :

When I deployed com.liferay.faces.demo.jsf.applicant.portlet-4.0.0.war, it took 15 seconds for the server to deploy, install and start it.
However for my war, it takes around 10 minutes to generate the wab (based on the timestamp of the war in osgi\wabs).
I noticed that the generated META-INF\MANIFEST.MF is approximately 70KB (with an enormous amount of import and private packages).
No errors or warnings.
Apache Felix Gogo, "524 | Installed | 10| verzekeringen-portlet (6.0.6.1)"

When I restart the server, it takes again 10 minutes to generate a new wab version (bundle 525)
No errors or warnings.
Apache Felix Gogo : "525 | Installed | 10| verzekeringen-portlet (6.0.6.1)"

Thanks,
Ronny
thumbnail
Ronny M.J. Diels, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

New Member Publications: 13 Date d'inscription: 20/01/17 Publications récentes
When I try to start the the bundle manually from within Apache Felix Gogo (start 525), I get a lot of dependency issues to liferay related packages:

Some examples:
Unresolved requirement: Import-Package: com.liferay.client.soap.portal.model; resolution:="optional"
Unresolved requirement: Import-Package: com.liferay.client.soap.portal.service; resolution:="optional"
Unresolved requirement: Import-Package: com.liferay.client.soap.portal.service.http; resolution:="optional"
Unresolved requirement: Import-Package: com.liferay.client.soap.portlet.announcements.model; resolution:="optional"
=> Should be taken from liferay-ce-portal-7.0-ga3\tomcat-8.0.32\webapps\ROOT\WEB-INF\lib\portal-client.jar ?

Unresolved requirement: Import-Package: com.swabunga.spell.engine; resolution:="optional"
Unresolved requirement: Import-Package: com.swabunga.spell.event; resolution:="optional"
=> Should be taken from liferay-ce-portal-7.0-ga3\tomcat-8.0.32\webapps\ROOT\WEB-INF\lib\jazzy.jar ?

Unresolved requirement: Import-Package: net.fortuna.ical4j.model; resolution:="optional"
Unresolved requirement: Import-Package: net.fortuna.ical4j.model.property; resolution:="optional"
=> Should be taken from liferay-ce-portal-7.0-ga3\tomcat-8.0.32\webapps\ROOT\WEB-INF\lib\ical4j.jar ?

and many more...
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

Liferay Legend Publications: 14914 Date d'inscription: 02/09/06 Publications récentes
Hey, Ronny!

So the jars in ROOT/WEB-INF/lib are not visible within the OSGi environment. Even though those jars are available to Liferay, they will not be available to your bundle.

Instead you need to handle the dependencies yourself. Fortunately I have a blog post that will help you with them: https://web.liferay.com/web/user.26526/blog/-/blogs/osgi-module-dependencies.

Note that if you don't want to include the jars as dependencies, you can exclude the jars by following the comments on the blog showing how to use the Import-Package directive to exclude the packages, such as:

Import-Package: !com.swabunga.spell.engine,\
*


Ultimately your bundle will not start and your portlets will not be available until you've dealt with all of the unresolved dependencies.
thumbnail
Neil Griffin, modifié il y a 7 années.

RE: LR6-to-LR7 WAR migration - Where are the portlets?

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Hi Ronny,

I just wanted to mention that since JSF portlets rely on the WAB Generator at deploy time, that putting files in a bnd.bnd file (a build-time descriptor) won't work. If you have any OSGi directives like Import-Package you might want to try putting them in src/main/webapp/WEB-INF/liferay-plugin-package.properties instead. For your reference, see primefaces-users-portlet/src/main/webapp/WEB-INF/liferay-plugin-package.properties

Neil
thumbnail
Neil Griffin, modifié il y a 7 années.

Moved to Liferay Faces - English

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Moved to Liferay Faces - English