使用CXF的3.0.0-milestone1做签名、加密时发现异常。具体异常堆栈如下:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Can't find bundle for base name org/apache/xml/security/resource/xmlsecurity, locale zh_CN at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:159) at sun.proxy.$Proxy44.sayHi(Unknown Source) at Main.main(Main.java:11) Caused by: java.util.MissingResourceException: Can't find bundle for base name org/apache/xml/security/resource/xmlsecurity, locale zh_CN at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322) at java.util.ResourceBundle.getBundle(ResourceBundle.java:724) at org.apache.wss4j.common.crypto.WSProviderConfig$4.<init>(WSProviderConfig.java:138) at org.apache.wss4j.common.crypto.WSProviderConfig.initializeResourceBundles(WSProviderConfig.java:135) at org.apache.wss4j.common.crypto.WSProviderConfig.init(WSProviderConfig.java:69) at org.apache.wss4j.dom.WSSConfig.init(WSSConfig.java:387) at org.apache.wss4j.dom.WSSConfig.getNewInstance(WSSConfig.java:394) at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:180) at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:140) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:502) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:411) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:267) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137) ... 2 more
在使用Maven搭建的工程将cxf版本替换为3.0.0解决!!!。
出现问题的根本原因是由于wss4j-ws-security-common-2.0-beta.jar中的WSProviderConfig类initializeResourceBundles方法出现问题:
private static void initializeResourceBundles() { ResourceBundle resourceBundle = new ResourceBundle() { private final ResourceBundle wss4jSecResourceBundle = ResourceBundle.getBundle("messages.wss4j_errors"); private final ResourceBundle xmlSecResourceBundle = ResourceBundle.getBundle(Constants.exceptionMessagesResourceBundleBase); @Override protected Object handleGetObject(String key) { Object value = null; try { value = wss4jSecResourceBundle.getObject(key); } catch (MissingResourceException e) { try { value = xmlSecResourceBundle.getObject(key); } catch (MissingResourceException ex) { //NOPMD //ignore } } return value; } @Override public Enumeration<String> getKeys() { throw new UnsupportedOperationException("getKeys not supported"); } }; I18n.init(resourceBundle); }
在2.0.0版本中为:
public WSS4JResourceBundle() { wss4jSecResourceBundle = ResourceBundle.getBundle("messages.wss4j_errors"); ResourceBundle tmpResourceBundle; try { tmpResourceBundle = ResourceBundle.getBundle(Constants.exceptionMessagesResourceBundleBase, Locale.getDefault(), I18n.class.getClassLoader()); } catch (MissingResourceException ex) { // Using a Locale of which there is no properties file. LOG.debug(ex.getMessage()); // Default to en/US tmpResourceBundle = ResourceBundle.getBundle(Constants.exceptionMessagesResourceBundleBase, new Locale("en", "US"), I18n.class.getClassLoader()); } xmlSecResourceBundle = tmpResourceBundle; }
private final ResourceBundle xmlSecResourceBundle = ResourceBundle.getBundle(Constants.exceptionMessagesResourceBundleBase);会导致找不到资源的异常。
相关推荐
这个"apache-cxf-3.0.0-milestone2.zip"压缩包包含了Apache CXF 3.0.0的第二个里程碑版本,这是一个重要的中间版本,在正式发布之前提供了对新功能和改进的初步测试。 Apache CXF主要知识点: 1. **Web服务框架**...
"apache-cxf-3.0.0-milestone2"这个压缩子文件可能包含了CXF 3.0.0里程碑2版本的源码、文档、示例和其他相关资源,对于开发者来说,这可以帮助他们了解并学习该版本的新特性,进行测试和开发工作。 总之,Apache ...
赠送jar包:cxf-rt-frontend-jaxws-3.0.1.jar; 赠送原API文档:cxf-rt-frontend-jaxws-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-frontend-jaxws-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-frontend-jaxws...
赠送jar包:cxf-rt-rs-client-3.0.1.jar; 赠送原API文档:cxf-rt-rs-client-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-rs-client-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-rs-client-3.0.1.pom; 包含...
赠送jar包:cxf-rt-frontend-jaxrs-3.0.1.jar; 赠送原API文档:cxf-rt-frontend-jaxrs-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-frontend-jaxrs-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-frontend-jaxrs...
赠送jar包:cxf-rt-transports-http-3.0.1.jar; 赠送原API文档:cxf-rt-transports-http-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-transports-http-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-transports-...
赠送jar包:cxf-rt-frontend-simple-3.0.1.jar; 赠送原API文档:cxf-rt-frontend-simple-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-frontend-simple-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-frontend-...
cxf-core-3.0.0.jar,cxf-rt-bindings-soap-3.0.0.jar,cxf-rt-databinding-jaxb-3.0.0.jar,cxf-rt-frontend-jaxws-3.0.0.jar,cxf-rt-frontend-simple-3.0.0.jar,cxf-rt-transports-http-3.0.0.jar,cxf-rt-...
赠送jar包:cxf-rt-databinding-jaxb-3.0.1.jar; 赠送原API文档:cxf-rt-databinding-jaxb-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-databinding-jaxb-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-...
cxf-rt-frontend-jaxws-3.0.16.jar jar包下载3.0.16版本下载
赠送jar包:cxf-rt-bindings-soap-3.0.1.jar; 赠送原API文档:cxf-rt-bindings-soap-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-bindings-soap-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-bindings-soap-...
这个"apache-cxf-3.0.0"压缩包包含的是Apache CXF 3.0.0版本的源代码、库文件和其他相关资源。CXF这个名字是"CXF = XFire + Celtix"的组合,这两个项目在2006年合并形成了现在的Apache CXF。 Apache CXF的核心功能...
赠送jar包:cxf-core-3.0.1.jar; 赠送原API文档:cxf-core-3.0.1-javadoc.jar; 赠送源代码:cxf-core-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-core-3.0.1.pom; 包含翻译后的API文档:cxf-core-3.0.1-...
<import resource="classpath:META-INF/cxf/cxf.xml"/> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/> <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
下载的"apache-cxf-3.0.0-milestone2-src.zip" 包含了Apache CXF 3.0.0里程碑2的所有源代码,这包括了核心库、示例、文档、测试用例等。开发者可以通过分析源码学习其内部工作原理,或者对框架进行定制以适应特定...
赠送jar包:cxf-rt-ws-addr-3.0.1.jar; 赠送原API文档:cxf-rt-ws-addr-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-ws-addr-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-ws-addr-3.0.1.pom; 包含翻译后的API...
赠送jar包:cxf-rt-bindings-xml-3.0.1.jar; 赠送原API文档:cxf-rt-bindings-xml-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-bindings-xml-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-bindings-xml-3.0.1....
赠送jar包:cxf-rt-rs-extension-providers-3.0.1.jar; 赠送原API文档:cxf-rt-rs-extension-providers-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-rs-extension-providers-3.0.1-sources.jar; 赠送Maven依赖信息...
标题 "cxf-rt-transports-http-jetty-3.0.2.zip" 指的是Apache CXF项目的一个特定版本的HTTP-Jetty传输模块。Apache CXF是一个流行的开源框架,用于构建和开发服务导向架构(SOA)和RESTful Web服务。这个版本,...
cxf-dosgi-ri-singlebundle-distribution-1.4.0.jar