I don't think there is an upper limit. I know 17 works for us, but your
mileage may vary depending on your app libraries, etc.


On Tue, Nov 21, 2023, 15:49 Campbell, Lance <la...@illinois.edu> wrote:

> Thanks so much.
> One last question. If I want to use javax.serlet.* then what is the
> highest version of Java I should use?
>
> Thanks,
>
> Lance
>
> -----Original Message-----
> From: Robert Turner <rtur...@e-djuster.ca>
> Sent: Tuesday, November 21, 2023 2:36 PM
> To: Tomcat Users List <users@tomcat.apache.org>
> Subject: Re: Issue Migrating servlets to 10.1
>
> Tomcat 10.x and higher require Jakarta namespaces versions of the Servlet
> specifications.
> Tomcat 9.x is the last Tomcat support javax.servlet namespaces.
>
> Refer to the Which Version page for Tomcat for details:
>
> https://urldefense.com/v3/__https://tomcat.apache.org/whichversion.html__;!!DZ3fjg!4VB2wQDqugXc0S2euhB5gcgb0Cu6xk-8SLRK_GwqXTxu2U6M3PLo_zrv8d_LmTAOeY0pUCw2GMYHX0pcXv1cMQ$
>
> On Tue, Nov 21, 2023 at 3:30 PM Campbell, Lance <la...@illinois.edu>
> wrote:
>
> > I am migrating from Java 8 tomcat 9 to Java 11 tomcat 10.1 .
> >
> > I am getting a cast class exception when trying to access my login
> > servlet. In my servlets I am using these packages:
> >
> >
> > import javax.servlet.ServletException;
> >
> > import javax.servlet.http.HttpServlet;
> >
> > import javax.servlet.http.HttpServletRequest;
> >
> > import javax.servlet.http.HttpServletResponse;
> >
> >
> >   1.  Does either Java 11 or Tomcat 10.1 require that I use
> > Jakarta.servlet.* packages instead of javax.servlet.*?
> >   2.  If that is the case, then what is specifically requiring this?
> > Is it Java 11 or Tomcat 10.1 or both?
> >
> > My servlet is getting this error:
> >
> > 21-Nov-2023 14:14:52.768 INFO [main]
> > org.apache.catalina.core.ApplicationContext.log Marking servlet
> > [LoginServlet] as unavailable
> > 21-Nov-2023 14:14:52.769 SEVERE [main]
> > org.apache.catalina.core.StandardContext.loadOnStartup Servlet
> > [LoginServlet] in web application [] threw load() exception
> >         java.lang.ClassCastException: class xyz.servlet.LoginServlet
> > cannot be cast to class jakarta.servlet.Servlet
> > (xyz.servlet.LoginServlet is in unnamed module of loader
> > org.apache.catalina.loader.ParallelWebappClassLoader
> > @2ccca26f; jakarta.servlet.Servlet is in unnamed module of loader
> > java.net.URLClassLoader @63e2203c)
> >
> > Thanks,
> >
> > Lance
> >
>

Reply via email to