更新:我已将问题提交至CXF用户的邮件列表,此处.
更新:我目前已经签署了所有的罐子.我仍然无法以能够找到WSDL的方式获得CXF设置.我的最后一次尝试是将WSDL放在我的WAr文件中,以便我可以通过Web浏览器访问它.我将客户端内的wsdllocation设置为URL(http://www.example.com/app/example.wsdl).我现在得到以下异常:
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at com.sun.xml.internal.ws.util.xml.XmlUtil.createDefaultCatalogResolver(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)
at javax.xml.ws.Service.<init>(Unknown Source)
谷歌搜索在这方面几乎没有任何结果.
我正在使用Apache CXF从给定的WSDL创建一个Web服务客户端.我遇到了问题,但是当我尝试访问该服务时,我得到了这个异常:
Can not initialize the default wsdl from ../resource/example.wsdl
Exception in thread "AWT-EventQueue-0" java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
我没有签署我的Web启动应用程序,并且不愿意,因为我没有从客户端的计算机访问任何资源.提到的WSDL包装在我的罐子里.问题是由CXF生成的客户端代码引起的:
URL url = null;
try {
url = new URL("../resource/example.wsdl");
} catch (MalformedURLException e) {
System.err.println("Can not initialize the default wsdl from ../resource/example.wsdl");
// e.printStackTrace();
}
WSDL_LOCATION = url;
如何正确地将CXF指向此WSDL?我也担心类上的WebService注释:
@WebServiceClient(name = "Example",
wsdlLocation = "../resource/example.wsdl",
targetNamespace = "http://services.example.com/")
我还需要改变这个吗?
解决方法:
您将需要将该wsdlLocation更改为类路径:reference.
使用-wsdlLocation,如图here所示.