Magnolia not starting on Vanilla Tomcat Server

487 views
Skip to first unread message

Michael Haufe

unread,
Mar 29, 2021, 3:02:13 PM3/29/21
to Magnolia User Mailing List
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.

Tomcat runs under its own user (tomcat) with full rights to its installation folder (/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. 

Samuli Saarinen

unread,
Mar 29, 2021, 11:22:35 PM3/29/21
to user...@magnolia-cms.com
Hi,

I don't think Magnolia still supports tomcat 10 or more specifically servlet 5.0 [1]. The latter moved servlet-api from javax.servlet to jakarta.servlet which causes the exception you see in catalina.out and requires changes in magnolia sources. Switch to 9.x and you should be fine. 


Br, Samuli 


--
You received this message because you are subscribed to the Google Groups "Magnolia User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to user-list+...@magnolia-cms.com.
To view this discussion on the web, visit https://groups.google.com/a/magnolia-cms.com/d/msgid/user-list/91a93b76-02bb-466c-b66a-2a81d9d1d2d7n%40magnolia-cms.com.

Michael Haufe

unread,
Mar 31, 2021, 10:03:10 AM3/31/21
to Magnolia User Mailing List, samuli....@gmail.com
On Monday, March 29, 2021 at 10:22:35 PM UTC-5 samuli....@gmail.com wrote:
Hi,

I don't think Magnolia still supports tomcat 10 or more specifically servlet 5.0 [1]. The latter moved servlet-api from javax.servlet to jakarta.servlet which causes the exception you see in catalina.out and requires changes in magnolia sources. Switch to 9.x and you should be fine. 

Looks like this was exactly the issue. I raised the problem through an official support channel to confirm.  Hopefully the newer platform will be supported in the near future. 

Michael Haufe

unread,
Mar 31, 2021, 10:10:09 AM3/31/21
to Magnolia User Mailing List, Michael Haufe, samuli....@gmail.com
Someone was kind enough to file a bug for this issue:

Reply all
Reply to author
Forward
0 new messages