Weird behaviour with Quarkus + GraalVM + URLConnection - quarkus

I am testing the Quarkus capabilities for Travel Applications and I found a weird behaviour when I try to establish an URLConnection running in a GraalVM application
based on Quarkus. If I run a Native application:
./target/getting-started-1.0.0-SNAPSHOT-runner
and I Call the REST endpoint:
curl 'http://localhost:8080/api/v1/covid-restrictions'
then I receive the following error:
2022-06-01 17:38:43,844 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-0) HTTP Request to /api/v1/covid-restrictions failed, error id: f6130b71-c9fb-4a67-a996-c58fba695117-1: com.amadeus.exceptions.NetworkException: [---]
But when I run the same application as a Jar, everything is fine.
java -jar target/quarkus-app/quarkus-run.jar
One example to see the error here:
https://github.com/jabrena/quarkus-amadeus-sdk-demo
Do I need to configure the Quarkus app in some way for GraalVM?
I share the whole StackTrace if it could help:
2022-06-01 17:38:43,844 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-0) HTTP Request to /api/v1/covid-restrictions failed, error id: f6130b71-c9fb-4a67-a996-c58fba695117-1: com.amadeus.exceptions.NetworkException: [---]
at com.amadeus.HTTPClient.fetch(HTTPClient.java:372)
at com.amadeus.HTTPClient.execute(HTTPClient.java:358)
at com.amadeus.HTTPClient.unauthenticatedRequest(HTTPClient.java:253)
at com.amadeus.client.AccessToken.fetchAccessToken(AccessToken.java:67)
at com.amadeus.client.AccessToken.updateAccessToken(AccessToken.java:53)
at com.amadeus.client.AccessToken.lazyUpdateAccessToken(AccessToken.java:47)
at com.amadeus.client.AccessToken.getBearerToken(AccessToken.java:39)
at com.amadeus.HTTPClient.request(HTTPClient.java:339)
at com.amadeus.HTTPClient.get(HTTPClient.java:67)
at com.amadeus.dutyOfCare.diseases.Covid19AreaReport.get(Covid19AreaReport.java:51)
at org.acme.CovidResource.hello(CovidResource.java:27)
at org.acme.CovidResource$quarkusrestinvoker$hello_a2fbfead069e804ef1bb0315d16c4dc5e7951978.invoke(Unknown Source)
at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:7)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:548)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:833)
at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)
Many thanks in advance.
Juan Antonio

