Magnolia 未在 Vanilla Tomcat 服务器上启动
Magnolia not starting on Vanilla Tomcat Server
所以,我认为这可能是一个微不足道的问题,但我目前不知所措。
我在 Ubuntu (tomcat-10.0.4
) 上创建了一个香草 Tomcat 服务器。
它在 port 80
上配置为 运行,我可以看到 Tomcat 管理器正常。
Java 已安装
apt install default-jdk -y
Tomcat 运行s 在其自己的用户 (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 应用程序管理器中我看到应用程序不是 运行ning。我单击 Start
,应用程序启动失败,仅显示以下消息:
FAIL - Application at context path [/magnoliaAuthor] could not be started
日志没有帮助。
经理.*.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-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-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-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-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
根据以上信息,我没有看到任何指向正确方向的信息。
正如评论中所指出的,Magnolia 目前与 Jakarta EE 9 不兼容。您可以在 MAGNOLIA-8041
关注该问题的进展
所以,我认为这可能是一个微不足道的问题,但我目前不知所措。
我在 Ubuntu (tomcat-10.0.4
) 上创建了一个香草 Tomcat 服务器。
它在 port 80
上配置为 运行,我可以看到 Tomcat 管理器正常。
Java 已安装
apt install default-jdk -y
Tomcat 运行s 在其自己的用户 (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 应用程序管理器中我看到应用程序不是 运行ning。我单击 Start
,应用程序启动失败,仅显示以下消息:
FAIL - Application at context path [/magnoliaAuthor] could not be started
日志没有帮助。
经理.*.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-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-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-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-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
根据以上信息,我没有看到任何指向正确方向的信息。
正如评论中所指出的,Magnolia 目前与 Jakarta EE 9 不兼容。您可以在 MAGNOLIA-8041
关注该问题的进展