core icon indicating copy to clipboard operation
core copied to clipboard

Identify any issues with Plugin development in Java 21 and strategy for Customers to update

Open spbolton opened this issue 1 year ago • 1 comments

spbolton avatar Mar 18 '24 13:03 spbolton

Note: I updated plugin examples to use maven/java 11 in this branch: https://github.com/dotCMS/plugin-seeds/tree/release-23.10.24-maven

swicken avatar Jun 18 '24 18:06 swicken

I created a branch introducing a parent pom to simplify the building process. https://github.com/dotCMS/plugin-seeds/pull/97/files

They all compile with no problem, whatsoever.
I tried deploying them in the demo server (compiled in Java 11); some are currently broken. I also tried deploying them in my local Tomcat compiling them in Java 21.

The following are the Broken plugin examples And their status compared they status in demo vs my local environment running Java 21

Name Exception Note
com.dotcms.osgi-portlets-example Unresolved requirements: [[com.dotcms.osgi-portlets-example [8](R 8.0)] osgi.wiring.package; (osgi.wiring.package=com.dotcms.repackage.javax.portlet)
visitor-ip-conditionlet-0.2 osgi.wiring.package=com.dotcms.repackage.com.google.common.base)] Works fine in demo
override-class-example-0.2 Caused by: java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the schema (add/remove fields) at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method) at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:6325) at com.dotmarketing.osgi.GenericBundleActivator.overrideClass(GenericBundleActivator.java:333) Also Broken in demo
com.dotcms.osgi-pp-event-listener-example java.lang.NoClassDefFoundError: com/dotcms/pushpublish/listener/AddToQueueSubscriber Works fine on demo but broken locally
app-and-secrets-example-0.3.jar Unresolved requirements: [[com.dotcms.app.and-secrets-example [23](R 23.0)] osgi.wiring.package; (&(osgi.wiring.package=com.fasterxml.jackson.databind.annotation)(version>=2.4.0)(!(version>=3.0.0)))] Also Broken in demo
osgi-third-party-lib-example ClassNotFoundException: hirondelle.date4j.DateTime not found by com.dotcms.osgi-third-party-lib-example [26] at com.dotmarketing.osgi.external.Examples.currentDateTime(Examples.java:40) ~[?:?] Also Broken in demo

All in all, I don't think it'll be too difficult to migrate these to Java 25 it looks like we still have some old repackage.javax dependencies here and there to clean up @spbolton

fabrizzio-dotCMS avatar Jul 05 '24 17:07 fabrizzio-dotCMS