jbonofre opened a new pull request, #720:
URL: https://github.com/apache/camel-karaf/pull/720

   ## What
   
   Adds the missing `org.springframework.http*` OSGi package import to the 
`camel-cxf-all` bundle.
   
   Fixes #709.
   
   ## Why
   
   With the CXF version bundled in 4.18, 
`org.apache.cxf.jaxrs.springmvc.SpringWebUtils` references 
`org.springframework.http.server.observation.ServerRequestObservationContext` 
(Spring 6 / Micrometer observability). At runtime this failed with:
   
   ```
   java.lang.NoClassDefFoundError: 
org/springframework/http/server/observation/ServerRequestObservationContext
       at 
org.apache.cxf.jaxrs.springmvc.SpringWebUtils.setHttpRequestURI(SpringWebUtils.java:51)
       ...
   Caused by: java.lang.ClassNotFoundException:
       
org.springframework.http.server.observation.ServerRequestObservationContext
       cannot be found by camel-cxf-all_4.18.2
   ```
   
   `camel-cxf-all` enumerates specific Spring sub-packages in 
`<camel.osgi.import>` (`aop`, `beans`, `context`, `core`, `util`, `web`) but 
did **not** import `org.springframework.http*`. That package is a sibling of 
`org.springframework.web`, so `org.springframework.web*` does not cover it — 
the package was never wired and the class could not be found.
   
   Note `camel-cxf-spring-all` is unaffected because it imports the 
`org.springframework*` wildcard.
   
   ## Change
   
   ```xml
   
org.springframework.http*;resolution:=optional;version="${camel-osgi-spring-version}",
   ```
   
   Marked `resolution:=optional` and versioned, consistent with the other 
optional Spring imports in this bundle (these Spring integrations are only used 
when Spring is on the classpath).
   
   ## Verification
   
   Built the module and confirmed the generated `META-INF/MANIFEST.MF` now 
includes the required package:
   
   ```
   
org.springframework.http.server.observation;resolution:=optional;version="[6.2,...)"
   ```
   
   ## Scope
   
   Karaf-specific packaging/OSGi-metadata delta only; no Camel-core change.
   
   _Claude Code on behalf of JB Onofré_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to