liferay / liferay-intellij-plugin

Other
24 stars 30 forks source link

Liferay 2024.q2.12 doesn't start with JDK 17 #308

Open Elinvention opened 3 weeks ago

Elinvention commented 3 weeks ago

I have a working liferay dxp-2024.q2.12 bundle that I can start with blade CLI via blade server start.

If I start the server via this plugin, instead, I get exceptions about missing opens. I can fix this issue by adding several arguments to VM options: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED.

Now I get repeated exceptions launched by sidecar being unable to launch Elastic, again due to missing opens:

java.util.concurrent.ExecutionException: com.liferay.petra.process.ProcessException: Unable to load modified classes
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
    at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
    at com.liferay.portal.search.elasticsearch7.internal.sidecar.Sidecar$RestartFutureListener.complete(Sidecar.java:614) [bundleFile:?]
    at com.liferay.petra.concurrent.DefaultNoticeableFuture$OnceFutureListener.complete(DefaultNoticeableFuture.java:102) [com.liferay.petra.concurrent.jar:?]
    at com.liferay.petra.concurrent.DefaultNoticeableFuture.done(DefaultNoticeableFuture.java:76) [com.liferay.petra.concurrent.jar:?]
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381) [?:?]
    at java.util.concurrent.FutureTask.setException(FutureTask.java:250) [?:?]
    at com.liferay.petra.concurrent.DefaultNoticeableFuture.setException(DefaultNoticeableFuture.java:70) [com.liferay.petra.concurrent.jar:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:269) [?:?]
    at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: com.liferay.petra.process.ProcessException: Unable to load modified classes
    at com.liferay.portal.search.elasticsearch7.internal.sidecar.SidecarMainProcessCallable._loadModifiedClasses(SidecarMainProcessCallable.java:69) ~[?:?]
    at com.liferay.portal.search.elasticsearch7.internal.sidecar.SidecarMainProcessCallable.call(SidecarMainProcessCallable.java:42) ~[?:?]
    at com.liferay.petra.process.local.LocalProcessLauncher.main(LocalProcessLauncher.java:126) ~[com.liferay.petra.process.jar:?]
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @4f8e5cde
    at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) ~[?:?]
    at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[?:?]
    at java.lang.reflect.Method.checkCanSetAccessible(Method.java:200) ~[?:?]
    at java.lang.reflect.Method.setAccessible(Method.java:194) ~[?:?]
    at com.liferay.petra.reflect.ReflectionUtil.getDeclaredMethod(ReflectionUtil.java:48) ~[com.liferay.petra.reflect.jar:?]
    at com.liferay.portal.search.elasticsearch7.internal.sidecar.SidecarMainProcessCallable._loadModifiedClasses(SidecarMainProcessCallable.java:54) ~[?:?]
    at com.liferay.portal.search.elasticsearch7.internal.sidecar.SidecarMainProcessCallable.call(SidecarMainProcessCallable.java:42) ~[?:?]
    at com.liferay.petra.process.local.LocalProcessLauncher.main(LocalProcessLauncher.java:126) ~[com.liferay.petra.process.jar:?]

For some reason those arguments are not passed down to elastic, hence it can't start.