Message Boards

Liferay Module Project Fragment not working via gralde deploy 7.3.6ga7?

Uwe Peters, modified 3 Years ago.

Liferay Module Project Fragment not working via gralde deploy 7.3.6ga7?

New Member Posts: 22 Join Date: 11/24/20 Recent Posts

I have downloaded the Liferay CE 7.3.6-ga7 Tomcat bundle from this url and unzipped it: https://releases-cdn.liferay.com/portal/7.3.6-ga7/ and created a new Liferay workspace project. 
If I want to deploy a Liferay Module Project Fragment to the server over the gradle deploy task it fails.

I have created a Liferay Module Project Fragment for com.liferay.login.web as the Fragment Host.

I can select the JSP views that I want to override/modify but when I deploy the Frament Module I am getting this error while I am executing the Gradle deploy task:


Task :modules:test-login-fragment:jar
warning: Host com.liferay.login.web=bundle-version="5.0.26" for this fragment/require bundle cannot be found on the classpath
warning: Host com.liferay.login.web=bundle-version="5.0.26" for this fragment cannot be found on the classpath

the gogo shell says that its in installed state.

gogo shell diag:


test.login.fragment [1355]
  Unresolved requirement: Fragment-Host: com.liferay.login.web; bundle-version="5.0.26"

If I deploy it with the server attached into the Liferay IDE via add and remove from the servers view it gets deployed successfully. 
This is my Liferay IDE Version: Version: 3.9.2.202103181004-ga3

EDIT:

I have looked into the gradle operations console when I deploy via servers add and remove there I can see this again:

> Task :modules:test-login-fragment:jar
warning: Host com.liferay.login.web=bundle-version="5.0.26" for this fragment/require bundle cannot be found on the classpath
warning: Host com.liferay.login.web=bundle-version="5.0.26" for this fragment cannot be found on the classpath

For some reason it works anyway if I deployed through add and remove. If I deploy via the gradle task gradle deploy it fails like described above.

Do I have something misconfigured in gradle or the gradle tasks? 

Uwe Peters, modified 3 Years ago.

RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6ga7?

New Member Posts: 22 Join Date: 11/24/20 Recent Posts

If I want to build a Liferay Module Project Fragment through the gradle wrapper I am getting again this output:

warning: Host com.liferay.login.web=bundle-version="5.0.26" for this fragment/require bundle cannot be found on the classpath

warning: Host com.liferay.login.web=bundle-version="5.0.26" for this fragment cannot be found on the classpath

So my CI CD pipeline is also broken because of this. I am building with GitlabCI and the gradlewrapper. I can not deploy any Liferay Module Project Fragment for the login anymore. If I deploy the produced .jar file the gogo shell outputs this line:

Unresolved requirement: Fragment-Host: com.liferay.login.web; bundle-version="5.0.26"
 

On 7.3.5ga6 all this was working. I have trouble with it since I tried to update to 7.3.6ga7.
I need some of these fixed from the 7.3.6ga7 version but I cant use this because of the above described problems...

thumbnail
Russell Bohl, modified 3 Years ago.

RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6ga7?

Expert Posts: 291 Join Date: 2/13/13 Recent Posts

I would first go to the Gogo shell and run

lb -s | grep "com.liferay.login.web"

You'll see the bundle version there, but to be sure I'd run

headers [bundleId-from-above-lb]

or

headers [bundleId] | grep "Bundle-Version"

If you see a version other than 5.0.26, that solves it.

Uwe Peters, modified 3 Years ago.

RE: RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6

New Member Posts: 22 Join Date: 11/24/20 Recent Posts


Here are the gogoshell outputs for the commands you suggested:

g! lb -s | grep "com.liferay.login.web"


 1242|Active     |   15|com.liferay.login.web (5.0.26)|5.0.26
 1271|Active     |   10|com.liferay.login.web.api (1.0.6)|1.0.6
true

 g! headers 1242



