Re: SpringWebUtils in CXF in TomEE
Thanks a lot Romain for the suggestion and Jonathan for confirming it applies nicely. Best Regards, Andriy Redko >> Something like loading the class SpringWebUtils in cxfrsservice#init JG> method would be sufficient IMHO. JG> That looks like it works really well, thank you! I'll get that checked in. JG> Jon JG> On Mon, May 20, 2024 at 4:57 PM Romain Manni-Bucau JG> wrote: >> Le lun. 20 mai 2024 à 17:29, Jonathan Gallimore < >> jonathan.gallim...@gmail.com> a écrit : >> >> > Thanks Andriy and Romain for your replies. >> > >> > > This is quite an interesting issue, is it possible to share (or point >> out >> > to an example) small reproducer project for this problem? >> > >> > Yes - here's a reproducer: https://github.com/jgallimore/demo >> > >> > If you clone this and run mvn clean install tomee:run, it will boot up a >> > TomEE 9.1.3 (which includes CXF 4.0.4). If you invoke a GET >> > http://localhost:8080/hello you'll see the error on the console. >> > >> > > * openejb.cxf.CxfContainerClassLoader is false >> > >> > This didn't work. >> > >> > > * cxf is in the webapp, tomee cxf services disabled and cxf packages >> > "forced-load" >> > >> > I haven't tried this. As I noted in the original email, I would imagine >> > that if this were deployed in Tomcat, and both CXF and Spring were >> included >> > in the application's WEB-INF/lib, this would not be an issue. I suspect >> > this would essentially give the same setup and I would imagine it would >> > work, but I would expect we'd lose the integration functionality in TomEE >> > (which we run the TCK against). Its also a big ask ask for anyone using >> > JAX-RS services, and just so happens to have Spring in their application, >> > as this did work ok in TomEE 9.1.2 (CXF 4.0.3). >> > >> > > If not it can just be to detect it in tomee and setup the webapp >> > properly? >> > >> > Can you give me some pointers on what you mean here? I'm happy to make >> > adjustments in TomEE, and equally happy to work on a suitable update for >> > CXF if preferred. >> > >> >> Like we detect the slf4j api is in the webapp or not to use the container >> or webapp binding it would be done the same for cxf/spring integration I >> suspect. >> Ideally I agree cxf should only use spring stuff if the bus is a spring one >> - it is ok to not use spring with cxf but have spring ;) - but tomee can >> likely workaround that. >> Something like loading the class SpringWebUtils in cxfrsservice#init method >> would be sufficient IMHO. >> >> >> > >> > Many thanks! >> > >> > Jon >> > >> > On Fri, May 17, 2024 at 3:56 AM Romain Manni-Bucau < >> rmannibu...@gmail.com> >> > wrote: >> > >> > > Hi Jon, >> > > >> > > Does it happen in the following both cases: >> > > >> > > * openejb.cxf.CxfContainerClassLoader is false >> > > * cxf is in the webapp, tomee cxf services disabled and cxf packages >> > > "forced-load" >> > > >> > > ? >> > > >> > > If not it can just be to detect it in tomee and setup the webapp >> > properly? >> > > >> > > Le jeu. 16 mai 2024 à 23:25, Andriy Redko a écrit : >> > > >> > >> Hey Jonathan, >> > >> >> > >> This is quite an interesting issue, is it possible to share (or point >> > out >> > >> to an example) small reproducer project for this problem? I think I >> > >> understand >> > >> what is happening but don't have a clear fix for that to suggest at >> the >> > >> moment. >> > >> >> > >> Thank you. >> > >> >> > >> Best Regards, >> > >> Andriy Redko >> > >> >> > >> > Hi, >> > >> >> > >> > Firstly, thank you for all the amazing work you do in CXF. I >> > >> participate in >> > >> > the Apache TomEE project, which includes CXF to enable TomEE to >> > provide >> > >> > REST and SOAP based services. >> > >> >> > >> > We've had a slightly unusual problem crop up that specifically >> affects >> > >> > applications that expose Jakarta REST endpoints (through the >> included >> > >> CXF >> > >> > in TomEE), and include the Spring Framework in the application's >> > >> > WEB-INF/lib. >> > >> >> > >> > The exception we see is: >> > >> >> > >> > java.lang.NoClassDefFoundError: >> > >> > org/springframework/web/filter/ServerHttpObservationFilter >> > >> > at >> > >> > >> > >> >> > >> org.apache.cxf.jaxrs.springmvc.SpringWebUtils.setHttpRequestURI(SpringWebUtils.java:51) >> > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > >> > at >> > >> > >> > >> >> > >> org.apache.cxf.jaxrs.utils.HttpUtils.setHttpRequestURI(HttpUtils.java:380) >> > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > >> > at >> > >> > >> > >> >> > >> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.setExchangeProperties(JAXRSInInterceptor.java:246) >> > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > >> > at >> > >> > >> > >> >> > >> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:183) >> > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > >> > at >> > >> > >> > >> >> > >> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.han
Re: SpringWebUtils in CXF in TomEE
> Something like loading the class SpringWebUtils in cxfrsservice#init method would be sufficient IMHO. That looks like it works really well, thank you! I'll get that checked in. Jon On Mon, May 20, 2024 at 4:57 PM Romain Manni-Bucau wrote: > Le lun. 20 mai 2024 à 17:29, Jonathan Gallimore < > jonathan.gallim...@gmail.com> a écrit : > > > Thanks Andriy and Romain for your replies. > > > > > This is quite an interesting issue, is it possible to share (or point > out > > to an example) small reproducer project for this problem? > > > > Yes - here's a reproducer: https://github.com/jgallimore/demo > > > > If you clone this and run mvn clean install tomee:run, it will boot up a > > TomEE 9.1.3 (which includes CXF 4.0.4). If you invoke a GET > > http://localhost:8080/hello you'll see the error on the console. > > > > > * openejb.cxf.CxfContainerClassLoader is false > > > > This didn't work. > > > > > * cxf is in the webapp, tomee cxf services disabled and cxf packages > > "forced-load" > > > > I haven't tried this. As I noted in the original email, I would imagine > > that if this were deployed in Tomcat, and both CXF and Spring were > included > > in the application's WEB-INF/lib, this would not be an issue. I suspect > > this would essentially give the same setup and I would imagine it would > > work, but I would expect we'd lose the integration functionality in TomEE > > (which we run the TCK against). Its also a big ask ask for anyone using > > JAX-RS services, and just so happens to have Spring in their application, > > as this did work ok in TomEE 9.1.2 (CXF 4.0.3). > > > > > If not it can just be to detect it in tomee and setup the webapp > > properly? > > > > Can you give me some pointers on what you mean here? I'm happy to make > > adjustments in TomEE, and equally happy to work on a suitable update for > > CXF if preferred. > > > > Like we detect the slf4j api is in the webapp or not to use the container > or webapp binding it would be done the same for cxf/spring integration I > suspect. > Ideally I agree cxf should only use spring stuff if the bus is a spring one > - it is ok to not use spring with cxf but have spring ;) - but tomee can > likely workaround that. > Something like loading the class SpringWebUtils in cxfrsservice#init method > would be sufficient IMHO. > > > > > > Many thanks! > > > > Jon > > > > On Fri, May 17, 2024 at 3:56 AM Romain Manni-Bucau < > rmannibu...@gmail.com> > > wrote: > > > > > Hi Jon, > > > > > > Does it happen in the following both cases: > > > > > > * openejb.cxf.CxfContainerClassLoader is false > > > * cxf is in the webapp, tomee cxf services disabled and cxf packages > > > "forced-load" > > > > > > ? > > > > > > If not it can just be to detect it in tomee and setup the webapp > > properly? > > > > > > Le jeu. 16 mai 2024 à 23:25, Andriy Redko a écrit : > > > > > >> Hey Jonathan, > > >> > > >> This is quite an interesting issue, is it possible to share (or point > > out > > >> to an example) small reproducer project for this problem? I think I > > >> understand > > >> what is happening but don't have a clear fix for that to suggest at > the > > >> moment. > > >> > > >> Thank you. > > >> > > >> Best Regards, > > >> Andriy Redko > > >> > > >> > Hi, > > >> > > >> > Firstly, thank you for all the amazing work you do in CXF. I > > >> participate in > > >> > the Apache TomEE project, which includes CXF to enable TomEE to > > provide > > >> > REST and SOAP based services. > > >> > > >> > We've had a slightly unusual problem crop up that specifically > affects > > >> > applications that expose Jakarta REST endpoints (through the > included > > >> CXF > > >> > in TomEE), and include the Spring Framework in the application's > > >> > WEB-INF/lib. > > >> > > >> > The exception we see is: > > >> > > >> > java.lang.NoClassDefFoundError: > > >> > org/springframework/web/filter/ServerHttpObservationFilter > > >> > at > > >> > > > >> > > > org.apache.cxf.jaxrs.springmvc.SpringWebUtils.setHttpRequestURI(SpringWebUtils.java:51) > > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > >> > at > > >> > > > >> > > > org.apache.cxf.jaxrs.utils.HttpUtils.setHttpRequestURI(HttpUtils.java:380) > > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > >> > at > > >> > > > >> > > > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.setExchangeProperties(JAXRSInInterceptor.java:246) > > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > >> > at > > >> > > > >> > > > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:183) > > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > >> > at > > >> > > > >> > > > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78) > > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > >> > at > > >> > > > >> > > > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) > > >> > ~[cxf-core-4.0.4.jar:4.0.4] > > >> > at > > >> > > >
Re: SpringWebUtils in CXF in TomEE
Le lun. 20 mai 2024 à 17:29, Jonathan Gallimore < jonathan.gallim...@gmail.com> a écrit : > Thanks Andriy and Romain for your replies. > > > This is quite an interesting issue, is it possible to share (or point out > to an example) small reproducer project for this problem? > > Yes - here's a reproducer: https://github.com/jgallimore/demo > > If you clone this and run mvn clean install tomee:run, it will boot up a > TomEE 9.1.3 (which includes CXF 4.0.4). If you invoke a GET > http://localhost:8080/hello you'll see the error on the console. > > > * openejb.cxf.CxfContainerClassLoader is false > > This didn't work. > > > * cxf is in the webapp, tomee cxf services disabled and cxf packages > "forced-load" > > I haven't tried this. As I noted in the original email, I would imagine > that if this were deployed in Tomcat, and both CXF and Spring were included > in the application's WEB-INF/lib, this would not be an issue. I suspect > this would essentially give the same setup and I would imagine it would > work, but I would expect we'd lose the integration functionality in TomEE > (which we run the TCK against). Its also a big ask ask for anyone using > JAX-RS services, and just so happens to have Spring in their application, > as this did work ok in TomEE 9.1.2 (CXF 4.0.3). > > > If not it can just be to detect it in tomee and setup the webapp > properly? > > Can you give me some pointers on what you mean here? I'm happy to make > adjustments in TomEE, and equally happy to work on a suitable update for > CXF if preferred. > Like we detect the slf4j api is in the webapp or not to use the container or webapp binding it would be done the same for cxf/spring integration I suspect. Ideally I agree cxf should only use spring stuff if the bus is a spring one - it is ok to not use spring with cxf but have spring ;) - but tomee can likely workaround that. Something like loading the class SpringWebUtils in cxfrsservice#init method would be sufficient IMHO. > > Many thanks! > > Jon > > On Fri, May 17, 2024 at 3:56 AM Romain Manni-Bucau > wrote: > > > Hi Jon, > > > > Does it happen in the following both cases: > > > > * openejb.cxf.CxfContainerClassLoader is false > > * cxf is in the webapp, tomee cxf services disabled and cxf packages > > "forced-load" > > > > ? > > > > If not it can just be to detect it in tomee and setup the webapp > properly? > > > > Le jeu. 16 mai 2024 à 23:25, Andriy Redko a écrit : > > > >> Hey Jonathan, > >> > >> This is quite an interesting issue, is it possible to share (or point > out > >> to an example) small reproducer project for this problem? I think I > >> understand > >> what is happening but don't have a clear fix for that to suggest at the > >> moment. > >> > >> Thank you. > >> > >> Best Regards, > >> Andriy Redko > >> > >> > Hi, > >> > >> > Firstly, thank you for all the amazing work you do in CXF. I > >> participate in > >> > the Apache TomEE project, which includes CXF to enable TomEE to > provide > >> > REST and SOAP based services. > >> > >> > We've had a slightly unusual problem crop up that specifically affects > >> > applications that expose Jakarta REST endpoints (through the included > >> CXF > >> > in TomEE), and include the Spring Framework in the application's > >> > WEB-INF/lib. > >> > >> > The exception we see is: > >> > >> > java.lang.NoClassDefFoundError: > >> > org/springframework/web/filter/ServerHttpObservationFilter > >> > at > >> > > >> > org.apache.cxf.jaxrs.springmvc.SpringWebUtils.setHttpRequestURI(SpringWebUtils.java:51) > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > >> > at > >> > > >> > org.apache.cxf.jaxrs.utils.HttpUtils.setHttpRequestURI(HttpUtils.java:380) > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > >> > at > >> > > >> > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.setExchangeProperties(JAXRSInInterceptor.java:246) > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > >> > at > >> > > >> > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:183) > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > >> > at > >> > > >> > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78) > >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > >> > at > >> > > >> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) > >> > ~[cxf-core-4.0.4.jar:4.0.4] > >> > at > >> > > >> > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) > >> > ~[cxf-core-4.0.4.jar:4.0.4] > >> > at > >> > > >> > org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) > >> > ~[cxf-rt-transports-http-4.0.4.jar:4.0.4] > >> > at > >> > > >> > org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:266) > >> > ~[openejb-cxf-rs-9.1.3.jar:9.1.3] > >> > at > >> > > >> > org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.jav
Re: SpringWebUtils in CXF in TomEE
Thanks Andriy and Romain for your replies. > This is quite an interesting issue, is it possible to share (or point out to an example) small reproducer project for this problem? Yes - here's a reproducer: https://github.com/jgallimore/demo If you clone this and run mvn clean install tomee:run, it will boot up a TomEE 9.1.3 (which includes CXF 4.0.4). If you invoke a GET http://localhost:8080/hello you'll see the error on the console. > * openejb.cxf.CxfContainerClassLoader is false This didn't work. > * cxf is in the webapp, tomee cxf services disabled and cxf packages "forced-load" I haven't tried this. As I noted in the original email, I would imagine that if this were deployed in Tomcat, and both CXF and Spring were included in the application's WEB-INF/lib, this would not be an issue. I suspect this would essentially give the same setup and I would imagine it would work, but I would expect we'd lose the integration functionality in TomEE (which we run the TCK against). Its also a big ask ask for anyone using JAX-RS services, and just so happens to have Spring in their application, as this did work ok in TomEE 9.1.2 (CXF 4.0.3). > If not it can just be to detect it in tomee and setup the webapp properly? Can you give me some pointers on what you mean here? I'm happy to make adjustments in TomEE, and equally happy to work on a suitable update for CXF if preferred. Many thanks! Jon On Fri, May 17, 2024 at 3:56 AM Romain Manni-Bucau wrote: > Hi Jon, > > Does it happen in the following both cases: > > * openejb.cxf.CxfContainerClassLoader is false > * cxf is in the webapp, tomee cxf services disabled and cxf packages > "forced-load" > > ? > > If not it can just be to detect it in tomee and setup the webapp properly? > > Le jeu. 16 mai 2024 à 23:25, Andriy Redko a écrit : > >> Hey Jonathan, >> >> This is quite an interesting issue, is it possible to share (or point out >> to an example) small reproducer project for this problem? I think I >> understand >> what is happening but don't have a clear fix for that to suggest at the >> moment. >> >> Thank you. >> >> Best Regards, >> Andriy Redko >> >> > Hi, >> >> > Firstly, thank you for all the amazing work you do in CXF. I >> participate in >> > the Apache TomEE project, which includes CXF to enable TomEE to provide >> > REST and SOAP based services. >> >> > We've had a slightly unusual problem crop up that specifically affects >> > applications that expose Jakarta REST endpoints (through the included >> CXF >> > in TomEE), and include the Spring Framework in the application's >> > WEB-INF/lib. >> >> > The exception we see is: >> >> > java.lang.NoClassDefFoundError: >> > org/springframework/web/filter/ServerHttpObservationFilter >> > at >> > >> org.apache.cxf.jaxrs.springmvc.SpringWebUtils.setHttpRequestURI(SpringWebUtils.java:51) >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > at >> > >> org.apache.cxf.jaxrs.utils.HttpUtils.setHttpRequestURI(HttpUtils.java:380) >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > at >> > >> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.setExchangeProperties(JAXRSInInterceptor.java:246) >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > at >> > >> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:183) >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > at >> > >> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78) >> > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] >> > at >> > >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) >> > ~[cxf-core-4.0.4.jar:4.0.4] >> > at >> > >> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) >> > ~[cxf-core-4.0.4.jar:4.0.4] >> > at >> > >> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) >> > ~[cxf-rt-transports-http-4.0.4.jar:4.0.4] >> > at >> > >> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:266) >> > ~[openejb-cxf-rs-9.1.3.jar:9.1.3] >> > at >> > >> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:99) >> > ~[tomee-jaxrs-9.1.3.jar:9.1.3] >> > at >> > >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) >> > ~[catalina.jar:10.0.27] >> > at >> > >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) >> > ~[catalina.jar:10.0.27] >> > at >> > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) >> > ~[tomcat-websocket.jar:10.0.27] >> > at >> > >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) >> > ~[catalina.jar:10.0.27] >> > at >> > >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) >> > ~[catalina.jar:10.0.27] >> > at >> org.apache.openejb.server.httpd.EE
Re: SpringWebUtils in CXF in TomEE
Hi Jon, Does it happen in the following both cases: * openejb.cxf.CxfContainerClassLoader is false * cxf is in the webapp, tomee cxf services disabled and cxf packages "forced-load" ? If not it can just be to detect it in tomee and setup the webapp properly? Le jeu. 16 mai 2024 à 23:25, Andriy Redko a écrit : > Hey Jonathan, > > This is quite an interesting issue, is it possible to share (or point out > to an example) small reproducer project for this problem? I think I > understand > what is happening but don't have a clear fix for that to suggest at the > moment. > > Thank you. > > Best Regards, > Andriy Redko > > > Hi, > > > Firstly, thank you for all the amazing work you do in CXF. I participate > in > > the Apache TomEE project, which includes CXF to enable TomEE to provide > > REST and SOAP based services. > > > We've had a slightly unusual problem crop up that specifically affects > > applications that expose Jakarta REST endpoints (through the included CXF > > in TomEE), and include the Spring Framework in the application's > > WEB-INF/lib. > > > The exception we see is: > > > java.lang.NoClassDefFoundError: > > org/springframework/web/filter/ServerHttpObservationFilter > > at > > > org.apache.cxf.jaxrs.springmvc.SpringWebUtils.setHttpRequestURI(SpringWebUtils.java:51) > > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > at > > > org.apache.cxf.jaxrs.utils.HttpUtils.setHttpRequestURI(HttpUtils.java:380) > > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > at > > > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.setExchangeProperties(JAXRSInInterceptor.java:246) > > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > at > > > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:183) > > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > at > > > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78) > > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > > at > > > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) > > ~[cxf-core-4.0.4.jar:4.0.4] > > at > > > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) > > ~[cxf-core-4.0.4.jar:4.0.4] > > at > > > org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) > > ~[cxf-rt-transports-http-4.0.4.jar:4.0.4] > > at > > > org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:266) > > ~[openejb-cxf-rs-9.1.3.jar:9.1.3] > > at > > > org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:99) > > ~[tomee-jaxrs-9.1.3.jar:9.1.3] > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > > ~[catalina.jar:10.0.27] > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > > ~[catalina.jar:10.0.27] > > at > > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) > > ~[tomcat-websocket.jar:10.0.27] > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > > ~[catalina.jar:10.0.27] > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > > ~[catalina.jar:10.0.27] > > at > org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:67) > > ~[openejb-http-9.1.3.jar:9.1.3] > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > > ~[catalina.jar:10.0.27] > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > > ~[catalina.jar:10.0.27] > > at > > > org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) > > ~[spring-web-6.0.19.jar:6.0.19] > > at > > > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) > > ~[spring-web-6.0.19.jar:6.0.19] > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > > ~[catalina.jar:10.0.27] > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > > ~[catalina.jar:10.0.27] > > at > > > org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) > > ~[spring-web-6.0.19.jar:6.0.19] > > at > > > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) > > ~[spring-web-6.0.19.jar:6.0.19] > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > > ~[catalina.jar:10.0.27] > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > > ~[catalina.jar:10.0.27] > > at > > > org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFil
Re: SpringWebUtils in CXF in TomEE
Hey Jonathan, This is quite an interesting issue, is it possible to share (or point out to an example) small reproducer project for this problem? I think I understand what is happening but don't have a clear fix for that to suggest at the moment. Thank you. Best Regards, Andriy Redko > Hi, > Firstly, thank you for all the amazing work you do in CXF. I participate in > the Apache TomEE project, which includes CXF to enable TomEE to provide > REST and SOAP based services. > We've had a slightly unusual problem crop up that specifically affects > applications that expose Jakarta REST endpoints (through the included CXF > in TomEE), and include the Spring Framework in the application's > WEB-INF/lib. > The exception we see is: > java.lang.NoClassDefFoundError: > org/springframework/web/filter/ServerHttpObservationFilter > at > org.apache.cxf.jaxrs.springmvc.SpringWebUtils.setHttpRequestURI(SpringWebUtils.java:51) > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > at > org.apache.cxf.jaxrs.utils.HttpUtils.setHttpRequestURI(HttpUtils.java:380) > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > at > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.setExchangeProperties(JAXRSInInterceptor.java:246) > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > at > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:183) > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > at > org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78) > ~[cxf-rt-frontend-jaxrs-4.0.4.jar:4.0.4] > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) > ~[cxf-core-4.0.4.jar:4.0.4] > at > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) > ~[cxf-core-4.0.4.jar:4.0.4] > at > org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) > ~[cxf-rt-transports-http-4.0.4.jar:4.0.4] > at > org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:266) > ~[openejb-cxf-rs-9.1.3.jar:9.1.3] > at > org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:99) > ~[tomee-jaxrs-9.1.3.jar:9.1.3] > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > ~[catalina.jar:10.0.27] > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > ~[catalina.jar:10.0.27] > at > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) > ~[tomcat-websocket.jar:10.0.27] > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > ~[catalina.jar:10.0.27] > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > ~[catalina.jar:10.0.27] > at org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:67) > ~[openejb-http-9.1.3.jar:9.1.3] > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > ~[catalina.jar:10.0.27] > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > ~[catalina.jar:10.0.27] > at > org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) > ~[spring-web-6.0.19.jar:6.0.19] > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) > ~[spring-web-6.0.19.jar:6.0.19] > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > ~[catalina.jar:10.0.27] > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > ~[catalina.jar:10.0.27] > at > org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) > ~[spring-web-6.0.19.jar:6.0.19] > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) > ~[spring-web-6.0.19.jar:6.0.19] > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) > ~[catalina.jar:10.0.27] > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) > ~[catalina.jar:10.0.27] > at > org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:124) > ~[spring-boot-3.1.11.jar:3.1.11] > at > org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:99) > ~[spring-boot-3.1.11.jar:3.1.11] > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) > ~[spring-web-6.0.19.jar:6.0.19] > at > org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:117) > ~[spring-boot-3.1.11.jar:3.1.11] > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain