[
https://issues.apache.org/jira/browse/CXF-6655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14982313#comment-14982313
]
Akitoshi Yoshida commented on CXF-6655:
---------------------------------------
Alessio and I had an irc chat a few days ago and I described briefly how to
reproduce the problem and the cases where the problem doesn't occur.
The problem can be reproduced when using the same setup sequence as Jaume's
description. If the address is set earlier at the port creation as Jaume
comments above or somewhere before the conduit setup by setting
BindingProvider.ENDPOINT_ADDRESS_PROPERTY of the port, the problem does not
occur.
In other words, a workaround for new clients is to set
BindingProvider.ENDPOINT_ADDRESS_PROPERTY before the conduit setup to avoid
this issue. But I think this problem can be resolved somewhere in the cxf code
so that the setting the address at the end should work as before.
> Error Invalid address. Endpoint address cannot be null
> ------------------------------------------------------
>
> Key: CXF-6655
> URL: https://issues.apache.org/jira/browse/CXF-6655
> Project: CXF
> Issue Type: Bug
> Affects Versions: 3.0.6, 3.1.3
> Reporter: Jaume Vicens
>
> When creating a client setting proxy config first and then endopoint address,
> we get Exception when Sending Message (this worked perfectly in CXF 3.0.2):
> java.net.URISyntaxException: Invalid address. Endpoint address cannot be
> null. at index 0: <null>
> org.apache.cxf.interceptor.Fault: Could not send Message.
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:48)
> 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:138)
> .............
> .....................
> Caused by: java.io.IOException: java.net.URISyntaxException: Invalid address.
> Endpoint address cannot be null. at index 0: <null>
> at
> org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:490)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
> ... 16 more
> Caused by: java.net.URISyntaxException: Invalid address. Endpoint address
> cannot be null. at index 0: <null>
> at
> org.apache.cxf.transport.http.HTTPConduit.setAndGetDefaultAddress(HTTPConduit.java:732)
> at
> org.apache.cxf.transport.http.HTTPConduit.setupAddress(HTTPConduit.java:677)
> at
> org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:488)
> ... 17 more
> Could not send Message.
> javax.xml.ws.WebServiceException: Could not send Message.
> at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:149)
> ......
> ......
> Caused by: java.io.IOException: java.net.URISyntaxException: Invalid address.
> Endpoint address cannot be null. at index 0: <null>
> at
> org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:490)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
> 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:138)
> ... 9 more
> Caused by: java.net.URISyntaxException: Invalid address. Endpoint address
> cannot be null. at index 0: <null>
> at
> org.apache.cxf.transport.http.HTTPConduit.setAndGetDefaultAddress(HTTPConduit.java:732)
> at
> org.apache.cxf.transport.http.HTTPConduit.setupAddress(HTTPConduit.java:677)
> at
> org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:488)
> ... 17 more
> This is Client Creation:
> Service service = HydraWebService.create(SERVICE_NAME);
> port = service.getPort(HydraService.class);
>
> Client client = ClientProxy.getClient(port);
> client.getInInterceptors().add(new LoggingInInterceptor());
> client.getOutInterceptors().add(new LoggingOutInterceptor());
> HTTPConduit http = (HTTPConduit) client.getConduit();
> HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
> httpClientPolicy.setAllowChunking(false);
> httpClientPolicy.setReceiveTimeout(0);
> httpClientPolicy.setProxyServerType(ProxyServerType.HTTP);
> httpClientPolicy.setProxyServer(ConnectorConfiguration.getProxyURL());
> httpClientPolicy.setProxyServerPort(Integer.parseInt(ConnectorConfiguration.getProxyPort()));
> http.setClient(httpClientPolicy);
> BindingProvider provider = (BindingProvider) port;
>
>
> provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
> wsdlURL.toString());
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)