Details

      Description

      Liferay does not start in Jdk 17.

       

      initially its throwing exception,

      Caused by: java.lang.ExceptionInInitializerError
              at com.liferay.portal.asm.ASMWrapperUtil.<clinit>(ASMWrapperUtil.java:277)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:568)
              at deployment.portal.war//com.liferay.shielded.container.internal.proxy.ProxyFactory.createASMWrapper(ProxyFactory.java:51)
              at deployment.portal.war//com.liferay.shielded.container.internal.ShieldedContainerServletContainerInitializer.onStartup(ShieldedContainerServletContainerInitializer.java:59)
              
      Caused by: java.lang.ExceptionInInitializerError
              at com.liferay.petra.reflect.ReflectionUtil.<clinit>(ReflectionUtil.java:162)
              at com.liferay.portal.asm.ASMWrapperUtil.<clinit>(ASMWrapperUtil.java:266)
              ... 26 more
      Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @48191aa4
              at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
              at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
              at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
              at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
              at com.liferay.petra.reflect.ReflectionUtil.<clinit>(ReflectionUtil.java:155)
      

       

      Then i added jvm-option to workaround the error,

      --add-opens java.base/java.lang=ALL-UNNAMED
      

       

      After adding the jvm-option its throwing a new exception, 

      Caused by: java.lang.ExceptionInInitializerError
          at com.liferay.portal.asm.ASMWrapperUtil.<clinit>(ASMWrapperUtil.java:277)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      
      Caused by: java.lang.ExceptionInInitializerError
          at com.liferay.petra.reflect.ReflectionUtil.<clinit>(ReflectionUtil.java:162)
          at com.liferay.portal.asm.ASMWrapperUtil.<clinit>(ASMWrapperUtil.java:266)
          ... 26 more
      Caused by: java.lang.NoSuchFieldException: modifiers
          at java.base/java.lang.Class.getDeclaredField(Class.java:2610)
          at com.liferay.petra.reflect.ReflectionUtil.<clinit>(ReflectionUtil.java:157)
          ... 27 more
      

       

      Seems its because of  csr https://bugs.openjdk.java.net/browse/JDK-8210522 implemented in java-12. This CSR hides fields from a number of sensitive classes in java.lang.reflect and java.lang.invoke packages.

       

       

       

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              jjohn Jishin John
              Participants of an Issue:
              Recent user:
              Summer Zhang
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Days since last comment:
                1 week, 1 day ago

                  Packages

                  Version Package