You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/10/05 18:01:00 UTC

[jira] [Resolved] (CAMEL-18579) Missing osgi import for CxfUtils in camel-cxf-rest

     [ https://issues.apache.org/jira/browse/CAMEL-18579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-18579.
---------------------------------
    Resolution: Fixed

Fixed by PR
https://github.com/apache/camel/pull/8465

> Missing osgi import for CxfUtils in camel-cxf-rest
> --------------------------------------------------
>
>                 Key: CAMEL-18579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18579
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxfrs, osgi
>    Affects Versions: 3.18.2, 3.19.0
>            Reporter: Jan Filipski
>            Priority: Major
>             Fix For: 3.18.3, 3.20.0
>
>
> CxfRsConsumer class has a direct dependency to CxfUtils (from another bundle). Osgi import to package org.apache.camel.component.cxf.util is now explicity disabled, so if CxfUtils is called, that cause ClassNotFoundException from runtime.
> It's easy reproducable, probably on all versions containing camel-cxf-rest bundle (after CAMEL-9627).
> After fault on rest endpoint, outFaultObserver is called and that cause runtime ClassNotFoundException on osgi environments.
> Example stacktrace:
> {noformat}
> java.lang.NoClassDefFoundError: org/apache/camel/component/cxf/util/CxfUtils
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.lambda$createServer$0(CxfRsConsumer.java:65) ~[?:?]
>         at org.apache.cxf.phase.PhaseInterceptorChain.wrapExceptionAsFault(PhaseInterceptorChain.java:373) ~[?:?]
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:331) ~[?:?]
>         at org.apache.cxf.interceptor.security.JAASLoginInterceptor$1.run(JAASLoginInterceptor.java:159) ~[?:?]
>         at org.apache.cxf.interceptor.security.JAASLoginInterceptor$1.run(JAASLoginInterceptor.java:152) ~[?:?]
>         at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
>         at javax.security.auth.Subject.doAs(Subject.java:376) ~[?:?]
>         at org.apache.cxf.interceptor.security.JAASLoginInterceptor.handleMessage(JAASLoginInterceptor.java:152) ~[?:?]
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) ~[?:?]
>         at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[?:?]
>         at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) ~[?:?]
>         at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[?:?]
>         at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[?:?]
>         at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[?:?]
>         at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) ~[?:?]
>         at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:304) ~[?:?]
>         at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217) ~[?:?]
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:517) ~[?:?]
>         at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:279) ~[?:?]
>         at org.ops4j.pax.web.service.spi.servlet.OsgiInitializedServlet.service(OsgiInitializedServlet.java:74) ~[?:?]
>         at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450) ~[?:?]
>         at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[?:?]
>         at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656) ~[?:?]
>         at org.ops4j.pax.web.service.spi.servlet.OsgiFilterChain.doFilter(OsgiFilterChain.java:100) ~[?:?]
>         at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHandler.doHandle(PaxWebServletHandler.java:310) ~[?:?]
>         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[?:?]
>         at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[?:?]
>         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[?:?]
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[?:?]
>         at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[?:?]
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[?:?]
>         at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[?:?]
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[?:?]
>         at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) ~[?:?]
>         at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[?:?]
>         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[?:?]
>         at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[?:?]
>         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[?:?]
>         at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234) ~[?:?]
>         at org.ops4j.pax.web.service.jetty.internal.PrioritizedHandlerCollection.handle(PrioritizedHandlerCollection.java:96) ~[?:?]{noformat}
>  
> Fix - not tested yet, but removing explict import removal from pom.xml should be enough (line containing !org.apache.camel.component.cxf.util)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)