Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Issues when upgrade to Java 17 or Java 21
Hello,
I have the last Liferay 7.4.3.129 CE GA129 in Java 11 and all is
working.
But when I try to run it with a Java 17 or Java 21, I
have this error when the site template is updating a site :
Caused by: org.jabsorb.serializer.MarshallException: map key
timezone Unable to match field rawOffset
at org.jabsorb.serializer.impl.MapSerializer.marshall(MapSerializer.java:134) ~[jabsorb.jar:?]
at org.jabsorb.JSONSerializer.marshall(JSONSerializer.java:390) ~[jabsorb.jar:?]
at org.jabsorb.JSONSerializer.toJSON(JSONSerializer.java:516) ~[jabsorb.jar:?]
at com.liferay.portal.json.JSONFactoryImpl.serialize(JSONFactoryImpl.java:290) ~[portal-impl.jar:?]
at com.liferay.portal.kernel.json.JSONFactoryUtil.serialize(JSONFactoryUtil.java:131) ~[portal-kernel.jar:?]
at com.liferay.portlet.exportimport.service.impl.ExportImportConfigurationLocalServiceImpl.addExportImportConfiguration(ExportImportConfigurationLocalServiceImpl.java:110) ~[portal-impl.jar:?]
...
2025-01-11 13:47:10.944 ERROR [http-nio-8080-exec-6][CTCollectionPreviewFilter:55] com.liferay.portal.kernel.exception.SystemException: java.lang.IllegalStateException: Unable to serialize object
com.liferay.portal.kernel.exception.SystemException: java.lang.IllegalStateException: Unable to serialize object
I try to add JVM options in "setenv.bat" but I didn't find
a way to solve this error... it is the same with previous
versions.
For the moment I can not upgrade my Liferay in Java 17
or Java 21... I am stucked in Java 11 !
Thanks for you help,
Eric.
I answer to my own question... with this new version it seems OK when
I lanch Liferay with the "startup.bat".
The problem was with the Liferay IDE.
You need to be sure to
have all of those arguments :
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=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.net.www.protocol.https=ALL-UNNAMED
--add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED
And for me the bold argument was missing (and not only).
Eric.