Liferay 6.2 启动失败,出现 500 错误

Posted

技术标签:

【中文标题】Liferay 6.2 启动失败,出现 500 错误【英文标题】:Liferay 6.2 failed on startup with 500 error 【发布时间】:2021-05-18 20:43:23 【问题描述】:

我正在开始一个新下载的 Liferay 6.2 tomcat 捆绑包,但发生了这个异常:

 EVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [java.lang.ArrayIndexOutOfBoundsException: 0] with root cause
java.lang.ArrayIndexOutOfBoundsException: 0
    at com.liferay.portal.util.PortalInstances._getDefaultCompanyId(PortalInstances.java:344)
    at com.liferay.portal.util.PortalInstances.getDefaultCompanyId(PortalInstances.java:83)
    at com.liferay.portal.util.PortalImpl.getDefaultCompanyId(PortalImpl.java:1897)
    at com.liferay.portal.util.PortalUtil.getDefaultCompanyId(PortalUtil.java:515)
    at com.liferay.portal.servlet.filters.validhostname.ValidHostNameFilter.doFilterTry(ValidHostNameFilter.java:38)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:183)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)


WARN  [http-bio-8080-exec-1][code_jsp:?] code="500", msg="", uri=/
javax.servlet.ServletException: java.lang.ArrayIndexOutOfBoundsException: 0
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

请注意,我保留默认配置,我使用的是 Liferay 6.2 CE GA3 和 Java 1.8.0_251。

能给我一些帮助吗?

谢谢

【问题讨论】:

您可能在 Liferay 社区网站上运气更好——这个问题与编程无关,而是与您下载并启动的软件(顺便说一句,相当过时)有关。 *** 的重点是您自己的编程问题(请参阅help center)。如果您有任何理由加入 6.2 CE,您应该加入GA6 with the patch。在过时的软件中寻找错误是毫无意义的。 6.2 GA3 于 2015 年 1 月发布。 【参考方案1】:

安装JDK 8u251 解决了这个问题。

【讨论】:

以上是关于Liferay 6.2 启动失败,出现 500 错误的主要内容,如果未能解决你的问题,请参考以下文章

在 liferay 6.2 中自定义停靠栏

Intellij Idea Liferay 6.2 服务器

CSS 文件中的背景图像路径 - Liferay 6.2

Liferay 6.2 布局不同大小的行

覆盖特定类 PwdEncryptor liferay 6.2

Liferay 6.2 自定义连接具有相同名称的列重叠