Closed mikke-alekstra closed 1 year ago
This is follow-up to https://github.com/vaadin/framework/issues/12569
Vaadin 8.19-SNAPSHOT as bnd.bnd to vaadin-portlet and it should be used as OSGi module now.
At PortletUIServiceTrackerCustomizer.java:114 there is "new OsgiVaadinPortlet()". Something goes wrong with OSGi, as based on the stacktrace Osgi class loader fails to find VaadinPortlet.
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:151) ~[org.eclipse.osgi.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
at com.vaadin.osgi.liferay.PortletUIServiceTrackerCustomizer.registerPortlet(PortletUIServiceTrackerCustomizer.java:114) ~[?:?]
So to me the problem looks like that vaadin-portlet is not activated yet. Did you start it with blade before vaadin-liferay-integration?
We found a typo in bnd.bnd, which may explain the problem. We will release 8.19.1 soon, which hopefully has correctly formed bnd.bnd.
Thanks for the info, Tatu.
I just re-tested my test Liferay portlet in 7.4.3.22 / 8.17.0 and the portlet appeared fine. I then moved to 7.4.3.22 / 8.19-SNAPSHOT and got the VaadinPortlet class not found error. The test portlets are exactly the same except for Vaadin version and dependency addition for vaadin-portlet in pom.xml.
I will test more with 8.19.1 (or 8.19-SNAPSHOT) when available.
I made some tests in my Liferay+Vaadin test bench and I think I got latest Liferay version (7.4.3.60) to work with latest Vaadin 8 version (8.19.0) by customizing vaadin-portlet and vaadin-liferay-integration.
I downloaded the sources for the two above libraries and made the following modifications:
vaadin-portlet
vaadin-liferay-integration
Thanks for your effort and good input. This finding is aligned with our own analysis.
I'm making these modifications to Vaadin 8; I'll give you an extra update once a new 8.20 snapshot is available so that you can verify that the modifications work for you as well. Since these changes necessitate code changes for users, the next Vaadin version released will be 8.20.0.
Hi, @mikke-alekstra I've been unable to reach you through Expert Chat; could you try the latest 8.20-SNAPSHOT to check if deployment works?
Hi, @thevaadinman. You can reach me now in Expert Chat. Vaadin-portlet does not start probably because there is a typo in the manifest.
com.liferay.portal.kernel;resultion:=optional;version="[7.0.0,93.0.0)"
@mikke-alekstra.. yes, of course a typo managed to sneak its way into the commit. :) The typo has been fixed and a new snapshot build was triggered. It should now be available.
@thevaadinman no luck. The problem might relate to vaadin-portlet.jar that contains com.vaadin.server stuff. When I tested this I had only com.vaadin.portlet classes in vaadin-portlet.jar. All com.vaadin.server classes were taken from vaadin-server.jar.
ERROR: Unable to start bundle: file:/home/tomcat/liferay-ce-portal-7.4.3.60-ga60/osgi/modules/vaadin-liferay-integration-8.20-20230214.140030-7.jar
com.liferay.portal.kernel.log.LogSanitizerException: org.osgi.framework.BundleException: Could not resolve module: com.vaadin.liferay.integration [1697]_ Bundle was not resolved because of a uses contraint violation._ org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource com.vaadin.liferay.integration [osgi.identity; osgi.identity="com.vaadin.liferay.integration"; type="osgi.bundle"; version:Version="8.20.0"] because it is exposed to package 'com.vaadin.server' from resources com.vaadin.portlet [osgi.identity; osgi.identity="com.vaadin.portlet"; type="osgi.bundle"; version:Version="8.20.0"] and com.vaadin.server [osgi.identity; osgi.identity="com.vaadin.server"; type="osgi.bundle"; version:Version="8.20.0"] via two dependency chains.__Chain 1:_ com.vaadin.liferay.integration [osgi.identity; osgi.identity="com.vaadin.liferay.integration"; type="osgi.bundle"; version:Version="8.20.0"]_ import: (&(osgi.wiring.package=com.vaadin.server)(&(version>=8.20.0)(version<=8.20.0)))_ |_ export: osgi.wiring.package: com.vaadin.server_ com.vaadin.portlet [osgi.identity; osgi.identity="com.vaadin.portlet"; type="osgi.bundle"; version:Version="8.20.0"]__Chain 2:_ com.vaadin.liferay.integration [osgi.identity; osgi.identity="com.vaadin.liferay.integration"; type="osgi.bundle"; version:Version="8.20.0"]_ import: (&(osgi.wiring.package=com.vaadin.ui)(&(version>=8.20.0)(version<=8.20.0)))_ |_ export: osgi.wiring.package: com.vaadin.ui; uses:=com.vaadin.server_ export: osgi.wiring.package=com.vaadin.server_ com.vaadin.server [osgi.identity; osgi.identity="com.vaadin.server"; type="osgi.bundle"; version:Version="8.20.0"] [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428) ~[org.eclipse.osgi.jar:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._startBundle(DirectoryWatcher.java:1156) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._startBundles(DirectoryWatcher.java:1189) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._process(DirectoryWatcher.java:1046) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher.run(DirectoryWatcher.java:247) [bundleFile:?]
Then there's something still going wrong with the packaging, as the actual portlet
subproject contains no com.vaadin.server
classes.
Ok, I've tweaked the build and manifest a bit and confirmed that vaadin-portlet
package no longer contains any com.vaadin.server
classes. Latest 8.20-SNAPSHOT should be live.
It went further but when deploying my Vaadin widgetset library I got the error
java.lang.ClassNotFoundException: com.vaadin.osgi.resources.OsgiVaadinWidgetset
Noticed that my library tries to access com.vaadin.osgi.resources classes from vaadin-portlet because vaadin-portlet exports that package (there are no such classes in vaadin-portlet). This probably is an unnecessary export. Could you try to remove com.vaadin.osgi.resources from vaadin-portlet export packages?
Here is a part from current vaadin-portlet manifest:
Export-Package: com.vaadin.portlet;uses:="com.vaadin.server,javax.port
let,javax.portlet.filter";version="8.20.0",com.vaadin.portlet.communi
cation;uses:="com.vaadin.server,com.vaadin.server.communication";vers
ion="8.20.0",com.vaadin.osgi.resources;version="8.20.0"
I suspect you're correct, it appears to be an accidental holdover.
New snapshot has been released.
It is getting closer. When I deploy a portlet I get
ClassNotFoundException: com.vaadin.util.CurrentInstance cannot be found by com.vaadin.portlet_8.20.0
I think you should add (at least) com.vaadin.util to vaadin-portlet's Import Packages. Probably also com.vaadin.ui, com.vaadin.shared.util (not sure but there is an import from there in vaadin-portlet source code).
@mikke-alekstra, I tweaked the imports to include com.vaadin.util, com.vaadin.ui and com.vaadin.shared. New build is live, give it a try.
It went further again. Unfortunately
ClassNotFoundException: javax.servlet.http.HttpServletRequest cannot be found by com.vaadin.portlet_8.20.0
We probably need these four more imports as there packages are imported in vaadin-portlet's java code: elemental.json javax.servlet.http javax.xml.namespace org.w3c.dom
@mikke-alekstra, imports added, new snapshot build is live.
@thevaadinman, thank you!
After some initial tests I am successfully running a few weeks old Liferay 7.4.3.60-ga60 release with current Vaadin 8.20-SNAPSHOT. Liferay started well, there are no Vaadin errors in startup and after a few random tests portlets function well, producing no errors.
@mikke-alekstra thank you for your patience and assistance in getting this tweaked! I'll roll this into the upcoming Vaadin 8.20.0.
I've understood that a gift is about to be sent your way. :)
You are welcome and thanks! I will keep this snapshot running in our lab switch over to 8.20.0 as soon as it is released.
8.20.0 release is in progress; closing ticket. If problems persist, open another ticket. :)
Quick tested with official 8.20.0. Still looking good.
Liferay 7.4.3.22 Vaadin 8.19-SNAPSHOT vaadin-compatibility-client-compiled-8.19-20230105.135656-11.jar vaadin-compatibility-server-8.19-20230105.135536-12.jar vaadin-compatibility-shared-8.19-20230105.135446-12.jar vaadin-compatibility-themes-8.19-20230105.135708-11.jar vaadin-liferay-integration-8.19-20230105.135714-11.jar vaadin-osgi-integration-8.19-20230105.135718-11.jar vaadin-portlet-8.19-20230105.135304-12.jar vaadin-server-8.19-20230105.135253-12.jar vaadin-shared-8.19-20230105.135044-12.jar vaadin-themes-8.19-20230105.135438-12.jar
After deploying a portlet I get an error java.lang.NoClassDefFoundError: com/vaadin/server/VaadinPortlet
Please find attached the stack trace stack_trace.txt
Bundle information for vaadin-portlet
For reference I copied bundle information for vaadin-liferay-integration, too