So, I think this might be a trivial problem but am currently at a loss.
I created a vanilla Tomcat server on Ubuntu (tomcat-10.0.4
).
It is configured to run on port 80
and I can see the Tomcat Manager fine.
Java has been installed
apt install default-jdk -y
Tomcat runs under its own user (tomcat
) with full rights to its installation folder (/opt/tomcat
)
chown tomcat: -R /opt/tomcat/
Magnolia was downloaded (magnolia-dx-core-demo-webapp-6.2.6.war
)
The war file was renamed to magnoliaAuthor.war
and the tomcat user made the owner of the file.
When moved to the webapps folder the war file is automatically extracted.
The ls -li
command yields:
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
So far so good. But in the Tomcat Web Application Manager I see the application is not running. I click Start
and the application fails to start with only the following message:
FAIL - Application at context path [/magnoliaAuthor] could not be started
The logs are not helpful.
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
With the above information I don't see anything to point me in the right direction.
As pointed out in the comment, Magnolia is currently not compatible with Jakarta EE 9. You can follow progress on that issue at MAGNOLIA-8041