# Liferay 7.4.3-ga123 - Java 21 in a JSF-Portlet

**URL:** <https://discuss.liferay.com/t/liferay-7-4-3-ga123-java-21-in-a-jsf-portlet/539>\
**Category:** JSP, JSF, Spring, etc.\
**Created:** [April 20, 2026, 10:39pm UTC](https://discuss.liferay.com/t/liferay-7-4-3-ga123-java-21-in-a-jsf-portlet/539 "2026-04-20T22:39:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Rodriguez](https://dub1.discourse-cdn.com/flex014/user_avatar/discuss.liferay.com/adrian_rodriguez/32/631_2.png) [@Adrian\_Rodriguez](https://discuss.liferay.com/u/Adrian_Rodriguez)\
**Post date:** [April 20, 2026, 10:39pm UTC](https://discuss.liferay.com/t/liferay-7-4-3-ga123-java-21-in-a-jsf-portlet/539/1 "2026-04-20T22:39:04Z")

</div>

Hello,

I am trying to use Java 21 in a JSF-Portlet in Liferay Portal 7.4.3 ga 132. I am basing my development on this project, which uses PrimeFaces 11: [liferay-faces-bridge-impl/demo/primefaces-applicant-portlet at 6.0.0 · liferay/liferay-faces-bridge-impl · GitHub](https://github.com/liferay/liferay-faces-bridge-impl/tree/6.0.0/demo/primefaces-applicant-portlet)

I am getting this exception during the thin-Wab deployment because the Version 7.1 of ASM which is included with org.apache.aries.spifly.dynamic.framework.extension does not support Java 21.

`FrameworkEvent ERROR`  
`java.lang.IllegalArgumentException: Unsupported class file major version 65`  
`at org.objectweb.asm.ClassReader.(ClassReader.java:195) ~[bundleFile:1.2.3]`  
`at org.objectweb.asm.ClassReader.(ClassReader.java:176) ~[bundleFile:1.2.3]`  
`at org.objectweb.asm.ClassReader.(ClassReader.java:162) ~[bundleFile:1.2.3]`  
`at org.objectweb.asm.ClassReader.(ClassReader.java:283) ~[bundleFile:1.2.3]`  
`at org.apache.aries.spifly.dynamic.OSGiFriendlyClassWriter._getSuperClassName(OSGiFriendlyClassWriter.java:116)`

I tried to substitute osgi/static/org.apache.aries.spifly.dynamic.framework.extension.jar, which is the version 1.2.3-LIFERAY-PATCHED-3 with the version 1.2.3-LIFERAY-PATCHED-4. But with this change, Liferay does not even start. Here is an excerpt of the causes:

```auto
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.asset.kernel.service.persistence.AssetTagPersistence' defined in class path resource [META-INF/portal-spring.xml]: Invocation of init method failed; ...

Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(org.eclipse.osgi.internal.framework.BundleContextImpl, String[], Object, java.util.Dictionary)" because the return value of "org.eclipse.osgi.internal.framework.EquinoxContainer.getServiceRegistry()" is null

Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.notifyHooksPrivileged(org.eclipse.osgi.internal.serviceregistry.HookContext)" because the return value of "org.eclipse.osgi.internal.framework.EquinoxContainer.getServiceRegistry()" is null

	at org.eclipse.osgi.internal.framework.BundleContextImpl.notifyFindHooksPriviledged(BundleContextImpl.java:216) ~[org.eclipse.osgi.jar:?]

```

Is there a way to use Java 21 in a JSF Portlet

Here is someone which is also having problems with a JSF Portlet: [jdk 21 - liferay 7.4 and new faces](https://discuss.liferay.com/t/jdk-21-liferay-7-4-and-new-faces/201)

---

<div class="post-metadata">

**Author:** ![dnebing](https://dub1.discourse-cdn.com/flex014/user_avatar/discuss.liferay.com/dnebing/32/24_2.png) [@dnebing](https://discuss.liferay.com/u/dnebing)\
**Post date:** [April 21, 2026, 3:31pm UTC](https://discuss.liferay.com/t/liferay-7-4-3-ga123-java-21-in-a-jsf-portlet/539/2 "2026-04-21T15:31:24Z")

</div>

> [@Adrian\_Rodriguez](#):
>
> java.lang.IllegalArgumentException: Unsupported class file major version 65

This means you have compiled code using JDK 21, but you’re not using a JDK 21 runtime, you’re using something older.

Liferay requires JDK 21 for 7.4 ga 132+, so you will need to update all your dependencies (including ASM) to use JDK 21.

This is not optional, you won’t be able to use an older JDK.