As most APIs nowadays are, the Amadeus library is HTTPS only.
For Quarkus in native mode, you need to explicitly enable SSL in src/main/resources/application.properties (except for certain extensions, see the link below).
quarkus.ssl.native=true
See https://quarkus.io/guides/native-and-ssl
After adding this property you will get a different runtime error:
2022-06-02 00:45:25,381 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-0) HTTP Request to /api/v1/covid-restrictions failed, error id: 6d821ce1-23fd-4d88-8f63-992b6453830a-1: com.oracle.svm.core.jdk.UnsupportedFeatureError: Code that was considered unreachable by closed-world analysis was reached.
Try to register the following reflection classes (DiseaseAreaReport and all inner classes) as Amadeus will use GSON and therefore also Java reflection to apply the JSON String data to the DiseaseAreaReport POJO.
https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection
package org.acme;
import io.quarkus.runtime.annotations.RegisterForReflection;
#RegisterForReflection(targets = {
com.amadeus.Amadeus.class,
com.amadeus.HTTPClient.class,
com.amadeus.Params.class,
com.amadeus.Response.class,
com.amadeus.client.AccessToken.class,
com.amadeus.dutyOfCare.diseases.Covid19AreaReport.class,
com.amadeus.exceptions.ResponseException.class,
// com.amadeus.resources.DiseaseAreaReport and all inner classes
com.amadeus.resources.DiseaseAreaReport.class,
com.amadeus.resources.DiseaseAreaReport.Area.class,
com.amadeus.resources.DiseaseAreaReport.AreaAccessRestriction.class,
com.amadeus.resources.DiseaseAreaReport.AreaPolicy.class,
com.amadeus.resources.DiseaseAreaReport.AreaRestriction.class,
com.amadeus.resources.DiseaseAreaReport.AreaVaccinated.class,
com.amadeus.resources.DiseaseAreaReport.Border.class,
com.amadeus.resources.DiseaseAreaReport.DatedInformation.class,
com.amadeus.resources.DiseaseAreaReport.DatedQuarantineRestriction.class,
com.amadeus.resources.DiseaseAreaReport.DatedTracingApplicationRestriction.class,
com.amadeus.resources.DiseaseAreaReport.DeclarationDocuments.class,
com.amadeus.resources.DiseaseAreaReport.DiseaseCase.class,
com.amadeus.resources.DiseaseAreaReport.DiseaseInfection.class,
com.amadeus.resources.DiseaseAreaReport.DiseaseTestingRestriction.class,
com.amadeus.resources.DiseaseAreaReport.DiseaseVaccination.class,
com.amadeus.resources.DiseaseAreaReport.EntryRestriction.class,
com.amadeus.resources.DiseaseAreaReport.ExitRestriction.class,
com.amadeus.resources.DiseaseAreaReport.GeoCode.class,
com.amadeus.resources.DiseaseAreaReport.Link.class,
com.amadeus.resources.DiseaseAreaReport.MaskRestriction.class,
com.amadeus.resources.DiseaseAreaReport.Sources.class,
com.amadeus.resources.DiseaseAreaReport.Transportation.class,
com.amadeus.resources.DiseaseAreaReport.ValidityPeriod.class,
com.amadeus.resources.Resource.class
})
public class AmadeusReflection {
}
I hope this fixes this issue, if not dig deeper which classes or inner classes are missing to be registered for reflection with a debugger or following the stack trace.
P.S. your test shows the following warnings:
[WARNING] [io.quarkus.resteasy.reactive.server.deployment.QuarkusServerEndpointIndexer] Quarkus detected the use of JSON in JAX-RS method 'org.acme.CovidResource#hello' but no JSON extension has been added. Consider adding 'quarkus-resteasy-reactive-jackson' or 'quarkus-resteasy-reactive-jsonb'.
[WARNING] [io.quarkus.resteasy.reactive.server.deployment.QuarkusServerEndpointIndexer] Quarkus detected the use of JSON in JAX-RS method 'org.acme.ConfigResource#hello' but no JSON extension has been added. Consider adding 'quarkus-resteasy-reactive-jackson' or 'quarkus-resteasy-reactive-jsonb'.
Consider to add the RESTEasy Reactive Jackson extension in the pom.xml:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>

Related

Getting exception "Not using JDBC" while using quarkus-hibernate-reactive-panache with quarkus-reactive-mysql-client - (Quarkus 1.12.2.Final)

