[ 
https://issues.apache.org/jira/browse/CXF-8176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17050509#comment-17050509
 ] 

Karl von Randow commented on CXF-8176:
--------------------------------------

Sorry to reopen this... I am running into the same issue, where CXF after 3.2.1 
can no longer inject {{@Context HttpServletRequest}} in JAX-RS resources and 
providers, due to this failure to create a proxy in Weld.

What I want to check is, this works in CXF 3.2.1. It breaks in 3.2.2 with the 
{{AmbiguousResolutionException}} covered in 
https://issues.apache.org/jira/browse/CXF-7643. When you get to 3.2.12 it 
remains broken with the extremely obtuse exceptions mentioned above.

My understanding is that {{@Context HttpServletRequest}} is part of the JAX-RS 
spec. If I've misunderstood I would hugely appreciate the clarification, as 
it's driving me a little batty ;)

Also I'd like to clarify that this appears to be a regression in 3.2.2.

I can change _my_ usage of {{@Context HttpServletRequest}} but I can't (easily) 
change other libraries that make use of it (and in fact don't assume a CDI 
environment so don't even _have_ {{@Inject}} in their dependencies).

All advice gratefully accepted!

> Apache CXF @Context not class loading.
> --------------------------------------
>
>                 Key: CXF-8176
>                 URL: https://issues.apache.org/jira/browse/CXF-8176
>             Project: CXF
>          Issue Type: Bug
>          Components: Integration
>    Affects Versions: 3.2.2
>            Reporter: Richard O'Sullivan
>            Priority: Major
>         Attachments: CXF-ContentProducerBean-Fail-to-Load-Stacktrace.txt, 
> cxf-servlet-bug.tar.gz
>
>
> I have a WAR containing cxf-integration-cdi-3.2.1.jar that I deploy to Tomcat 
> V9, successfully. When I deploy a WAR containing 
> cxf-integration-cdi-3.2.7.jar, it fails to deploy because:
> {quote}org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load 
> proxy class for bean org.apache.cxf.cdi.ContextProducerBean@28c30f4d with 
> class class java.lang.Object using classloader 
> java.net.URLClassLoader@695caf9f
> {quote}
> My WAR includes the Weld v2.4.6 jars.
> Note: The ContextProducerBean class was introduced in CXF v3.2.2. 
> Others on the web, have reported a similar issue:
>  * 
> [https://stackoverflow.com/questions/56905194/class-not-found-in-war-but-is-available]
>  * [https://t.codebug.vip/questions-112783.htm]
>  I'm suspicious that there is no scope modifier on the constructor in the 
> ContextProducerBean class; thus, causing the scope to default to 'package 
> private' and become hidden from Tomcat's class loader. Also, the super class, 
> AbstractCXFBean<Object> does not declare a scope either. The fix might be to 
> add the 'public' modifier to both, just guessing.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to