Bundle headers:
 Bnd-LastModified = 1611587464297
 Bundle-ManifestVersion = 2
 Bundle-Name = Liferay Login Web
 Bundle-SymbolicName = com.liferay.login.web
 Bundle-Vendor = Liferay, Inc.
 Bundle-Version = 5.0.26
 Created-By = 1.8.0_221 (Oracle Corporation)
 Import-Package = aQute.bnd.annotation.metatype,com.liferay.captcha.configuration;version="[1.0,2)",com.liferay.captcha.util;version="[1.1,2)",com.liferay.expando.kernel.model;version="[3.3,4)",com.liferay.exportimport.kernel.lar;version="[3.3,4)",com.liferay.osgi.service.tracker.collections.list;version="[2.0,3)",com.liferay.petra.content;version="[1.0,2)",com.liferay.petra.sql.dsl.query;version="[1.0,2)",com.liferay.petra.string;version="[1.4,2)",com.liferay.portal.configuration.metatype.annotations,com.liferay.portal.kernel.annotation;version="[7.0,8)",com.liferay.portal.kernel.bean;version="[8.0,9)",com.liferay.portal.kernel.captcha;version="[7.0,8)",com.liferay.portal.kernel.dao.orm;version="[9.7,10)",com.liferay.portal.kernel.exception;version="[9.3,10)",com.liferay.portal.kernel.json;version="[8.7,9)",com.liferay.portal.kernel.language;version="[8.3,9)",com.liferay.portal.kernel.log;version="[7.0,8)",com.liferay.portal.kernel.model;version="[5.6,6)",com.liferay.portal.kernel.module.configuration;version="[2.0,3)",com.liferay.portal.kernel.portlet;version="[10.2,11)",com.liferay.portal.kernel.portlet.bridges.mvc;version="[3.0,4)",com.liferay.portal.kernel.resource.bundle;version="[1.0,2)",com.liferay.portal.kernel.search;version="[9.3,10)",com.liferay.portal.kernel.security.auth;version="[2.4,3)",com.liferay.portal.kernel.security.auth.session;version="[1.0,2)",com.liferay.portal.kernel.service;version="[4.8,5)",com.liferay.portal.kernel.servlet;version="[8.4,9)",com.liferay.portal.kernel.settings;version="[3.1,4)",com.liferay.portal.kernel.theme;version="[3.1,4)",com.liferay.portal.kernel.upgrade;version="[8.5,9)",com.liferay.portal.kernel.upload;version="[8.1,9)",com.liferay.portal.kernel.util;version="[10.16,11)",com.liferay.portal.kernel.workflow;version="[9.5,10)",com.liferay.portal.kernel.xml;version="[7.0,8)",com.liferay.portal.security.auth;version="[2.0,3)",com.liferay.portal.upgrade.registry;version="[3.0,4)",com.liferay.portal.util;version="[4.12,5)",com.liferay.taglib.include;version="[1.0,2)",com.liferay.taglib.portlet;version="[7.3,8)",com.liferay.taglib.ui;version="[9.1,10)",javax.portlet,javax.servlet,javax.servlet.http,javax.servlet.jsp;version="[2.3,3)",org.osgi.framework;version="[1.8,2)",javax.net.ssl
 Javac-Debug = on
 Javac-Deprecation = off
 Javac-Encoding = UTF-8
 Liferay-Releng-App-Title = Liferay Login
 Liferay-Releng-Bundle = true
 Liferay-Releng-Category = Utility
 Liferay-Releng-Deprecated = false
 Liferay-Releng-Fix-Delivery-Method = core
 Liferay-Releng-Labs = false
 Liferay-Releng-Marketplace = true
 Liferay-Releng-Portal-Required = true
 Liferay-Releng-Public = false
 Liferay-Releng-Restart-Required = true
 Liferay-Releng-Suite = foundation
 Liferay-Releng-Suite-Description = Apps and Features: System Settings, Web Content Editors, Web Content Template Languages, Theme Tools, Mobile Device Rules, Facebook Authentication, LDAP Authentication, NTLM Authentication, OpenID Authentication, OpenSSO Authentication, Remote Authentication (AuthVerifiers), SSO-based Authentication, Token-based Authentication, Portal Scripting, Elasticsearch Support, Solr Support, Documents and Media Store Implementations, and more.<br /><br />The Foundation suite provides applications and features that extend the functionality provided by Liferay's core. Much of the functionality that belonged to Liferay's core prior to Liferay 7 has been extracted into the modules of the Foundation suite. The authentication modules provide a variety of mechanisms for allowing users and remote applications to authenticate to Liferay. The LDAP Authentication module allows administrators to establish connections to one or more LDAP directories from which users can be imported or exported. The SSO modules allow users to authenticate to Liferay using a variety of single-sign on solutions. The Token-based Authentication module allows users or remote applications to authenticate to Liferay without a password. The Scripting modules allow scripts to be written to invoke Liferay's API in several languages including Groovy, BeanShell, Python, Ruby, and JavaScript.<br /><br />This suite is available in the Liferay bundle.
 Liferay-Releng-Suite-Title = Liferay Foundation
 Liferay-Releng-Support-Url = http://www.liferay.com
 Liferay-Releng-Supported = true
 Manifest-Version = 1.0
 Private-Package = com.liferay.login.web.internal.portlet,com.liferay.login.web.internal.portlet.action,com.liferay.login.web.internal.portlet.util,com.liferay.login.web.internal.servlet.taglib.include,com.liferay.login.web.internal.upgrade,com.liferay.login.web.internal.upgrade.v1_0_0,content,resource-actions
 Provide-Capability = osgi.service;objectClass:List<String>="com.liferay.portal.kernel.portlet.ConfigurationAction";uses:="com.liferay.portal.kernel.portlet",osgi.service;objectClass:List<String>="com.liferay.portal.kernel.portlet.bridges.mvc.MVCActionCommand";uses:="com.liferay.portal.kernel.portlet.bridges.mvc",osgi.service;objectClass:List<String>="com.liferay.portal.kernel.portlet.bridges.mvc.MVCRenderCommand";uses:="com.liferay.portal.kernel.portlet.bridges.mvc",osgi.service;objectClass:List<String>="com.liferay.portal.upgrade.registry.UpgradeStepRegistrator";uses:="com.liferay.portal.upgrade.registry",osgi.service;objectClass:List<String>="com.liferay.taglib.include.PageInclude";uses:="com.liferay.taglib.include",osgi.service;objectClass:List<String>="javax.portlet.Portlet";uses:="javax.portlet",liferay.resource.bundle;bundle.symbolic.name="com.liferay.login.web";resource.bundle.base.name="content.Language"
 Require-Capability = osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://java.sun.com/portlet_2_0))",osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/aui))",osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/captcha))",osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/clay))",osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/frontend))",osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/portlet))",osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/theme))",osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/ui))",osgi.extender;filter:="(&(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/util))",osgi.extender;filter:="(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))",osgi.service;filter:="(objectClass=com.liferay.portal.kernel.model.Release)";effective:=active,osgi.service;filter:="(objectClass=com.liferay.portal.kernel.module.configuration.ConfigurationProvider)";effective:=active,osgi.service;filter:="(objectClass=com.liferay.portal.kernel.security.auth.session.AuthenticatedSessionManager)";effective:=active,osgi.service;filter:="(objectClass=com.liferay.portal.kernel.service.LayoutLocalService)";effective:=active,osgi.service;filter:="(objectClass=com.liferay.portal.kernel.service.ListTypeLocalService)";effective:=active,osgi.service;filter:="(objectClass=com.liferay.portal.kernel.service.UserLocalService)";effective:=active,osgi.service;filter:="(objectClass=com.liferay.portal.kernel.service.UserService)";effective:=active,osgi.service;filter:="(objectClass=com.liferay.portal.kernel.util.Http)";effective:=active,osgi.service;filter:="(objectClass=com.liferay.portal.kernel.util.Portal)";effective:=active,osgi.contract;osgi.contract=JavaServlet;filter:="(&(osgi.contract=JavaServlet)(version=3.1.0))",osgi.contract;osgi.contract=JavaPortlet;filter:="(&(osgi.contract=JavaPortlet)(version=3.0.0))",osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
 Service-Component = OSGI-INF/com.liferay.login.web.internal.portlet.FastLoginPortlet.xml,OSGI-INF/com.liferay.login.web.internal.portlet.LoginPortlet.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.CreateAccountMVCActionCommand.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.CreateAccountMVCRenderCommand.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.CreateAnonymousAccountMVCActionCommand.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.CreateAnonymousAccountMVCRenderCommand.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.ForgotPasswordMVCActionCommand.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.ForgotPasswordMVCRenderCommand.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.LoginConfigurationActionImpl.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.LoginMVCActionCommand.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.LoginMVCRenderCommand.xml,OSGI-INF/com.liferay.login.web.internal.portlet.action.LoginRedirectMVCRenderCommand.xml,OSGI-INF/com.liferay.login.web.internal.servlet.taglib.include.AnonymousNavigationPrePageInclude.xml,OSGI-INF/com.liferay.login.web.internal.servlet.taglib.include.CreateAccountNavigationPostPageInclude.xml,OSGI-INF/com.liferay.login.web.internal.servlet.taglib.include.ForgetPasswordNavigationPostPageInclude.xml,OSGI-INF/com.liferay.login.web.internal.servlet.taglib.include.SignInNavigationPrePageInclude.xml,OSGI-INF/com.liferay.login.web.internal.upgrade.LoginWebUpgrade.xml
 Tool = Bnd-4.3.0.201909301554
 Web-ContextPath = /login-web


