Re: Jersey on Tomcat 10.1
Jürgen, On 10.09.2024 20:07, Jürgen Weber wrote: java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart org.glassfish.jersey jersey-bom jakarta.ws.rs jakarta.ws.rs-api 3.0.0 org.glassfish.jersey.containers jersey-container-servlet org.glassfish.jersey.inject jersey-hk2 The manual at https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/modules-and-dependencies.html#servlet-app-general indicates, that you should also add the dependency "jersey-client". Sebastian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Jersey on Tomcat 10.1
Hi, Looks correct, see example from GitHub: https://github.com/eclipse-ee4j/jersey/blob/3.1/examples/servlet3-webapp/pom.xml But I assume that Jersey 3.1.x does implement jax-rs 3.1, so maybe that's the reason it cannot find this class. Mfg Thomas Am 10. September 2024 20:07:07 MESZ schrieb "Jürgen Weber" : >Hi, > >I am looking for a working minimal Jersey on Tomcat 10.1 Maven based >REST example. >What I found all give ClassNotFoundExceptions. > >Anybody knows an example on github? > >Does Jersey even work on Tomcat? > >Thx > > >java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig >java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart > >org.glassfish.jersey >jersey-bom > > >jakarta.ws.rs >jakarta.ws.rs-api >3.0.0 > >org.glassfish.jersey.containers >jersey-container-servlet > >org.glassfish.jersey.inject >jersey-hk2 > >- >To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >For additional commands, e-mail: users-h...@tomcat.apache.org > -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
Tomcat 10.1 and context.xml
I have war file in Tomcat 10.1 with a context.xml file included in the META-INF folder. It's contents are I am getting 404s from my app and was wondering if this is still supported under 10.1 as it was under 9.0
Re: Tomcat 10.1 and context.xml
On 10/09/2024 20:21, charliedidon...@gmail.com wrote: I have war file in Tomcat 10.1 with a context.xml file included in the META-INF folder. It's contents are I am getting 404s from my app and was wondering if this is still supported under 10.1 as it was under 9.0 Support is unchanged. From the 9.0.x docs: The value of this field must not be set unless the Context element is defined in server.xml or the docBase is not located under the Host's appBase. The above setting is not valid on any currently supported version of Tomcat including 9.0.x. A check of the archives show that the same (or very similar) text exists in the docs all the way back to 5.5. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: issue
Lucas, On 9/8/24 13:43, Lucas W wrote: (Tomcat v 11.0.0, java v 22.0.2) Hi, System.out.println(..) works just after tomcat startup to catalina.out. But at some point later on, souts fail to be logged to catalina.out or anywhere. I am also experiencing something weird with File.mkdirs(..); I have it in two different static functions in a utility class, but it only works in one of them (I would give you some sort of exception, but it seems exceptions arent logged to catalina.out either, after the same point where sout stops working). I will note that *sometimes* I get the following SEVEREs in catalina.out on tomcat startup/deploy of my webapp: SEVERE [Catalina-utility-2] org.apache.catalina.startup.ContextConfig.beforeStart Exception fixing docBase for context [] - java.util.zip.ZipException: zip END header not found SEVERE [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/home/user/apache-tomcat-11.0.0-M24/webapps/ROOT.war] - java.lang.IllegalStateException: Error starting child (I am using maven with the build plugin maven-war-plugin to build the war; this is the only maven build plugin I have) but otherwise, my webapp runs smooth. Any obvious potential causes? My guess is that you've got a lot of logging-related JAR files in your application and that, at some point during your application's work, one gets loaded that takes over System.out and/or System.err. If you have multiple *log*.jar files in WEB-INF/lib, I'd spend some time trying to determine whether or not you need all of them. I just recently discovered that I had both slf4j-to-whatever AND whatever-to-slf4j in my own application in a test environment and was surprised to find it wasn't causing stack overflows. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 10.1 and context.xml
Charlie, On 9/10/24 16:12, charliedidon...@gmail.com wrote: On 10/09/2024 20:21, charliedidon...@gmail.com wrote: I have war file in Tomcat 10.1 with a context.xml file included in the META-INF folder. It's contents are I am getting 404s from my app and was wondering if this is still supported under 10.1 as it was under 9.0 Support is unchanged. From the 9.0.x docs: The value of this field must not be set unless the Context element is defined in server.xml or the docBase is not located under the Host's appBase. The above setting is not valid on any currently supported version of Tomcat including 9.0.x. A check of the archives show that the same (or very similar) text exists in the docs all the way back to 5.5. Mark Weird because it did work under 9.0 with Spring MVC 4 Not sure if I understand your answer..but should I NOW place this in the server.xml? As my docBase is under the webapps folder which I understand to be my docBase by default As follows No, you should have: If you want your application to be deployed on /codereaper then you should re-name the WAR file to codereaper.war (or WAR-like directory in webapps to "codereaper" - without quotes) in webapps/. I'm pretty sure you don't even need a META-INF/context.xml file if it's so trivial. So I would delete it, re-name your WAR file (or dir) and try that. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 10.1 and context.xml
Charlie, On 9/10/24 16:12, charliedidon...@gmail.com wrote: > On 10/09/2024 20:21, charliedidon...@gmail.com wrote: >> I have war file in Tomcat 10.1 with a context.xml file included in >> the META-INF folder. >> >> It's contents are >> >> >> >> >> >> I am getting 404s from my app and was wondering if this is still >> supported under 10.1 as it was under 9.0 > > Support is unchanged. From the 9.0.x docs: > > The value of this field must not be set unless the Context element is defined > in server.xml or the docBase is not located under the Host's appBase. > > The above setting is not valid on any currently supported version of Tomcat > including 9.0.x. > > A check of the archives show that the same (or very similar) text exists in > the docs all the way back to 5.5. > > Mark > > Weird because it did work under 9.0 with Spring MVC 4 > > Not sure if I understand your answer..but should I NOW place this > in the server.xml? As my docBase is under the webapps folder which I > understand to be my docBase by default > > As follows > docBase="webapps"> No, you should have: If you want your application to be deployed on /codereaper then you should re-name the WAR file to codereaper.war (or WAR-like directory in webapps to "codereaper" - without quotes) in webapps/. I'm pretty sure you don't even need a META-INF/context.xml file if it's so trivial. So I would delete it, re-name your WAR file (or dir) and try that. -chris The war file is named codereaper.war. The reason I asked is because I just got flamed in Stackoverflow since I asked a question about why I was getting 404s in my Spring MVC 6 app. They said I would need to change my controller mappings to include the codereaper context root in my application. So if I understand correctly the following in a JSP will equate to /codereaper ${pageContext.request.contextPath} The next one is probably a question for the Spring list but here it is anyway In Spring mvc 4 the following would equate to URLs of /codereaper/home But in Spring 6 I am getting a 404 and the access log shows 192.168.0.28 - - [10/Sep/2024:15:13:49 -0400] "GET /codereaper/home HTTP/1.1" 404 7636 @RequestMapping("/") public class MainController { static Logger logger = LogManager.getLogger(MainController.class); @RequestMapping("/home") public ModelAndView home(Model model, HttpServletRequest request, HttpServletResponse response) { ModelAndView mav = new ModelAndView(); MainContent mainContent = new MainContent(); String username; model.addAttribute("userName", "Username"); mav.setViewName("home.jsp"); return (mav); } - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[ANN] Apache Tomcat 11.0.0-M25 (beta) available
The Apache Tomcat team announces the immediate availability of Apache Tomcat 11.0.0-M25 (beta). Apache Tomcat 11 is an open source software implementation of the Jakarta Servlet, Jakarta Server Pages, Jakarta Expression Language, Jakarta WebSocket, Jakarta Authentication and Jakarta Annotations specifications. Users of Tomcat 10 onwards should be aware that, as a result of the move from Java EE to Jakarta EE as part of the transfer of Java EE to the Eclipse Foundation, the primary package for all implemented APIs has changed from javax.* to jakarta.*. This will almost certainly require code changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later. A migration tool is available to aid this process. Apache Tomcat 11.0.0-M25 is a milestone release of the 11.0.x branch and has been made to provide users with early access to the new features in Apache Tomcat 11.0.x so that they may provide feedback. The notable changes compared to 11.0.0-M24 include: - Implement the recent clarification from the Jakarta Servlet project that if a content length is declared then once that many bytes have been written to the response, further writes should trigger an IOException - If an HTTP/2 client resets a stream before the request body is fully written, ensure that any ReadListener is notified via a call to ReadListener.onErrror() - An Exception being thrown during WebSocket message processing (e.g. in a method annotated with @onMessage) should not automatically cause the connection to close. The application should handle the exception and make the decision whether or not to close the connection. Please refer to the change log for the complete list of changes: http://tomcat.apache.org/tomcat-11.0-doc/changelog.html Downloads: http://tomcat.apache.org/download-11.cgi Migration guides from Apache Tomcat 9.0.x and 10.1.x: http://tomcat.apache.org/migration.html Enjoy! - The Apache Tomcat team - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Jersey on Tomcat 10.1
I had found about jersey-client, too, but it did not help. The exceptions happen in static blocks, so no good information in the stacktrace. Am Di., 10. Sept. 2024 um 20:16 Uhr schrieb Sebastian Trost : > > Jürgen, > > On 10.09.2024 20:07, Jürgen Weber wrote: > > java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig > > java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart > > > > org.glassfish.jersey > > jersey-bom > > > > > > jakarta.ws.rs > > jakarta.ws.rs-api > > 3.0.0 > > > > org.glassfish.jersey.containers > > jersey-container-servlet > > > > org.glassfish.jersey.inject > > jersey-hk2 > The manual at > https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/modules-and-dependencies.html#servlet-app-general > indicates, that you should also add the dependency "jersey-client". > > Sebastian > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org