[jira] [Commented] (CXF-7925) Dynamic WSDL Client creation fails on JDK 11 because it cannot compile generated classes

2020-02-11 Thread Marian Macik (Jira)


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

Marian Macik commented on CXF-7925:
---

Hi guys, is this under some dicussion or should we close this?

> Dynamic WSDL Client creation fails on JDK 11 because it cannot compile 
> generated classes
> 
>
> Key: CXF-7925
> URL: https://issues.apache.org/jira/browse/CXF-7925
> Project: CXF
>  Issue Type: Bug
>  Components: Core, JAX-WS Runtime
>Affects Versions: 3.1.16, 3.2.7
> Environment: JDK 11
> Wildfly 14/EAP 7.2.0
> Apache CXF 3.1.16/3.2.7
>Reporter: Marian Macik
>Priority: Major
>  Labels: Java11, jdk11
>
> Hi guys,
> sorry for a longer description, but I wrote here everything I know.
> I am working on kiegroup projects (drools,jbpm,optaplanner) and we are now 
> upgrading to JDK 11. I am having the following issue (it works on JDK 8):
> Enivornment is JDK 11, Wildfly 14/EAP 7.2.0 and I am running there our tests. 
> The test runs inside EAP and calls a 
> [WebService|https://github.com/kiegroup/jbpm/blob/ccddd0812225ec7666111700e4138d3a32a28b66/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-suite/src/main/java/org/jbpm/remote/ejb/test/mock/WebService.java#L32-L37]
>  which is published from client side (outside container) 
> [here|https://github.com/kiegroup/jbpm/blob/ccddd0812225ec7666111700e4138d3a32a28b66/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-suite/src/main/java/org/jbpm/remote/ejb/test/mock/WebService.java#L47].
> So basically a code in the container is trying to connect to a WebService not 
> deployed on that container.
> At first, the test creates a dynamic client 
> [here|https://github.com/kiegroup/jbpm/blob/master/jbpm-workitems/jbpm-workitems-webservice/src/main/java/org/jbpm/process/workitem/webservice/WebServiceWorkItemHandler.java#L410]
>  (classloader used is *Thread.currentThread().getContextClassLoader()*, its 
> toString method says "ModuleClassLoader for Module 
> "deployment.ejb-services-app.war" from Service Module Loader" - so it is 
> basically a classloader for the deployed application), but it fails to do 
> that with an exception:
> *Unable to create JAXBContext for generated packages: "org.jboss.sepro" 
> doesnt contain ObjectFactory.class or jaxb.index*
> However, this is not the root cause. I debugged it and the root cause is 
> following. When the client is being created, it downloads WSDL and then 
> creates a classes for marshalling/unmarshalling using XJC. Classes are 
> generated, I can find them in /tmp folder which is created by the code in 
> [DynamicClientFactory.java|https://github.com/apache/cxf/blob/4f9923c32688c57e31f933c69d9c2a667f20d63d/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java#L366].
>  After that, it's time for compilation which unfortunately fails in 
> [DynamicClientFactory#compileJavaSrc|https://github.com/apache/cxf/blob/4f9923c32688c57e31f933c69d9c2a667f20d63d/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java#L389].
>  When I dug deeper, I found that the classpath for compilation is set to "" 
> (or rather not set) in 
> [DynamicClientFactory#setupClasspath|https://github.com/apache/cxf/blob/4f9923c32688c57e31f933c69d9c2a667f20d63d/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java#L674]
>  method. I guess this is fine, since it is only filled in case a 
> URLClassLoader is used or in case we are in WebLogic, so there is a weblogic 
> classloader. But since we are using just 
> Thread.currentThread().getContextClassLoader(), which is not of type 
> URLClassLoader, it does nothing. Then, before the compilation itself, CXF 
> sets arguments for a compiler in 
> [Compiler#addArgs|https://github.com/apache/cxf/blob/4f9923c32688c57e31f933c69d9c2a667f20d63d/core/src/main/java/org/apache/cxf/common/util/Compiler.java#L104]
>  method. Here you can see it uses 
> [java.class.path|https://github.com/apache/cxf/blob/4f9923c32688c57e31f933c69d9c2a667f20d63d/core/src/main/java/org/apache/cxf/common/util/Compiler.java#L105]
>  system property to set the classpath. However, since we are on EAP, the 
> java.class.path is set to:
> */home/mmacik/Workspace/jbpm/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-suite/target/cargo/installs/jboss-eap-7.2.0.GA.CR2/jboss-eap-7.2/jboss-modules.jar*
> and that's it. The code doesn't pass there anything else, just this one JAR 
> file.
> And now why it fails. I copied the classes generated by XJC and tried to 
> compile them by myself (since programmatic way returns only true/false) using 
> javac and they doesn't compile since JAXB annotations (JAXP-API 

[jira] [Commented] (CXF-8188) MP Rest Client 1.4: Inject into ClientHeadersFactory

2020-02-11 Thread Andy McCright (Jira)


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

Andy McCright commented on CXF-8188:


[~coheigea], sorry I missed this earlier, but yes, it can be resolved.  I'm 
planning to update the POM to use the newly released MP Rest Client 1.4.0 
dependency now.  Thanks!

> MP Rest Client 1.4: Inject into ClientHeadersFactory
> 
>
> Key: CXF-8188
> URL: https://issues.apache.org/jira/browse/CXF-8188
> Project: CXF
>  Issue Type: New Feature
>  Components: MicroProfile
>Reporter: Andy McCright
>Assignee: Andy McCright
>Priority: Minor
> Fix For: 3.4.0, 3.3.6
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> MicroProfile Rest Client 2.0 is adding injection support into 
> ClientHeadersFactory instances - see [Support for injection in 
> ClientHeadersFactory|https://github.com/eclipse/microprofile-rest-client/issues/234]
>  for more details.
>  
> This feature must implement `@Context` injection when the rest client is 
> invoked in the context of a JAX-RS resource and/or `@Inject` injection when 
> the ClientHeadersFactory is managed by CDI.



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


[jira] [Resolved] (CXF-8194) MicroProfile Rest Client 1.4 Implementation

2020-02-11 Thread Andy McCright (Jira)


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

Andy McCright resolved CXF-8194.

Resolution: Fixed

> MicroProfile Rest Client 1.4 Implementation
> ---
>
> Key: CXF-8194
> URL: https://issues.apache.org/jira/browse/CXF-8194
> Project: CXF
>  Issue Type: New Feature
>  Components: MicroProfile
>Reporter: Andy McCright
>Assignee: Andy McCright
>Priority: Minor
> Fix For: 3.4.0, 3.3.6
>
>
> Implement MicroProfile Rest Client 1.4.  This includes the following new 
> features (taken from the MP Rest Client 1.4-RC1 release page[1] ):
>  * Injection into ClientHeadersFactory (Implemented in CXF-8188 [2]).
>  * Adding `@Target` annotation to `@RestClient` - API change - should not 
> require CXF change.
>  * Removed recursive classloader check when resolving service loader for Rest 
> Client SPI - API/SPI change - should not require CXF change - but should be 
> tested.
>  * TCK changes - should not require CXF changes, but should be tested.
>  * Javadoc fixes - should not require CXF changes.
>  
> Everything should be implemented now except for actually switching to the new 
> level of the API and TCK.  Due to some of the TCK changes, this will also 
> require updates to the unit tests (some unit tests re-use TCK classes that 
> have been changed in the 1.4 release).
>  
> [1] [https://github.com/eclipse/microprofile-rest-client/releases/tag/1.4-RC1]
> [2] https://issues.apache.org/jira/browse/CXF-8188



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