Re: 9.0.83 addSslHostConfig failures?
On 2023/11/20 22:14:14 Daniel Skiles wrote: > Was there a change to the addSslHostConfig JMX mbean operation between > 9.0.82 and 9.0.83? I have some code that works in 82, but fails with an > MBeanException: Cannot find operation [addSslHostConfig] in 9.0.83. > > When I attempt to look at the available operations on ProtocolHandler in > jconsole, it throws an exception in 83 that opens a new window, but works > in 82. I have the following with 8.5.x: > Error setting Operation panel :org.apache.coyote.Request > Error setting Operation panel :org.apache.tomcat.util.net.SSLHostConfig addSslHostConfig is greyed out for me...let me go back a patch version... - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 9.0.83 addSslHostConfig failures?
On 2023/11/21 11:25:11 Michael Osipov wrote: > On 2023/11/20 22:14:14 Daniel Skiles wrote: > > Was there a change to the addSslHostConfig JMX mbean operation between > > 9.0.82 and 9.0.83? I have some code that works in 82, but fails with an > > MBeanException: Cannot find operation [addSslHostConfig] in 9.0.83. > > > > When I attempt to look at the available operations on ProtocolHandler in > > jconsole, it throws an exception in 83 that opens a new window, but works > > in 82. > > I have the following with 8.5.x: > > Error setting Operation panel :org.apache.coyote.Request > > Error setting Operation panel :org.apache.tomcat.util.net.SSLHostConfig > > addSslHostConfig is greyed out for me...let me go back a patch version... Tried on 8.5.92, same behavior. You should share your connector config. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Web.xml file question
Tomcat 10.1 Java migration from 8 to 11 Eclipse I am trying to migrate my thirteen tomcat web applications from java 8 to java 11. And from tomcat 9 to tomcat 10.1 . I have been using the web.xml file for years with Java 8 and tomcat 9. However, when I built my dynamic web application with eclipse I don't see a web.xml file. I looked at the example web application in the tomcat 10.1 download. Is the below top part of the web.xml file appropriate for java 11 running 10.1 https://jakarta.ee/xml/ns/jakartaee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"; version="6.0" metadata-complete="true"> Thanks, Lance
Re: Web.xml file question
Lance, On 11/21/23 11:33, Campbell, Lance wrote: Tomcat 10.1 Java migration from 8 to 11 Eclipse I am trying to migrate my thirteen tomcat web applications from java 8 to java 11. And from tomcat 9 to tomcat 10.1 . I have been using the web.xml file for years with Java 8 and tomcat 9. However, when I built my dynamic web application with eclipse I don't see a web.xml file. I looked at the example web application in the tomcat 10.1 download. Is the below top part of the web.xml file appropriate for java 11 running 10.1 https://jakarta.ee/xml/ns/jakartaee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"; version="6.0" metadata-complete="true"> It seems so. Here is the default web.xml for that branch of the server: https://github.com/apache/tomcat/blob/10.1.x/conf/web.xml -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Issue Migrating servlets to 10.1
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
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://tomcat.apache.org/whichversion.html On Tue, Nov 21, 2023 at 3:30 PM Campbell, Lance 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 >
RE: Issue Migrating servlets to 10.1
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 Sent: Tuesday, November 21, 2023 2:36 PM To: Tomcat Users List 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 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 >
Re: Issue Migrating servlets to 10.1
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 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 > Sent: Tuesday, November 21, 2023 2:36 PM > To: Tomcat Users List > 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 > 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 > > >
Re: Issue Migrating servlets to 10.1
Many libraries that require JDK 11 or 17 are very likely to have migrated to Jakarta(if they used javax) On Tue, Nov 21, 2023, 14:53 Robert Turner wrote: > 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 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 > > Sent: Tuesday, November 21, 2023 2:36 PM > > To: Tomcat Users List > > 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 > > 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 > > > > > >
Re: Issue Migrating servlets to 10.1
I believe you can make use of a migration tool.Apache Tomcat® - Migration Guide - Tomcat 10.0.xtomcat.apache.orgfrom tomcat 9 to tomcat 10.0Specification APIsApache Tomcat 10 supports the Jakarta Servlet 5.0, Jakarta Server Pages 3.0, Jakarta _expression_ Language 4.0, JakartaWebSocket 2.0 and Jakarta Authentication 2.0 specifications.There is a significant breaking change between Tomcat 9.0.x and Tomcat 10.0.x. The Java package used by the specification APIs has changed fromjavax... to jakarta It will be necessary to recompile web applications against the new APIs.Tomcat can convert an existing web application from Java EE 8 to Jakarta EE 9 at deployment time using the Apache Tomcat migration tool for Jakarta EE. To make use of the feature, the web application should be placed in the Host legacyAppBase folder (by default named webapps-javaee) and they will be converted to an equivalent Jakarta EE web application in the Host appBase folder (by default named webapps).Alternately, the Apache Tomcat migration tool for Jakarta EE or any similar conversion tool can be used ahead of time to benefit from faster deployment time and more precise conversion configuration options.On Nov 21, 2023, at 1:36 PM, Robert Turner wrote:Tomcat 10.x and higher require Jakarta namespaces versions of the Servletspecifications.Tomcat 9.x is the last Tomcat support javax.servlet namespaces.Refer to the Which Version page for Tomcat for details:https://tomcat.apache.org/whichversion.htmlOn Tue, Nov 21, 2023 at 3:30 PM Campbell, Lance 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 loginservlet. 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 useJakarta.servlet.* packages instead of javax.servlet.*? 2. If that is the case, then what is specifically requiring this? Is itJava 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 unavailable21-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.LoginServletcannot be cast to class jakarta.servlet.Servlet(xyz.servlet.LoginServlet is in unnamed module of loaderorg.apache.catalina.loader.ParallelWebappClassLoader@2ccca26f; jakarta.servlet.Servlet is in unnamed module of loaderjava.net.URLClassLoader @63e2203c)Thanks,Lance
Re: [External] Re: Supporting Proxy Protocol in Tomcat
Hey, Checking in on this thread. Is someone actively working on this? I am more than happy to contribute/help in any way to move this forward quickly. Thanks, Adwait. On Tue, Sep 5, 2023 at 1:11 PM Mark Thomas wrote: > On 04/09/2023 15:41, Jonathan S. Fisher wrote: > > Mark thank you again for your leadership and setting expectations. I'm > > going to commit to working on this with anyone else that wants to help > with > > the goal of a patch by year end. I want to nail the patch with minimal > > rework that meets Tomcat project quality standards. To that end, I'll > > attempt to summarize what you expect here and if you could comment and > > correct my understanding that would be appreciated. > > > > It sounds like you're satisfied with the ubiquity of the Proxy protocol > and > > that it has an RFC > > We'll target just implementing the latest version of the Proxy protocol > > We'll implement a "TrustedProxies" feature similar to what the Remote IP > > Valve does > > We'll implement a, or modify the RemoteIp, valve to be able to set the > > remote IP from Proxy protocol headers > > We'll follow the RFC spec and reject any request that does a proper Proxy > > protocol header > > I'm particularly interested in the Proxy protocol over Unix Domain > Sockets, > > so expect to see a lot of the work focused on this, but accepting Proxy > > Protocol over TCP looks to be quite important from the comments on this > > email chain > > > > If I may ask two things: > > Can you summarize your desired implementation? What point in the stack > > should we target to implement this? > > See my response earlier in this thread that suggested it sits alongside > SNI processing. I still think that makes sense. If during implementation > you reach a different conclusion then make the case for the alternative > approach on list. > > > One thing I'm not familiar with on Tomcat is the testing expectations. If > > you can point to a set of unit tests and a set of integration tests and > say > > "Do it like this" > > Something like (only a guide) > > > https://github.com/apache/tomcat/blob/main/test/org/apache/tomcat/util/net/TestTLSClientHelloExtractor.java > > to test the implementation directly and probably something based on > SimpleHttpClient see > > > https://github.com/apache/tomcat/blob/main/test/org/apache/coyote/http11/TestHttp11Processor.java > > for various examples. The main thing is I suspect you'll need control of > the individual bytes and SimpleHttpClient provides a reasonably simple > basis for that. > > What we often do when we want to test things like setting remote IP > addresses etc. is echo the value in the response body and then check > that value in the client. > > > Anything else on the original patch you liked/didn't like? ( > > https://bz.apache.org/bugzilla/show_bug.cgi?id=57830) > > It helps if you enable Checkstyle for your local build. It helps keep > things in roughly the same coding style (we are slowly tightening up on > that). Ideally, use the clean-up and formatting configurations we have > for Eclipse in res/ide-support/eclipse . > > This is sufficiently complex that I am expecting several iterations to > be required. if it is simpler for you to manage with a PR then that is > fine and probably easier to work with than a patch in Bugzilla. > > Mark > > > > > Thank you, > > > > > > On Tue, Aug 29, 2023 at 3:13 PM Mark Thomas wrote: > > > >> On 28/08/2023 18:44, Amit Pande wrote: > >>> Oh, sure. So, what would be the best way to get some conclusion on this > >> thread? > >> > >> Provide a patch for review based on the feedback provided here and in > >> the BZ issue. > >> > >>> https://bz.apache.org/bugzilla/show_bug.cgi?id=57830 The state of the > >> ticket isn't updated for long. Perhaps add comments/ask the folks on > user > >> list to vote? > >> > >> That is more likely to irritate folks rather than encourage them to help > >> you progress your patch. > >> > >> Mark > >> > >> > >>> > >>> Thanks, > >>> Amit > >>> > >>> -Original Message- > >>> From: Mark Thomas > >>> Sent: Monday, August 28, 2023 11:20 AM > >>> To: Tomcat Users List > >>> Subject: Re: [External] Re: Supporting Proxy Protocol in Tomcat > >>> > >>> > >>> CAUTION: This email originated from outside the organization. Do not > >> click links or open attachments unless you recognize the sender and know > >> the content is safe. If you believe this is a phishing email, use the > >> Report to Cybersecurity icon in Outlook. > >>> > >>> > >>> > >>> 28 Aug 2023 17:11:20 Amit Pande : > >>> > Mark, > > Just checking - Did this issue get discussed in any of the core > members' meeting? > >>> > >>> There are no such meetings. Discussion happens on the mailing lists. > >>> > >>> Mark > >>> > >>> > > Thanks, > Amit > > -Original Message- > From: Amit Pande > Sent: Monday, July 31, 2023 9:29 AM > To: Tomcat Users List > Subject: RE: [External] Re: Supporti
Apache site update for ApacheHaus EOS
Hello, ApacheHaus has decided to stop providing Windows builds for Apache HTTPD. The Apache document referred to below still has the site that goes nowhere. https://httpd.apache.org/docs/current/platform/windows.html#down:~:text=Microsoft%20Windows%2C%20include%3A-,ApacheHaus,-Apache%20Lounge Is there a bug process to update the documentation? Thanks! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Apache site update for ApacheHaus EOS
My apologies, I sent this to the wrong address. On Tue, Nov 21, 2023 at 6:31 PM Aditya Shastri wrote: > > Hello, > > ApacheHaus has decided to stop providing Windows builds for Apache HTTPD. > > The Apache document referred to below still has the site that goes nowhere. > https://httpd.apache.org/docs/current/platform/windows.html#down:~:text=Microsoft%20Windows%2C%20include%3A-,ApacheHaus,-Apache%20Lounge > > Is there a bug process to update the documentation? > > Thanks! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org