Reputation: 1
I am trying to deploy a war which has a JAX-WS client for SOAP services in Wildfly 10.1.0.Final. When I am trying to get the port for the webservice the delegate interface in javax.xml.ws.Service automatically going to apache cxf implementation of getPort() method.
When its internally try to create a proxy connection, I am getting a IllegalArgumentException as org.apache.cxf.enpoint.Client is not visible to classloader.
I have read the documentation and the classloading hierarchy of wildfly. Wildfly has a cxf-core.jar(3.1.6) and my war also have cxf-core.jar(3.1.7). My estimation is that it is trying to access the cxf-core.jar from wildfly and throwing classloading issue.
JBOSS has different meta files for altering the flow of normal class loading like jboss-web.xml, jboss-classloading.xml etc. My query which meta file should I use to resolve this visibility issue of classloader.
What will be the meta file, what is the content and what are the references that I need to write in contents(say war name mywar.war).
Error trace that I am getting :
13:38:22,877 INFO [org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) Creating Service {http://exp.com/webservices/}CustomerRelationshipManagementWebService from WSDL: http://localhost:5321/Nsb.CustomerRelationshipManagement.WebService.asmx?wsdl 13:39:18,632 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) java.lang.IllegalArgumentException: interface org.apache.cxf.endpoint.Client is not visible from class loader 13:39:18,642 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:581) 13:39:18,646 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557) 13:39:18,648 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230) 13:39:18,654 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at java.lang.reflect.WeakCache.get(WeakCache.java:127) 13:39:18,656 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419) 13:39:18,662 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719) 13:39:18,664 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at org.apache.cxf.common.util.ProxyHelper.getProxyInternal(ProxyHelper.java:47) 13:39:18,666 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at org.apache.cxf.common.util.ProxyHelper.getProxy(ProxyHelper.java:101) 13:39:18,669 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:175) 13:39:18,671 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142) 13:39:18,673 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:493) 13:39:18,675 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImpl.java:578) 13:39:18,680 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:359) 13:39:18,691 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:350) 13:39:18,700 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at javax.xml.ws.Service.getPort(Service.java:99) 13:39:18,705 ERROR [stderr] (e99c3221-b10d-4fe7-b0ff-22fac3e1754d) at com.abc.client.CustomerRelationshipManagementWebService.getCustomerRelationshipManagementWebServiceSoap(CustomerRelationshipManagementWebService.java:72)
Thanks in advance
Upvotes: 0
Views: 1433
Reputation: 1467
You need to exclude the JBoss web service subsystem from your deployment by adding a jboss-deployment-structure.xml file to the WAR's WEB-INF folder.
Source: Exclude a Subsystem from a Deployment
Here is a an example which would do it.
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="webservices" />
</exclude-subsystems>
<dependencies>
<module name="org.apache.cxf" />
<module name="org.apache.cxf.impl" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Upvotes: 0