Quarkus 1.12.2.Final
Getting the following exception while using reactive hibernate (quarkus-hibernate-reactive-panache) with reactive MySQL client (quarkus-reactive-mysql-client), kindly suggests what could be the issue.
2021-04-01 11:35:28,694 ERROR [org.hib.eng.jdb.spi.SqlExceptionHelper] (Quarkus Main Thread) Not using JDBC
2021-04-01 11:35:28,727 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.sql.SQLException: Not using JDBC
at org.hibernate.reactive.provider.service.NoJdbcConnectionProvider.getConnection(NoJdbcConnectionProvider.java:25)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)
Some details
My application.properties
quarkus.datasource.jdbc=false
quarkus.datasource.db-kind=mysql
quarkus.datasource.username=root
quarkus.datasource.password=root
quarkus.datasource.reactive.url=mysql://localhost:3306/mydb
quarkus.datasource.reactive.max-size=20
My Repository Implementation
#ApplicationScoped public class EventRepository implements PanacheRepository<Event> {
}
Change your application.properties to
quarkus.datasource.db-kind=mysql
quarkus.datasource.username=root
quarkus.datasource.password=root
quarkus.datasource.reactive.url=vertx-reactive:mysql://localhost:3306/mydb
quarkus.datasource.reactive.max-size=20
Here is the cause of the problem -> I used property "quarkus.hibernate-orm.database.generation=update". It seems like the use of this property requires JDBC connection, removed it, and it's working fine.
Any of the below config sets can work.
quarkus.datasource.db-kind=mysql
quarkus.datasource.username=****
quarkus.datasource.password=****
quarkus.datasource.reactive.url=mysql://localhost:3306/db
or
quarkus.datasource.reactive.url=vertx-reactive:mysql://localhost:3306/db
"The latest version available of Hibernate Reactive doesn't support schema update and validation yet."
Relative issue here:
Not using JDBC problem met in native build · Issue #19918 · quarkusio/quarkus · GitHub
Can you try to add the following property to your settings?
quarkus.hibernate-orm.database.generation=update
You can write drop-and-create to re-create your db when you run your server as well. See details here.
Hmm. JDBC and Hibernate update should work in your case. Do you have a JDBC extension (dependency) in your project? If not, try to ad one.
In case of a postgres you can add extension this way:
./mvnw quarkus:add-extension -Dextensions="jdbc-postgresql
More info here
Add the agroal extension plus one of jdbc-db2, jdbc-derby, jdbc-h2, jdbc-mariadb, jdbc-mssql, jdbc-mysql, jdbc-oracle or jdbc-postgresql.
https://quarkus.io/guides/datasource
Add this dependency to your pom.xml file.
<!-- https://mvnrepository.com/artifact/io.quarkus/quarkus-jdbc-postgresql -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
<version>2.9.2.Final</version>
</dependency>

java.Sql.SQLException, Cannot load class net.ucanaccess.jdbc.UcanaccessDriver