g! headers 1242 | grep "Bundle-Version"


 Bundle-Version = 5.0.26
true


Now this is the gogoshell output for my own created Liferay Module Project Fragment test-login-fragment:

g! lb 

...
1369|Installed  |   15|test-login-fragment (1.0.0)|1.0.0

g! diag 1369


test.login.fragment [1369]
  Unresolved requirement: Fragment-Host: com.liferay.login.web; bundle-version="5.0.26"

g! headers 1369 | grep "Bundle-Version"


 Bundle-Version = 1.0.0
 Portal-Bundle-Version = 7.3.6

 

I cant see the error here. I have  Bundle-Version = 5.0.26 for "com.liferay.login.web" installed. 
And again: It works if I deploy through eclipse servers view add and remove. 
It does not work if I deploy via gradle deploy / dropping the built .jar file into the deploy folder.

thumbnail
Russell Bohl, modified 3 Years ago.

RE: RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6

Expert Posts: 291 Join Date: 2/13/13 Recent Posts

That is really perplexing.

What if you drop the fragment right into osgi/modules?

Also, what happens if you refresh the host after deploying the fragment?

refresh 1242

There should be a way to see what's attached to the host module as well, via Gogo shell. I'll look into that.

 

 

 

Uwe Peters, modified 3 Years ago.

