quarkiverse / quarkus-cxf Goto Github PK
View Code? Open in Web Editor NEWQuarkus CXF Extension to support SOAP based web services.
License: Apache License 2.0
Quarkus CXF Extension to support SOAP based web services.
License: Apache License 2.0
I have generated Java code from a third-party WSDL. The generate code makes extensive use of response/request wrappers. One of the response wrappers looks like this (slightly trimmed down):
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"scmdSignResult"
})
@XmlRootElement(name = "SCMDSignResponse")
public class SCMDSignResponse {
@XmlElementRef(name = "SCMDSignResult", namespace = "http://Ama.Authentication.Service/", type = JAXBElement.class, required = false)
protected JAXBElement<SignStatus> scmdSignResult;
public JAXBElement<SignStatus> getSCMDSignResult() {
return scmdSignResult;
}
public void setSCMDSignResult(JAXBElement<SignStatus> value) {
this.scmdSignResult = value;
}
}
Notice the differences between the field name, the XML element name in the annotation and the getter/setter names.
When I try to compile my application natively I get the following exception:
com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: service.authentication.ama.SCMDSignResponse.setScmdSignResult(javax.xml.bind.JAXBElement). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
It seems clear that such error occurs because the code is trying to call setScmdSignResult()
instead of setSCMDSignResult()
which has different capitalization. The root cause seems to be that the extension code is trying to derive the setter name from the field name which, at this point, has already lost most of the capitalization information. Instead, it should probably look at the @XmlElementRef
annotation and use its value if present.
My application exposes a quarkus REST service that is also a client of an external CXF service, using quarkiverse-cxf extension. The application itself does not expose any CXF service, it only need to act as a client. Since I upgraded from v. 0.2 to v. 0.3 I receive a NullPointerException in response to any resource requested (even those unrelated to CXF calls, e.g. index.html).
Stacktrace:
java.lang.NullPointerException at io.quarkiverse.cxf.transport.CxfHandler.process(CxfHandler.java:249) at io.quarkiverse.cxf.transport.CxfHandler.handle(CxfHandler.java:193) at io.quarkiverse.cxf.transport.CxfHandler.handle(CxfHandler.java:38) at io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48) at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:834)
The WS call was working fine in v. 0.2. In both cases quarkus version is 1.10.5.Final and JDK version is AdoptOpenJdk 11.
To exclude external interferences I reproduced the problem in a minimal application (quarkus getting-started + a simple @webservice annotated interface, with no implementor and no registration as a client: the only presence of a @webservice annotated interface seems to cause the problem).
`
package org.acme;
import javax.jws.WebMethod;
import javax.jws.WebService;
@webservice
public interface ProvaWs {
@webmethod
public String doSomething();
}
`
Note: in v.0.3 it seems that quarkus, at startup, tries to instantiate a web service endpoint even if there is no endpoint registered in application.properties (maybe because it finds a @WebServce annotated interfaces by introspection?):
2021-01-08 09:11:39,701 INFO [org.apa.cxf.wsd.ser.fac.ReflectionServiceFactoryBean] (build-5) Creating Service {http://acme.org/}ProvaWsService from class org.acme.ProvaWs 2021-01-08 09:11:39,731 WARN [io.qua.cxf.dep.QuarkusCxfProcessor] (build-5) capture generation of org.acme.jaxws_asm.package-info 2021-01-08 09:11:39,734 WARN [io.qua.cxf.dep.QuarkusCxfProcessor] (build-5) capture generation of org.acme.jaxws_asm.DoSomething 2021-01-08 09:11:39,739 WARN [io.qua.cxf.dep.QuarkusCxfProcessor] (build-5) capture generation of org.acme.jaxws_asm.DoSomethingResponse 2021-01-08 09:11:39,963 WARN [io.qua.cxf.CXFRecorder] (Quarkus Main Thread) recorder CXFClientInfoSupplier 2021-01-08 09:11:39,964 WARN [io.qua.cxf.CXFServletInfos] (Quarkus Main Thread) new CXFServletInfos 2021-01-08 09:11:39,964 INFO [io.qua.cxf.CXFRecorder] (Quarkus Main Thread) init server 2021-01-08 09:11:39,965 INFO [io.qua.cxf.tra.CxfHandler] (Quarkus Main Thread) CxfHandler created 2021-01-08 09:11:39,966 WARN [io.qua.cxf.tra.CxfHandler] (Quarkus Main Thread) no info transmit to servlet
I'm seeing several deployment issues. I have a system that is running OK in Quarkus Dev mode but fails as an uber-jar in Docker. I've made some progress getting further:
The WebService implementation is not in the uber-jar. Adding @Unremovable
resolves this, however would it make sense to include them automatically if they are annotated @WebService
? I note that you are currently not looking for this annotation and requiring quarkus.cxf.endpoint."xxx".implementor=SomeClass
instead.
Following error occurs:
ERROR [io.quarkus.runtime.Application] 'main' Failed to start application (with profile dev): org.apache.cxf.BusException: No binding factory for namespace http://schemas.xmlsoap.org/wsdl/soap/ registered. at org.apache.cxf.bus.managers.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:348) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFactoryBean.java:182) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:268) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:146) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211) at io.quarkiverse.cxf.transport.CxfHandler.<init>(CxfHandler.java:122) at io.quarkiverse.cxf.CXFRecorder.initServer(CXFRecorder.java:142) at io.quarkus.deployment.steps.QuarkusCxfProcessor$startRoute-1341485114.deploy_0(QuarkusCxfProcessor$startRoute-1341485114.zig:305) at io.quarkus.deployment.steps.QuarkusCxfProcessor$startRoute-1341485114.deploy(QuarkusCxfProcessor$startRoute-1341485114.zig:40) at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:729) at io.quarkus.runtime.Application.start(Application.java:90) at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:97) at io.quarkus.runtime.Quarkus.run(Quarkus.java:62) at io.quarkus.runtime.Quarkus.run(Quarkus.java:38) at io.quarkus.runtime.Quarkus.run(Quarkus.java:104) at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
I think there are several META-INF/cxf/*.txt
files that need to be copied to the uber-jar. We have the same issue with our home-grown solution.
[WARNING]
[WARNING] Some problems were encountered while building the effective model for io.quarkiverse.cxf:quarkus-cxf:jar:0.1.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec:jar -> duplicate declaration of version (?) @ line 69, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
currently, we use the class generated and inject it through substitution.
Goal here is to ask cxf to modify lib to allow injection of class on jvm part.
I have open a ticket on cxf jira for that :
https://issues.apache.org/jira/browse/CXF-8366
next is to push a pull request to them and used the code added.
http://cxf.apache.org/docs/jaxrs-services-configuration.html states:
When service classes and providers are registered this way, the default life-cycle is 'singleton'. You can override it by setting a "jaxrs.scope" parameter with the value of 'prototype' (equivalent to per-request).
Trying
@RequestScoped
@WebService(endpointInterface = "org.acme.cxf.FruitWebService")
public class FruitWebServiceImpl implements FruitWebService {
@Override
List<Fruit> list() { .. }
}
does not work. I'm getting
Caused by: javax.enterprise.context.ContextNotActiveException
at io.quarkus.arc.impl.ClientProxies.getDelegate(ClientProxies.java:40)
at FruitWebService_ClientProxy.arc$delegate(FruitWebService_ClientProxy.zig:xx)
at FruitWebService_ClientProxy.list(FruitWebService_ClientProxy.zig:xx)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)
Background: The need for a request scoped webservice is that I want to inject a request scoped dependency, especially a a request scoped entity manager.
Hello quarkiverse-cxf,
I'm trying to use "@Inject" in my WebService like illustrated below.
It is not working for reasons unkown to me:
Would you mind to clarify? Especially also how to get my webservice in request scope (performance is not an issue in my case).
@WebService(endpointInterface = "org.acme.cxf.FruitWebService")
public class FruitWebServiceImpl implements FruitWebService {
@Inject
FruitStore store; // some backend service, contains Apple, Pineapple ..
@PostConstruct
void postConstruct() {
System.out.println("store: " + store); // output is: "store: null"
}
..
}
Thanks in advance.
Hi,
on native mode i got the error Method not found for, e.g. getNormal(), so the method is called isNormal() because it is a boolean.
On jvm mode this will work. This is a POJO used by an Endpoint.
Or Should i switch to getNormal() for boolean values?
Thanks
Hello,
It seems that cdi injected beans are always null in the Implemention classes.
Is this according to design or a bug?
There seems to be an issue with the dependabot generated pull request at #20 with the build failing. Doing the same cxf version bump here to see if the build passes as it's supposed to.
To support multiple environments (like test, staging, production) with a single image, endpoints have to be overridable at runtime. My tests suggest that this is not possible right now:
my.service.endpoint=http://localhost:8080
quarkus.cxf.endpoint."/MyService_V_1".client-endpoint-url=${SERVICE_ENDPOINT_URL:${my.service.endpoint}}
Setting SERVICE_ENDPOINT_URL at runtime doesnt change the effective value (being the localhost-default).
TODO:
remarque check mongo code pattern:
https://github.com/quarkusio/quarkus/blob/master/extensions/mongodb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/MongoClientProcessor.java#L265
Hi,
after upgrading from 0.2 to 0.3 the following principle is null:
@Resource
WebServiceContext context;
....
_logger.error("auth: " + context.getUserPrincipal());
log:
auth: null
the IndentityProvider will have a principle, maybe this is regarding the update to vert.x?
Thanks
Phil
idea: create a builditem for wrapper generation and move code generation in it and reflection build item and unremovable too
create build step based on this build item to create new build item to generate wrapperHelper.
Idea is to have build item for all class generation. and pass setters/getters and ctor thanks to that. it will reduce size of quarkuscxfprocessor and avoid long function with a long list of parametters.
maybe it will directely work but need test to validate.
Quarkus Version: 1.9.2.Final
JDK: OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
I have follow problem when create native build.
Thaks for your great effort to provide this extension
Comment: => with latest Version of "com.github.shumonsharif->cxf" i was able to do a native build
Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported field java.net.URL.handlers is reachable To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time. Detailed message: Trace: at parsing java.net.URL.setURLStreamHandlerFactory(URL.java:1213) Call path from entry point to java.net.URL.setURLStreamHandlerFactory(URLStreamHandlerFactory): at java.net.URL.setURLStreamHandlerFactory(URL.java:1205) at com.oracle.svm.reflect.URL_setURLStreamHandlerFactory_8b4d2aa28c41f22bcb499464d696277608a31df4_1301.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:566) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl.execute(AutomaticWorkQueueImpl.java:439) at io.quarkus.vertx.http.runtime.filters.accesslog.DefaultAccessLogReceiver.run(DefaultAccessLogReceiver.java:205) at java.lang.Thread.run(Thread.java:834) at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:517) at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192) at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0) com.oracle.svm.core.util.UserError$UserException: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported field java.net.URL.handlers is reachable To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time. Detailed message:
my Project POM
4.0.0
ch.postfinance.taas
taas-pm-submN
203.0.0-SNAPSHOT
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<grpc.version>1.31.1</grpc.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<os-maven-plugin.version>1.6.2</os-maven-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
<protoc.version>3.12.4</protoc.version>
<quarkus-plugin.version>1.9.2.Final</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.9.2.Final</quarkus.platform.version>
<surefire-plugin.version>2.22.2</surefire-plugin.version>
<surefire-plugin.version>2.22.2</surefire-plugin.version>
<quarkiverse.cxf.version>0.1.1-SNAPSHOT</quarkiverse.cxf.version>
${quarkus.platform.group-id}
${quarkus.platform.artifact-id}
${quarkus.platform.version}
pom
import
io.quarkus
quarkus-resteasy
io.quarkus
quarkus-resteasy-jsonb
io.quarkus
quarkus-resteasy-mutiny
io.quarkus
quarkus-grpc
com.google.protobuf
protobuf-java
${protoc.version}
io.quarkus
quarkus-smallrye-openapi
io.quarkus
quarkus-smallrye-health
io.quarkus
quarkus-smallrye-metrics
io.quarkus
quarkus-junit5
test
io.rest-assured
rest-assured
test
org.awaitility
awaitility
test
org.assertj
assertj-core
test
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf</artifactId>
<version>${quarkiverse.cxf.version}</version>
</dependency>
currently, we use the class generated and inject it through substitution.
Goal here is to ask cxf to modify lib to allow injection of class on jvm part.
I have open a ticket on cxf jira for that :
https://issues.apache.org/jira/browse/CXF-8366
next is to push a pull request to them and used the code added.
advantage: speed up boot time
hi all,
when i try to use multiple endpoints:
application.properties:
quarkus.cxf.path=/ws
quarkus.cxf.endpoint."/v2.0/order".implementor=mypackage.server.OrderEndpoint
quarkus.cxf.endpoint."/v2.0/products".implementor=mypackage.server.ProductsEndpoint
for both will be the same service generated (the first found in order to the alphabet):
OrderService
From the Log:
Creating Service {urn:v2}OrderService from class mypackage.interfaces.Order
Creating Service {urn:v2}OrderService from class mypackage.interfaces.Products
Then iยดve got following error:
Application {urn:v2}OrderService#{urn:msv3:v2}getProducts has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: object is not an instance of declaring class while invoking public abstract .....
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:166)
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:267)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:140)
......
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
here is the git, we have to register an MR to be listed in:
https://github.com/quarkusio/quarkus-extension-catalog
Could you please add support for cxf-rt-security and cxf-rt-ws-security?
Is it possible to support the following:
switching logging on/off including sensitive value suppression
including headers
These are both features we require / use in our current homegrown solution like so:
LoggingFeature loggingFeature = new LoggingFeature();
loggingFeature.setPrettyLogging(true);
loggingFeature.addSensitiveElementNames(SENSITIVE_XML_TAGS);
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setFeatures(List.of(loggingFeature));
MyWebService service = factory.create(MyWebService.class);
AuthSoapHeader authHeader = new AuthSoapHeader();
authHeader.setStrUserName(username);
authHeader.setStrPassword(password);
Header soapHdr = new Header(AUTH_HEADER_NAME, authHeader, new JAXBDataBinding(AuthSoapHeader.class));
ClientProxy.getClient(service).getRequestContext().put(Header.HEADER_LIST, List.of(soapHdr));
Very interested in switching to this extension when / if it's possible for us to do so.
Describe the bug
Adding this extension to POM breaks Quarkus startup(?) when also using Camel Quarkus.
Expected behavior
This extension should work with Camel Quarkus extensions. Running mvn verify
with the example should result to success.
Actual behavior
Running Quarkus/test gives the following error:
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.jaxb.deployment.JaxbProcessor#processAnnotationsAndIndexFiles threw an exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
at io.quarkus.jaxb.deployment.JaxbProcessor.handleJaxbFile(JaxbProcessor.java:232)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1603)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at io.quarkus.jaxb.deployment.JaxbProcessor.processAnnotationsAndIndexFiles(JaxbProcessor.java:180)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at io.quarkus.jaxb.deployment.JaxbProcessor.handleJaxbFile(JaxbProcessor.java:223)
... 36 more
...
Caused by: io.quarkus.builder.BuildException:
Build failure: Build failed due to errors
[error]: Build step io.quarkus.jaxb.deployment.JaxbProcessor#processAnnotationsAndIndexFiles threw an exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
at io.quarkus.jaxb.deployment.JaxbProcessor.handleJaxbFile(JaxbProcessor.java:232)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1603)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at io.quarkus.jaxb.deployment.JaxbProcessor.processAnnotationsAndIndexFiles(JaxbProcessor.java:180)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at io.quarkus.jaxb.deployment.JaxbProcessor.handleJaxbFile(JaxbProcessor.java:223)
... 36 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
Caused by: java.lang.ClassNotFoundException: //org/apache/camel/model/AggregateDefinition
To Reproduce
Steps to reproduce the behavior:
mvn verify
quarkus-cxf
from POMmvn verify
and observe successSending the HTTP Basic authentication header during SOAP requests is a fairly common requirement. I propose this functionality be added to the clients generated by quarkiverse-cxf.
In practice, JaxWsProxyFactoryBean
already exposes the required methods to set the username and password. So this would be just a matter of exposing appropriate configuration parameters and forwarding the values to the relevant methods. I think I could try to create a PR for this, if you're interested.
I created an application to test this extension here https://github.com/AmsterdamFilho/quarkus-cxf-test
It exposes a rest endpoint that redirects the requests to a public soap web service (http://www.dneonline.com/calculator.asmx)
But I am getting an IllegalProductException: Normal scoped producer method may not return null
Am I doing something wrong or is this a problem with the extension?
In development mode, with live coding enabled, when I change something in source code and call any resource, server get broken with this error:
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 11 deployment problems: [1] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [2] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [3] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [4] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [5] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [6] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [7] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [8] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [9] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [10] Unsatisfied dependency for type java.lang.String and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.lang.String, qualifiers=[@ConfigProperty, @Any]] [11] Unsatisfied dependency for type java.util.List<java.lang.String> and qualifiers [@Default] - java member: io.quarkiverse.cxf.CXFClientInfo#<init>() - declared on CLASS bean [types=[io.quarkiverse.cxf.CXFClientInfo, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkiverse.cxf.CXFClientInfo] The following beans match by type, but none have matching qualifiers: - Bean [class=java.util.List, qualifiers=[@ConfigProperty, @Any]] at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1029) at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:241) at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:127) at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:411) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972) at io.quarkus.builder.BuildContext.run(BuildContext.java:277) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452) at java.base/java.lang.Thread.run(Thread.java:834) at org.jboss.threads.JBossThread.run(JBossThread.java:479) (....)
So you need to manually restart the server with mvn quarkus:dev
(Can reproduce the error on quarkus 1.10.5.Final, OpenJDK 11 + quarkiverse/cxf v. 0.2 and v.0.3)
In this line the value of attribute name
from annotation @WebService
is taken and then in this line that value is used to set the service name. This causes errors whenever port type name and service name don't happen to match.
This happens because, in an unintuitive twist, the name
attribute actually refers to the port type name and the service name is instead in the serviceName
attribute. You can confirm this in the javadoc.
To complicate matters further you can't have the serviceName
attribute in endpoint interfaces (SEIs) and tools like "wsdl2java" won't generate code with it there. More information here and here.
If you'd like to reproduce the issue, you can use the following configuration, after generating the appropriate classes from the WSDL:
quarkus.cxf.endpoint."calculator.asmx".wsdl=http://www.dneonline.com/calculator.asmx?wsdl
quarkus.cxf.endpoint."calculator.asmx".client-endpoint-url=http://www.dneonline.com
quarkus.cxf.endpoint."calculator.asmx".service-interface=org.tempuri.CalculatorSoap
quarkus.cxf.endpoint."calculator.asmx".endpoint-namespace=http://tempuri.org/
quarkus.cxf.endpoint."calculator.asmx".endpoint-name=CalculatorSoap
A quick fix could be to add two new configuration parameters for the name and namespace of the service (like you have for the endpoint). A more elaborate fix could make use of classes annotated with @WebServiceClient
which usually contain this information and are readily generated by tools like "wsdl2java".
I'm trying to invoke a remote SOAP service (of which I have only the WSDL) with this extension and I noticed the SOAPAction header is being sent as an empty string, which causes a SOAPFault in the remote service. My previous code, which made use of JAX-WS generated code only did not have the same problems.
For context, here's what I've done so far:
quarkus.cxf.endpoint."/SCMDService.svc".wsdl=https://preprod.cmd.autenticacao.gov.pt/Ama.Authentication.Frontend/SCMDService.svc?singleWsdl
quarkus.cxf.endpoint."/SCMDService.svc".client-endpoint-url=https://preprod.cmd.autenticacao.gov.pt/Ama.Authentication.Frontend
quarkus.cxf.endpoint."/SCMDService.svc".service-interface=service.authentication.ama.SCMDService
With this configuration in place, CXF logs the following relevant properties during the request:
ServiceName: SCMDServiceService
PortName: SCMDServicePort
PortTypeName: SCMDService
Headers: {SOAPAction="", Accept=/}
When compared to a request made using JAX-WS mechanisms, we get these instead (bold added to highlight differences):
ServiceName: SCMDService
PortName: BasicHttpBinding_SCMDService
PortTypeName: SCMDService
Headers: {SOAPAction="http://Ama.Authentication.Service/SCMDService/GetCertificate", Accept=/}
These are the actual values listed in the WSDL.
After some digging, I figured a way to fix the issue was to set the service name and the endpoint name on the factory bean in class AbstractCxfClientProducer
. Thus, I have added the following code:
WebService wsAnnotation = seiClass.getAnnotation(WebService.class);
if (wsAnnotation != null) {
factory.setServiceName(new QName(wsAnnotation.targetNamespace(), wsAnnotation.name()));
}
factory.setEndpointName(QName.valueOf("{http://Ama.Authentication.Service/}BasicHttpBinding_SCMDService"));
Feel free to use it if you see some value in it. Naturally, the endpoint name is currently hard-coded and should be replace by a configuration option, unless someone knows of a way of auto-magically discovering it.
Of course, maybe there's already a simpler way of doing this in which I'd just suggest adding it the documentation.
How to config CXF to send a request to a webservice for two way SSL connection?
I look in the docs of Apache CXF, there they have some xml to config , but how this will be in the application.properties?
cxf docs:
http://cxf.apache.org/docs/continuations.html
context: goal is to handle async on client and server side.
http://cxf.apache.org/docs/annotations.html#Annotations-org.apache.cxf.annotations.UseAsyncMethod%28since2.6.0%29
2) see if t possible to handle with uni (async use by quarkus) on the cxf ContinuationProvider
we have to register on quakus CI
here is the doc to proceed
https://github.com/quarkusio/quarkus-ecosystem-ci
Following error occurs during build using 0.1.1.
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.10.3.Final:build (default) on project my-cxf-svc: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkiverse.cxf.deployment.QuarkusCxfProcessor#build threw an exception: java.lang.NullPointerException
[ERROR] at io.quarkiverse.cxf.deployment.QuarkusCxfProcessor.build(QuarkusCxfProcessor.java:1126)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:479)
If you can provide any clues as to the potential issue I may be able to experiment / investigate further.
It would be beneficial (especially for new users) to have sample or getting started repository for quickly getting started with CXF on Quarkus. Even for those, who are already familiar with CXF could use this as a reference.
However, I stumbled about this since I am not very familiar with CXF. While getting a working application in JVM mode was quite easy, I was not able to get a working native compilation.
OS | Ubuntu Linux 20.04 |
Use Case | Client only |
Example Project | https://github.com/svassal/quarkus-cxf-client-test |
I'm currently trying to use this module to implement a SOAP client, but can't figure how to make it work like it should.
I don't think it's a bug though, rather a wrong configuration on my
My pom.xml is configured mostly like the one in the integration-tests directory.
Same goes for the application.properties.
When I execute the project, the SOAP objects are generated, I can access them inside from the main code.
So far, I tried with two public web services, namely :
But, if I try to call on the generated interface, I get an exception.
With the first web service I get this exception :
2021-01-26 18:38:55,307 WARN [org.acm.GreetingResource] (executor-thread-1) Could not find definition for port {http://www.dataaccess.com/webservicesserver/}TextCasing.: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for port {http://www.dataaccess.com/webservicesserver/}TextCasing.
at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:165)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:407)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:527)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:159)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
at io.quarkiverse.cxf.CxfClientProducer.loadCxfClient(CxfClientProducer.java:88)
at com.dataaccess.webservicesserver.TextCasingSoapTypeCxfClientProducer.createService(TextCasingSoapTypeCxfClientProducer.zig:47)
at com.dataaccess.webservicesserver.TextCasingSoapTypeCxfClientProducer_ProducerMethod_createService_5ca90d7954b19b046675be34d81b5996fed0b3d2_Bean.create(TextCasingSoapTypeCxfClientProducer_ProducerMethod_createService_5ca90d7954b19b046675be34d81b5996fed0b3d2_Bean.zig:201)
at com.dataaccess.webservicesserver.TextCasingSoapTypeCxfClientProducer_ProducerMethod_createService_5ca90d7954b19b046675be34d81b5996fed0b3d2_Bean.create(TextCasingSoapTypeCxfClientProducer_ProducerMethod_createService_5ca90d7954b19b046675be34d81b5996fed0b3d2_Bean.zig:232)
at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96)
at io.quarkus.arc.impl.AbstractSharedContext.access$000(AbstractSharedContext.java:14)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:17)
at com.dataaccess.webservicesserver.TextCasingSoapTypeCxfClientProducer_ProducerMethod_createService_5ca90d7954b19b046675be34d81b5996fed0b3d2_ClientProxy.arc$delegate(TextCasingSoapTypeCxfClientProducer_ProducerMethod_createService_5ca90d7954b19b046675be34d81b5996fed0b3d2_ClientProxy.zig:68)
at com.dataaccess.webservicesserver.TextCasingSoapTypeCxfClientProducer_ProducerMethod_createService_5ca90d7954b19b046675be34d81b5996fed0b3d2_ClientProxy.invertStringCase(TextCasingSoapTypeCxfClientProducer_ProducerMethod_createService_5ca90d7954b19b046675be34d81b5996fed0b3d2_ClientProxy.zig:257)
at org.acme.GreetingResource.hello(GreetingResource.java:26)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:643)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:507)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:457)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:459)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:419)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:393)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:68)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:249)
at io.quarkus.resteasy.runtime.ResteasyFilter$ResteasyResponseWrapper.service(ResteasyFilter.java:70)
at io.quarkus.resteasy.runtime.ResteasyFilter$ResteasyResponseWrapper.sendError(ResteasyFilter.java:76)
at io.undertow.servlet.handlers.DefaultServlet.doGet(DefaultServlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:503)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at io.quarkus.resteasy.runtime.ResteasyFilter.doFilter(ResteasyFilter.java:31)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:63)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:67)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:133)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:65)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:247)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:56)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:111)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:108)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$9$1.call(UndertowDeploymentRecorder.java:572)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:152)
at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$1.handleRequest(UndertowDeploymentRecorder.java:117)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:290)
at io.undertow.server.DefaultExchangeHandler.handle(DefaultExchangeHandler.java:18)
at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$5$1.run(UndertowDeploymentRecorder.java:398)
at io.quarkus.runtime.CleanableExecutor$CleaningRunnable.run(CleanableExecutor.java:231)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
And with the second, I get this one :
2021-01-26 17:40:33,370 WARN [org.acm.GreetingResource] (executor-thread-1) Could not find definition for service {http://gcomputer.net/webservices/}DilbertSoap.: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {http://gcomputer.net/webservices/}DilbertSoap.
at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:157)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:407)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:527)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:159)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
at io.quarkiverse.cxf.CxfClientProducer.loadCxfClient(CxfClientProducer.java:88)
at net.gcomputer.webservices.DilbertSoapCxfClientProducer.createService(DilbertSoapCxfClientProducer.zig:47)
at net.gcomputer.webservices.DilbertSoapCxfClientProducer_ProducerMethod_createService_975ddcb26eda23ff06137321e0527974ff4ea96a_Bean.create(DilbertSoapCxfClientProducer_ProducerMethod_createService_975ddcb26eda23ff06137321e0527974ff4ea96a_Bean.zig:201)
at net.gcomputer.webservices.DilbertSoapCxfClientProducer_ProducerMethod_createService_975ddcb26eda23ff06137321e0527974ff4ea96a_Bean.create(DilbertSoapCxfClientProducer_ProducerMethod_createService_975ddcb26eda23ff06137321e0527974ff4ea96a_Bean.zig:232)
at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96)
at io.quarkus.arc.impl.AbstractSharedContext.access$000(AbstractSharedContext.java:14)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:17)
at net.gcomputer.webservices.DilbertSoapCxfClientProducer_ProducerMethod_createService_975ddcb26eda23ff06137321e0527974ff4ea96a_ClientProxy.arc$delegate(DilbertSoapCxfClientProducer_ProducerMethod_createService_975ddcb26eda23ff06137321e0527974ff4ea96a_ClientProxy.zig:68)
at net.gcomputer.webservices.DilbertSoapCxfClientProducer_ProducerMethod_createService_975ddcb26eda23ff06137321e0527974ff4ea96a_ClientProxy.todaysDilbert(DilbertSoapCxfClientProducer_ProducerMethod_createService_975ddcb26eda23ff06137321e0527974ff4ea96a_ClientProxy.zig:128)
at org.acme.GreetingResource.hello(GreetingResource.java:25)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:643)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:507)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:457)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:459)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:419)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:393)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:68)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:249)
at io.quarkus.resteasy.runtime.ResteasyFilter$ResteasyResponseWrapper.service(ResteasyFilter.java:70)
at io.quarkus.resteasy.runtime.ResteasyFilter$ResteasyResponseWrapper.sendError(ResteasyFilter.java:76)
at io.undertow.servlet.handlers.DefaultServlet.doGet(DefaultServlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:503)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at io.quarkus.resteasy.runtime.ResteasyFilter.doFilter(ResteasyFilter.java:31)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:63)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:67)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:133)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:65)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:247)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:56)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:111)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:108)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$9$1.call(UndertowDeploymentRecorder.java:572)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:152)
at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$1.handleRequest(UndertowDeploymentRecorder.java:117)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:290)
at io.undertow.server.DefaultExchangeHandler.handle(DefaultExchangeHandler.java:18)
at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$5$1.run(UndertowDeploymentRecorder.java:398)
at io.quarkus.runtime.CleanableExecutor$CleaningRunnable.run(CleanableExecutor.java:231)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
I provided a link to my test project earlier.
You can easily switch between the two services, as there are only two commits, the second one being dedicated to the configuration for the second web service.
To reproduce, all you have to do is run the project :
./mvnw compile quarkus:dev
And access the REST web service :
curl 'http://localhost:8080/hello-resteasy'
check in jvm and native
native mean that createException in processor generate a good exception format.
CXF use a lot the bus-extensions.txt file inside different jar and used it to handle interface versus implementation.
Idea is to inject directly the list on native part to avoid a file loading.
with a big switch case and avoid reflection by doing directly the loading. And we can generate ReflectiveClassBuildItem for all implementation by reading bus-extensions.txt. To avoid to have the big list in cxf extension.
hi all,
i got following error when using request/response wrapper:
2020-12-02 21:48:52,634 WARN [io.qua.cxf.dep.QuarkusCxfProcessor] (build-1) wrapper class not found : de.test.UserRequestWrapper
Maybe classloading under QuarkusCxfProcessor has to be tuned for Request/Response wrapper classes:
wrapperClass = Class.forName(fullClassName);
to
wrapperClass = Thread.currentThread().getContextClassLoader().loadClass(fullClassName);
thanks
all interface inherited of com.sun.xml.txw2.TypedXmlWriter must generated a NativeImageProxyDefinitionBuildItem.
The list is hardcoded but best is to use jandex to find all inherited interface and load it.
Currently it is done for native mode but not in jvm goal is to reuse generated code for native in jvm to have :
Hello. I am getting lots of NoClassDefFoundError when i try to build native images using graalvm 11.
Build command:
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true
Error log:
https://gist.github.com/vhmolinar/3f9dfa9836b2006699d4c19bf4565a51
Version:
I tried with 0.1.0 and master. Not 0.1.1 as for some reason the service wasnt ever being deployed.
If necessary I can provide a project with example, but the simplest test will give the same errors above.
I have a HTTP webservice providing REST and SOAP endpoints:
Here's the REST service:
@RequestScoped
public class FruitResource {
@GET
@Path("/list")
@RolesAllowed("USER")
public List<String> list() {
final SecurityIdentity securityIdentity =CDI.current()
.select(SecurityIdentity.class)
.get();
System.out.println(securityIdentity.hasRole("USER"));
return Arrays.asList( .. );
}
}
Here's the "same" service as SOAP:
@WebService(endpointInterface = "org.acme.cxf.FruitWebService")
public class FruitWebServiceImpl implements FruitWebService {
@Override
@RolesAllowed("USER")
public List<String> list() {
final SecurityIdentity securityIdentity =CDI.current()
.select(SecurityIdentity.class)
.get();
System.out.println(securityIdentity.hasRole("USER"));
return Arrays.asList( .. );
}
This does not work at all. I'm getting a javax.enterprise.context.ContextNotActiveException: null
in io.quarkus.arc.impl.ClientProxies#getDelegate
while all works fine using the REST EP.
My configuration is rather simple:
quarkus.http.auth.basic=true
quarkus.security.users.embedded.enabled=true
quarkus.security.users.embedded.plain-text=true
quarkus.security.users.embedded.users.x=x
quarkus.security.users.embedded.roles.x=USER
quarkus.resteasy.path=/rest
quarkus.cxf.path=/soap
quarkus.cxf.endpoint."/fruit".implementor=org.acme.cxf.FruitWebServiceImpl
Not sure whether this is a bug. However, I somehow expect that configured (http) security works regardless of the service implementation.
Add @shumonsharif and @dufoli as contributors
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.