I tried to connect my MS Access Database in Mulesoft using Ucanaccess driver but it raises error Could not load class net.ucanaccess.jdbc.UcanaccessDriver. I have imported all the required JAR's and added the required dependencies in pom.xml also but still it gives same error. I have attached all nescessary details of the problem. Java version - 8, Ucanaccess driver version - 5.0.1 Any suggestion or guidance to proceed further would be helpful for me.
Error Stack Trace
org.mule.runtime.api.connection.ConnectionException: Could not obtain connection from data source
org.mule.runtime.api.connection.ConnectionException: Could not obtain connection from data source
Caused by: org.mule.extension.db.api.exception.connection.ConnectionCreationException: Could not obtain connection from data source
Caused by: java.sql.SQLException: Error trying to load driver: net.ucanaccess.jdbc.UcanaccessDriver : Cannot load class 'net.ucanaccess.jdbc.UcanaccessDriver': [
net.ucanaccess.jdbc.UcanaccessDriver,
Cannot load class 'net.ucanaccess.jdbc.UcanaccessDriver': [
Class 'net.ucanaccess.jdbc.UcanaccessDriver' has no package mapping for region 'domain/default/app/tooling-application-85e45b90-5bac-11eb-84c6-ccd9aca566c1'.,
Cannot load class 'net.ucanaccess.jdbc.UcanaccessDriver': [
Class 'net.ucanaccess.jdbc.UcanaccessDriver' has no package mapping for region '/domain/default'.
Database Config
Pom.xml Dependencies
External Jar
Looks like you need to add the JDBC driver libraries as shared libraries in the pom.xml.
See the documentation at https://docs.mulesoft.com/mule-runtime/4.3/mmp-concept#configure-shared-libraries on how to configure.
Example (you might need to add other libraries):
<sharedLibraries>
<sharedLibrary>
<groupId>net.sf.ucanaccess</groupId>
<artifactId>ucanaccess</artifactId>
</sharedLibrary>
</sharedLibraries>

JMeter HTTP2 request error (Java 8, JMeter 5.1)

I have java 1.8.0_151 installed and JMeter 5.1. Trying to send HTTP2 request getting the following error:
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: No Client ALPNProcessors!
at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:138)
at com.blazemeter.jmeter.http2.sampler.HTTP2Connection.connect(HTTP2Connection.java:69)
at com.blazemeter.jmeter.http2.sampler.HTTP2Request.setConnection(HTTP2Request.java:280)
at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:140)
at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:117)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: No Client ALPNProcessors!
at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.<init>(ALPNClientConnectionFactory.java:57)
at org.eclipse.jetty.http2.client.HTTP2Client.lambda$doStart$1(HTTP2Client.java:155)
at org.eclipse.jetty.http2.client.HTTP2Client$ClientSelectorManager.newConnection(HTTP2Client.java:438)
at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:222)
at org.eclipse.jetty.io.ManagedSelector.access$1500(ManagedSelector.java:60)
at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:825)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:754)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:672)
... 1 more
Suppressed: java.lang.IllegalStateException: org.eclipse.jetty.alpn.ALPN must be on JVM boot classpath
at org.eclipse.jetty.alpn.java.client.OpenJDK8ClientALPNProcessor.init(OpenJDK8ClientALPNProcessor.java:43)
at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.<init>(ALPNClientConnectionFactory.java:77)
... 8 more
I have downloaded alpn-boot-8.1.11.v20170118.jar (according to my java version) to jmeter\lib folder and added the following record to jmeter.bat: set JVM_ARGS="-Xbootclasspath/p:D:\apache-jmeter-5.1\apache-jmeter-5.1\lib\alpn-boot-8.1.11.v20170118.jar;". HTTP2 request still cannot be sent properly. What I missed? Thank you in advance 😊
Your steps look good, I can only think of 2 reasons for the HTTP2 Sampler not working:
Wrong path to the alpn-boot library, you can check it using dir command like:
dir d:\apache-jmeter-5.1\apache-jmeter-5.1\lib\alpn-boot-8.1.11.v20170118.jar
you should see something like:
Check the Java version JMeter is using as it might pick up not the 1.8.0_151, but the one which comes first in PATH. In order to ensure that JMeter is using the correct Java runtime you can explicitly declare it in jmeter.bat file:
set PATH=d:\java\bin;%PATH%
And finally you can use JSR223 Sampler to print Java version and effective Java arguments, the relevant code would be something like:
log.info('Java version: ' + System.getProperty('java.version'))
java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments().each {
log.info("Effective JVM argument: " + "$it")
}
If the above checklist items are applied you should be able to normally execute HTTP2 requests:
Also be aware that according to 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure you should always be using the latest version of JMeter so consider upgrading to JMeter 5.2 (or whatever is the latest stable version available at JMeter Downloads page) as soon as possible.
Check this thread also:
HTTP2 request sample crashes with Jmeter4, Java 10 No Client ALPNProcessors .
It says here: In particular, the jetty-alpn-openjdk8-client dependency is invalid and not appropriate for Java 9+. For Java 9+, the jetty-alpn-java-client should be used instead.

DataValidationException when I create actuator endpoints

I have created Actuator endpoints in endpoints.yml file
info:
'#name#':
version: '#version#'
buildNumber: '#buildNumber#'
buildDate: '#buildDate#'
buildBranch: '#buildBranch#'
When I try to execute I am getting a weird error:
{"errorType":"NOT_FOUND","entity":null,"message":"No message available","fieldErrors":null}
In the console it says
c.c.c.errors.BaseControllerAdvice - An unhandled exception was thrown, returning 500
org.springframework.data.rest.webmvc.ResourceNotFoundException: Resource not found!
Expected output looks like
{"${spring":{"application":{"name}":{"version":"#version#","buildNumber":"#buildNumber#","buildDate":"#buildDate#","buildBranch":"#buildBranch#"}}}}
What might be causing this Error?
I have added Dependency in order to enable the actuator points in order to know the info , health of the project the dependency which you need to add is
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId></dependency>

Why wsdl2java generated code use CXF dependencies at will?

