RE: Liferay Workspace with java 11: osgi.ee=UNKNOWN

thumbnail
Philippe Thibault, modified 6 Years ago. Junior Member Posts: 46 Join Date: 9/11/12 Recent Posts
Hi,

I am trying to develop modules in Liferay Workspace for latest liferay portal liferay-ce-portal-7.1.2-ga3 using java 11.0.2 . Well I had to try with java 12 because there was ssl errors when fetching gradle dependencies with java 11 ... Anyway my problem here is that when I build my module the jar MANIFEST.MF gets created with an unknown java version in osgi.ee in Require-Capability:

osgi.ee;filter:="(osgi.ee=UNKNOWN)"

Deploying in liferay-ce-portal-7.1.2-ga3 I get this error :

org.osgi.framework.BundleException: Could not resolve module: blade_module [1011]_  
Unresolved requirement: Require-Capability: osgi.ee; filter:="(osgi.ee=UNKNOWN)"

Here is the complete MANIFEST.MF file :

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: blade_module
Bundle-SymbolicName: blade_module
Bundle-Version: 1.0.0
Created-By: 11.0.2 (Oracle Corporation)
Export-Package: blade_module.constants;version="1.0.0"
Import-Package: com.liferay.portal.kernel.portlet.bridges.mvc;version=
 "[1.6,2)",javax.portlet,javax.servlet;version="[3.0,4)",javax.servlet
 .http;version="[3.0,4)"
Javac-Debug: on
Javac-Deprecation: off
Javac-Encoding: UTF-8
Private-Package: blade_module.portlet,content
Provide-Capability: osgi.service;objectClass:List<string>="javax.portl
 et.Portlet",liferay.resource.bundle;bundle.symbolic.name=blade_module
 ;resource.bundle.base.name="content.Language"
Require-Capability: osgi.extender;filter:="(&amp;(osgi.extender=jsp.taglib
 )(uri=http://java.sun.com/portlet_2_0))",osgi.extender;filter:="(&amp;(os
 gi.extender=jsp.taglib)(uri=http://liferay.com/tld/aui))",osgi.extend
 er;filter:="(&amp;(osgi.extender=jsp.taglib)(uri=http://liferay.com/tld/p
 ortlet))",osgi.extender;filter:="(&amp;(osgi.extender=jsp.taglib)(uri=htt
 p://liferay.com/tld/theme))",osgi.extender;filter:="(&amp;(osgi.extender=
 jsp.taglib)(uri=http://liferay.com/tld/ui))",osgi.extender;filter:="(
 &amp;(osgi.extender=osgi.component)(version&gt;=1.3.0)(!(version&gt;=2.0.0)))",
 osgi.contract;osgi.contract=JavaPortlet;filter:="(&amp;(osgi.contract=Jav
 aPortlet)(version=3.0.0))",osgi.ee;filter:="(osgi.ee=UNKNOWN)"
Service-Component: OSGI-INF/blade_module.portlet.Blade_modulePortlet.x
 ml
Tool: Bnd-3.5.0.201709291849</string>

thanks for your help!
thumbnail
Gregory Amerson, modified 6 Years ago. Liferay Legend Posts: 1123 Join Date: 2/16/10 Recent Posts
Thanks for your report.  I've replicated your issue and created a ticket here:  https://issues.liferay.com/browse/LPS-93643

My first guess is that its because our bndlib version is too old in our gradle plugin, but I'm not for sure.  It will require more investigation.
thumbnail
Gregory Amerson, modified 6 Years ago. Liferay Legend Posts: 1123 Join Date: 2/16/10 Recent Posts
Looks like there is a workaround if you are willing to remove some of the protections created by bnd when building the bundle.

In your bnd.bnd you can tell bnd to not emit a requirement for your execution environment with
-noee: true
Then there will not be any osgi.ee filter placed in the require-capability header.  In the future, we will update our gradle plugins to include a newer version of bndlib (currently we are using 3.5)
thumbnail
Philippe Thibault, modified 6 Years ago. Junior Member Posts: 46 Join Date: 9/11/12 Recent Posts
Thanks for the workaround with it I can build and deploy with jdk11! I will wait for a new workspace release with updated bnd.