Magnolia 未在 Vanilla Tomcat 服务器上启动 [重复]

Posted

技术标签:

【中文标题】Magnolia 未在 Vanilla Tomcat 服务器上启动 [重复]【英文标题】:Magnolia not starting on Vanilla Tomcat Server [duplicate] 【发布时间】:2021-03-29 19:29:44 【问题描述】:

所以,我认为这可能是一个微不足道的问题,但目前不知所措。

我在 Ubuntu (tomcat-10.0.4) 上创建了一个普通的 Tomcat 服务器。

它被配置为在port 80 上运行,我可以看到 Tomcat 管理器正常。

Java 已安装

apt install default-jdk -y

Tomcat 在其自己的用户 (tomcat) 下运行,对其安装文件夹 (/opt/tomcat) 拥有完全权限

chown tomcat: -R /opt/tomcat/

Magnolia 已下载 (magnolia-dx-core-demo-webapp-6.2.6.war)

war 文件被重命名为 magnoliaAuthor.war,并且 tomcat 用户成为了文件的所有者。

当移动到 webapps 文件夹时,war 文件会自动解压缩。

ls -li 命令产生:

1283171 drwxr-x---  6 tomcat tomcat      4096 Mar 29 15:12 magnoliaAuthor
 256320 -rw-r-----  1 tomcat tomcat 486185464 Jan 27 17:37 magnoliaAuthor.war

到目前为止一切顺利。但在 Tomcat Web 应用程序管理器中,我看到应用程序没有运行。我单击Start,应用程序无法启动,仅显示以下消息:

FAIL - Application at context path [/magnoliaAuthor] could not be started

日志没有帮助。

manager.*.log

29-Mar-2021 18:30:07.589 INFO [http-nio-80-exec-20] org.apache.catalina.core.ApplicationContext.log htmlManager: start: Starting web application '/magnoliaAuthor'
29-Mar-2021 18:30:17.016 INFO [http-nio-80-exec-20] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host 'localhost'

localhost_access_log.*.txt

[29/Mar/2021:18:29:59 +0000] "GET /magnoliaAuthor/ HTTP/1.1" 404 770
tomcat [29/Mar/2021:18:30:17 +0000] "POST /manager/html/start?path=/magnoliaAuthor&org.apache.catalina.filters.CSRF_NONCE=A78549F3B45386757080EA3D1CDBDD4A HTTP/1.1" 200 17747

localhost.*.log

29-Mar-2021 18:29:43.278 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [info.magnolia.init.MagnoliaServletContextListener]
        java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
                at java.base/java.lang.ClassLoader.defineClass1(Native Method)
                at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
                at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
...
        Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1224)
                ... 38 more
29-Mar-2021 18:29:43.278 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.listenerStart Skipped installing application listeners due to previous error(s)
29-Mar-2021 18:30:17.007 SEVERE [http-nio-80-exec-20] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [info.magnolia.init.MagnoliaServletContextListener]
        java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
                at java.base/java.lang.ClassLoader.defineClass1(Native Method)
                at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
...
        Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1401)
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1224)
                ... 46 more
29-Mar-2021 18:30:17.007 SEVERE [http-nio-80-exec-20] org.apache.catalina.core.StandardContext.listenerStart Skipped installing application listeners due to previous error(s)

catalina.out

29-Mar-2021 18:29:31.155 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/magnoliaAuthor.war]
29-Mar-2021 18:29:43.275 INFO [Catalina-utility-2] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list$29-Mar-2021 18:29:43.278 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
29-Mar-2021 18:29:43.278 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.startInternal Context [/magnoliaAuthor] startup failed due to previous errors
29-Mar-2021 18:29:43.287 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/magnoliaAuthor.war] has finished in [12,132] ms         29-Mar-2021 18:30:17.004 INFO [http-nio-80-exec-20] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete lis$29-Mar-2021 18:30:17.007 SEVERE [http-nio-80-exec-20] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
29-Mar-2021 18:30:17.009 SEVERE [http-nio-80-exec-20] org.apache.catalina.core.StandardContext.startInternal Context [/magnoliaAuthor] startup failed due to previous errors

catalina.*.log

29-Mar-2021 18:29:31.155 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/magnoliaAuthor.war]                                         29-Mar-2021 18:29:43.275 INFO [Catalina-utility-2] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list$29-Mar-2021 18:29:43.278 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
29-Mar-2021 18:29:43.278 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.startInternal Context [/magnoliaAuthor] startup failed due to previous errors                                            29-Mar-2021 18:29:43.287 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/magnoliaAuthor.war] has finished in [12,132] ms
29-Mar-2021 18:30:17.004 INFO [http-nio-80-exec-20] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete lis$29-Mar-2021 18:30:17.007 SEVERE [http-nio-80-exec-20] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
29-Mar-2021 18:30:17.009 SEVERE [http-nio-80-exec-20] org.apache.catalina.core.StandardContext.startInternal Context [/magnoliaAuthor] startup failed due to previous errors

根据上述信息,我没有看到任何可以为我指明正确方向的东西。

【问题讨论】:

【参考方案1】:

正如评论中所指出的,Magnolia 目前与 Jakarta EE 9 不兼容。您可以通过MAGNOLIA-8041关注该问题的进展

【讨论】:

作为一种解决方法,可以使用Tomcat Migration Tool for Jakarta EE

以上是关于Magnolia 未在 Vanilla Tomcat 服务器上启动 [重复]的主要内容,如果未能解决你的问题,请参考以下文章

Magnolia CkEditor InternalLink 未在工具栏中列出

营销标签未在 Magnolia 页面中呈现内容

Magnolia 模块不包括代码更改

Magnolia 原型无法解析 info.magnolia.ui:magnolia-ui-project:pom:5.3

❲Vanilla技巧❳Vanilla(OpenResty)实现的Restful

Magnolia 激活模块(5.2.3 版)确保 Magnolia 属性文件中存在密钥属性“magnolia.author.key.location”