RE: RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6

New Member Posts: 22 Join Date: 11/24/20 Recent Posts

Thanks for your reply, I could test you suggestions today and the refresh of the host module helps. 

For some reason this refresh is not triggered automatically. A normal gogo shell 'refresh' command does not help. I have to refresh the host module explicit. 

In the past I didnt have to do that...

How do I prevent this?
What if this happens in production?


 

Uwe Peters, modified 3 Years ago.

RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6ga7?

New Member Posts: 22 Join Date: 11/24/20 Recent Posts

Can anybody help me or at least confirm that this happens to others aswell? I am stucked now and I dont know if its my setting or not.

TL;DR version:

  • start a new 7.3.6ga7 CE Server 
  • create a Liferay Module Project Fragment with Liferay IDE (Version: 3.9.2.202103181004-ga3) for login (host = com.liferay.login.web) 
  • not working: deploy it via gradle or drag and drop the jar file into the bundles deploy server
    • nothing happens
    • in gogo shell the module is installed not resolved
    • how to get it working: trigger a refresh on the host module via gogo shell g! lb -s | grep "com.liferay.login.web" then refresh the id of com.liferay.login.web . The module then restarts and the new created one is resolved and working.
  • working: deploy the module via eclipse servers view 'add and remove' option
    • it restarts the login module and my new created one is resolved

I tried to build my project via my build pipeline (Gitlab CI) there my artifacts are copied into the deploy folder. All my Liferay Module Project Fragment are not working until I manually trigger a gogo shell refresh on the host modules.

 

thumbnail
Russell Bohl, modified 3 Years ago.

RE: RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6

Expert Posts: 291 Join Date: 2/13/13 Recent Posts

I can confirm that I have created a fragment for com.liferay.login.web on 7.3 DXP patched up to FP1, and using a Jar created by ./gradlew build, the fragment remains in the installed state and does not attach to the host module unless I manually refresh the host in the Gogo shell. I'll see if I can poke someone internally who might be able to confirm a bug or else tell us whether somethiong changed intentionally.

thumbnail
Russell Bohl, modified 3 Years ago.

RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6ga7? (Answer)

Expert Posts: 291 Join Date: 2/13/13 Recent Posts

I believe we're looking at a known regression bug. See LPS-129378

Stopping Liferay and deleting the osgi/state folder is mentioned as a workaround, though I'm not sure if that will create a persistent fix (so that subsequent redeploys will be picked up) or if it would need to be done every time, in which case you'd be better off accessing the Gogo shell and refreshing the host module.

I'll guess that this will make it into the next GA.

Uwe Peters, modified 3 Years ago.

RE: RE: Liferay Module Project Fragment not working via gralde deploy 7.3.6

New Member Posts: 22 Join Date: 11/24/20 Recent Posts

Thank you for the answer and thank you for 

I'll see if I can poke someone internally who might be able to confirm a bug or else tell us whether somethiong changed intentionally.

 I appreciate it!