Liferay DXP 7.2监听器启动失败(干净版)

Liferay DXP 7.2 listeners failed to start (clean version)

Liferay DXP 7.2 无法使用 OpenJDK 启动(干净版)。没有使用任何 IDE,它是 Windows Server 2016 版本(不要认为服务器版本会有任何问题)刚刚在 E:\PROJECT_NAME\liferay-dxp-tomcat-7.2.10.1-sp1-slim-20191009103614075\liferay-dxp-7.2.10.1-sp1\tomcat-9.0.17\bin 下启动 startup.bat。检查环境变量 (JAVA_HOME:C:\openjdk-13.0.1_windows-x64_bin\jdk-13.0.1)。似乎缺少任何依赖项或配置。需要帮助。

22-Nov-2019 09:43:37.490 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1,281] milliseconds
Loading jar:file:/E:/PROJECT_NAME/liferay-dxp-tomcat-7.2.10.1-sp1-slim-20191009103614075/liferay-dxp-7.2.10.1-sp1/tomcat-9.0.17/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
22-Nov-2019 09:43:40.912 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [com.liferay.portal.spring.context.PortalContextLoaderListener]
 java.lang.ExceptionInInitializerError
        at com.liferay.petra.reflect.ReflectionUtil.<clinit>(ReflectionUtil.java:162)
        at com.liferay.portal.spring.context.PortalContextLoaderListener.<clinit>(PortalContextLoaderListener.java:460)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:151)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4604)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5150)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:631)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1832)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:526)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:425)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1577)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:929)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:423)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:928)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:634)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: java.lang.NoSuchFieldException: modifiers
        at java.base/java.lang.Class.getDeclaredField(Class.java:2412)
        at com.liferay.petra.reflect.ReflectionUtil.<clinit>(ReflectionUtil.java:157)
        ... 48 more```


如果您查看 Liferay DXP compatibility matrix,您会发现 Java 13 不在那里 - 只有 LTS 版本。 运行 用一个兼容的版本来消除这个问题。请注意,仅支持经 TCK 认证的 OpenJDK 构建,您可能希望在版本之上验证这一点。

错误是由于 JDK 设置不兼容造成的。所以需要改成compatible JDK。 例如:JDK8 适用于 liferay-ce-portal-tomcat-7.2.1-ga2.

在Windows中: 将 JAVA_HOME 设置为 JDK 文件夹路径,将 PATH 设置为 JDK/bin 文件夹路径。 通过打开新的命令行 window 重新启动 tomcat 它应该可以工作。