У меня есть 2 SOAP приложения веб-службы - Потребитель и Производитель, оба выполняются в отдельных экземплярах Wildfly на моей Ma c.
- Wildfly с источником работает в контейнере docker.
- Wildfly с потребителем работает в экземпляре wildfly
, работающем на моей маме c.
Теперь, когда Потребитель звонит через веб-службу, я сталкиваюсь со следующим исключением
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
at com.sample.consumers.RequestMessageConsumer.getResponse(RequestMessageConsumer.java:885) [classes:?]
at com.sample.services.jms.MessageListener.onMessage(MessageListener.java:106) [classes:?]
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:761) [spring-jms-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:699) [spring-jms-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:674) [spring-jms-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:318) [spring-jms-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:245) [spring-jms-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1189) [spring-jms-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1179) [spring-jms-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1076) [spring-jms-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: javax.xml.ws.soap.SOAPFaultException: Fault occurred while processing.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161) ~[cxf-rt-frontend-jaxws-3.1.6.jar:3.1.6]
at com.sun.proxy.$Proxy806.externalDocument(Unknown Source) ~[?:?]
... 18 more
Caused by: org.apache.cxf.binding.soap.SoapFault: Fault occurred while processing.
at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.unmarshalFault(Soap12FaultInInterceptor.java:155) ~[cxf-rt-bindings-soap-3.1.6.jar:3.1.6]
at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:66) ~[cxf-rt-bindings-soap-3.1.6.jar:3.1.6]
at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:52) ~[cxf-rt-bindings-soap-3.1.6.jar:3.1.6]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:112) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69) ~[cxf-rt-bindings-soap-3.1.6.jar:3.1.6]
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34) ~[cxf-rt-bindings-soap-3.1.6.jar:3.1.6]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670) ~[cxf-rt-transports-http-3.1.6.jar:3.1.6]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551) ~[cxf-rt-transports-http-3.1.6.jar:3.1.6]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348) ~[cxf-rt-transports-http-3.1.6.jar:3.1.6]
at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:56) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:216) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651) ~[cxf-rt-transports-http-3.1.6.jar:3.1.6]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277) ~[cxf-core-3.1.6.jar:3.1.6]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) ~[cxf-rt-frontend-simple-3.1.6.jar:3.1.6]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139) ~[cxf-rt-frontend-jaxws-3.1.6.jar:3.1.6]
at com.sun.proxy.$Proxy806.externalDocument(Unknown Source) ~[?:?]
... 18 more
Проблема возникает: -
Caused by: org.apache.cxf.binding.soap.SoapFault: Fault occurred while processing.
Вышеприведенная трассировка стека основана на регистрации переменной stackTraceAsString - фрагмент кода ниже
Однако, не так много, чтобы дать представление о причине сбоя.
Я могу успешно вызвать веб-сервис Producer через SoapUI, работающий на моем Ma c.
. Я проверил URL-адрес конечной точки, настроенный для Consumer. Это то же самое, что и SoapUI.
Будем благодарны за любые предложения, чтобы понять причину и решение.
Заранее спасибо.
Пит
фрагмент кода
// get the web service operation to invoke for this request type.
final String webServiceOperation = getRequestOperation();
final Class<ProducerWebServiceInterface> clientProducerWebServiceInterface = ProducerWebServiceInterface.class;
// get the appropriate web service method to invoke
Method method = null;
WebServiceResponse serviceResponse = null;
try {
method = clientProducerWebServiceInterface.getMethod(webServiceOperation, type);
serviceResponse = (WebServiceResponse) method.invoke(client, operation);
}
catch (final SecurityException | NoSuchMethodException | IllegalArgumentException | IllegalAccessException exception) {
logError ( exception );
}
catch ( final Exception exception ) {
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
exception.printStackTrace(printWriter);
String stackTraceAsString = stringWriter.toString();
logError ( exception );
}
Кажется строка кода
return invoke0 (method, obj, args);
in класс NativeMethodAccessorImpl создает исключение InvocationTargetException, но все еще не знает, в чем причина. Params - метод, obj, args - все выглядит хорошо. Я определил это, установив точку прерывания в eclipse для прерывания в вхождении InvocationTargetException.
class NativeMethodAccessorImpl extends MethodAccessorImpl {
private final Method method;
private DelegatingMethodAccessorImpl parent;
private int numInvocations;
NativeMethodAccessorImpl(Method method) {
this.method = method;
}
public Object invoke(Object obj, Object[] args)
throws IllegalArgumentException, InvocationTargetException
{
// We can't inflate methods belonging to vm-anonymous classes because
// that kind of class can't be referred to by name, hence can't be
// found from the generated bytecode.
if (++numInvocations > ReflectionFactory.inflationThreshold()
&& !ReflectUtil.isVMAnonymousClass(method.getDeclaringClass())) {
MethodAccessorImpl acc = (MethodAccessorImpl)
new MethodAccessorGenerator().
generateMethod(method.getDeclaringClass(),
method.getName(),
method.getParameterTypes(),
method.getReturnType(),
method.getExceptionTypes(),
method.getModifiers());
parent.setDelegate(acc);
}
return invoke0(method, obj, args);