You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Blake McBride <bl...@gmail.com> on 2021/02/26 19:55:00 UTC

NoClassDefFoundError on ServletContextAttributeListner

Greetings,

I have a web app that has been running fine for many years.  I tried
upgrading to Tomcat 10.0.2 and I am getting the following error:

Feb 26, 2021 1:48:26 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Error configuring application listener of class
[com.sun.xml.ws.transport.http.servlet.WSServletContextListener]
java.lang.NoClassDefFoundError:
javax/servlet/ServletContextAttributeListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[...]

Without changing anything, this app works fine with Tomcat:

9.0.43
8.5.63
8.0.27

But I get the above error with Tomcat 10.0.2 only.

Sure appreciate any help.

Thanks!

Blake McBride

Re: NoClassDefFoundError on ServletContextAttributeListner

Posted by Blake McBride <bl...@gmail.com>.
Thanks, I will check it out.

On Fri, Feb 26, 2021 at 10:26 PM Christopher Schultz <
chris@christopherschultz.net> wrote:

> Blake,
>
> On 2/26/21 14:55, Blake McBride wrote:
> > I have a web app that has been running fine for many years.  I tried
> > upgrading to Tomcat 10.0.2 and I am getting the following error:
> >
> > Feb 26, 2021 1:48:26 PM org.apache.catalina.core.StandardContext
> > listenerStart
> > SEVERE: Error configuring application listener of class
> > [com.sun.xml.ws.transport.http.servlet.WSServletContextListener]
> > java.lang.NoClassDefFoundError:
> > javax/servlet/ServletContextAttributeListener
> > at java.lang.ClassLoader.defineClass1(Native Method)
> > at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
> > at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> > [...]
> >
> > Without changing anything, this app works fine with Tomcat:
> >
> > 9.0.43
> > 8.5.63
> > 8.0.27
> >
> > But I get the above error with Tomcat 10.0.2 only.
> >
> > Sure appreciate any help.
>
> Did you read the Migration Guide? Tomcat 10 is built with and requires
> the use of all the Jakarta EE package names. javax.servlet is dead. Long
> live jakarta.servlet!
>
> http://tomcat.apache.org/migration-10.html#Specification_APIs
>
> You might want to have a look at the migration tool:
> https://tomcat.apache.org/download-migration.cgi
>
> Not a huge amount of documentation about it, so you'll have to piece
> things together yourself.
>
> Hope that helps,
> -chris
>

Re: NoClassDefFoundError on ServletContextAttributeListner

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Blake,

On 2/26/21 14:55, Blake McBride wrote:
> I have a web app that has been running fine for many years.  I tried
> upgrading to Tomcat 10.0.2 and I am getting the following error:
> 
> Feb 26, 2021 1:48:26 PM org.apache.catalina.core.StandardContext
> listenerStart
> SEVERE: Error configuring application listener of class
> [com.sun.xml.ws.transport.http.servlet.WSServletContextListener]
> java.lang.NoClassDefFoundError:
> javax/servlet/ServletContextAttributeListener
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> [...]
> 
> Without changing anything, this app works fine with Tomcat:
> 
> 9.0.43
> 8.5.63
> 8.0.27
> 
> But I get the above error with Tomcat 10.0.2 only.
> 
> Sure appreciate any help.

Did you read the Migration Guide? Tomcat 10 is built with and requires 
the use of all the Jakarta EE package names. javax.servlet is dead. Long 
live jakarta.servlet!

http://tomcat.apache.org/migration-10.html#Specification_APIs

You might want to have a look at the migration tool:
https://tomcat.apache.org/download-migration.cgi

Not a huge amount of documentation about it, so you'll have to piece 
things together yourself.

Hope that helps,
-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org