I use Apache CXF 3.0.4 wsdl2java to generate code from this wsdl with following command:
./wsdl2java -client -exsh true -d weather -p weather -verbose url
As far as I know wsdl2java generates pure java code using only JAX-WS. Generated code works fine without any additional library/dependency. I've grepped it to find any CXF classes, but it seems to be free from CXF. The problem flows out when I add specific CXF dependency to my pom.xml. This dependency is:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.1.0</version>
</dependency>
After adding this, application seems to use different implementation of JAX-WS( is it even possible?).
Generated code contains among other things WeatherSoap interface. One of it's methods is getWeatherInformation()
#WebService(targetNamespace = "http://ws.cdyne.com/WeatherWS/", name = "WeatherSoap")
#XmlSeeAlso({ObjectFactory.class})
public interface WeatherSoap {
/**
* Gets Information for each WeatherID
*/
#WebResult(name = "GetWeatherInformationResult", targetNamespace = "http://ws.cdyne.com/WeatherWS/")
#RequestWrapper(localName = "GetWeatherInformation", targetNamespace = "http://ws.cdyne.com/WeatherWS/", className = "weather.GetWeatherInformation")
#WebMethod(operationName = "GetWeatherInformation", action = "http://ws.cdyne.com/WeatherWS/GetWeatherInformation")
#ResponseWrapper(localName = "GetWeatherInformationResponse", targetNamespace = "http://ws.cdyne.com/WeatherWS/", className = "weather.GetWeatherInformationResponse")
public weather.ArrayOfWeatherDescription getWeatherInformation();
...
}
Without cxf-rt-frontend-jaxws dependency
Step into getWeatherInformation() while debugging leads to GetWeatherInformation( another generated class.
Step into GetWeatherInformation leads to com.oracle.webservices.internal.api.message.BasePropertySet
...
Result from SOAP webservice received.
With cxf-rt-frontend-jaxws dependency
Step into getWeatherInformation while debugging leads to org.apache.cxf.jaxws.JaxWsClientProxy (why?)
...
Exception is thrown:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not find conduit initiator for address: http://wsf.cdyne.com/WeatherWS/Weather.asmx and transport: http://schemas.xmlsoap.org/soap/http
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
at com.sun.proxy.$Proxy33.getWeatherInformation(Unknown Source)
at weather.WeatherSoap_WeatherSoap_Client.main(WeatherSoap_WeatherSoap_Client.java:49)
Caused by: java.lang.RuntimeException: Could not find conduit initiator for address: http://wsf.cdyne.com/WeatherWS/Weather.asmx and transport: http://schemas.xmlsoap.org/soap/http
at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:224)
at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:229)
at org.apache.cxf.endpoint.AbstractConduitSelector.createConduit(AbstractConduitSelector.java:145)
at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:107)
at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63)
at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:853)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:511)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
... 2 more
I know that there is workaround for this exception which is mentioned here and it works. But not for my work application. It throws NPE after all:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: java.lang.NullPointerException
...
Caused by: org.apache.cxf.binding.soap.SoapFault: java.lang.NullPointerException
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:86)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:52)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:41)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:802)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1642)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1533)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1336)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
... 7 more
Question time
Why Apache-CXF is used even when application works fine without it?
Is it possible to force application to stop using Apache-CXF in this case?
I don't need this dependencies for client( since it works fine without them). I just want to produce SOAP as well. And thats why I need this dependencies. The only solution which I see is to split application into separate consumer and producer.
application seems to use different implementation of JAX-WS( is it even possible?).
Yes. CXF have it's own jax-ws provider and it's jar contains a service file declaring it. (when the JVM needs a jax-ws provider: it looks on the classpath to see if there is a non-default provider declared... and if any use it).
Why ?
That's the Java specs : http://docs.oracle.com/javaee/5/api/javax/xml/ws/spi/Provider.html#provider()
Is it possible to force application to stop using Apache-CXF in this case?
Yes. Create the appropriate resource file on your classpath to redirect to the default implementation.
In details : the file must be here : META-INF/services/javax.xml.ws.spi.Provider (if you use maven: put it simply here : /src/main/resources/META-INF/services/javax.xml.ws.spi.Provider)
And it must contains one single line :
javax.xml.ws.spi.Provider

Resources