Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
Chapter 8. Apache CXF Issues
8.1. Apache CXF 3.1 Migration 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Overview 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
JBoss Fuse 6.3 uses Apache CXF 3.1. This introduces some issues that you sould be aware of before migrating.
Main Changes 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
- CXF 3.1 no longer supports Java 6. You must use Java 7 or Java 8.
- The JAX-WS/Simple frontend
ServerFactoryBeanwill automatically callreset()at the end of thecreate()call. This allows resources to be cleaned up and garbage collected sooner. However, it also prevents multiple calls tocreate()from sharing the sameServerInfo/EndpointInfoobjects, as they would in older versions. That sharing has caused many problems in the past due to sharing of properties, such as token caches, that are stored on those objects. The new behavior is more correct, but it is different from previous versions so care must be taken when upgrading. - The Karaf
features.xmlfile for CXF 3.1 no longer installs spring or spring-dm when installing thecxffeature. If you require spring/spring-dm, you must install those features prior to installing the CXF feature. - Starting with CXF 3.1.2, the default
JSONProviderclass provided bycxf-rt-rs-extension-providershas preference over registered JSON provider classes. This changes the sorting order for selecting the JSON provider class and can cause an incorrect JSON provider class to be used. To suppress the new default provider, set theskip.default.json.provider.registrationproperty totrueon the CXF bus.Before CXF 3.1.2, if acustomMessageBodyReaderorMessageBodyWriterobject matches the read or write selection criteria for a registered JSON provider then default providers were not checked. For example, default providers were not checked if aMessageBodyWriterobject'sConsumesfield matched the content type andMessageBodyWriter.isReadable()method returned true.With CXF 3.1.2, custom providers are selected only if no higher priority matching default provider is available. CXF 3.1.2 sorts thecustomMessageBodyReader,MessageBodyWriterandExceptionMapperproviders together with default providers. For example, consider a customStringReaderobject that is not typed byStringbut byObject. The CXF 3.1.2 default provider, which is typed byString, has a higher precedence. To ensure that a customStringprovider has precedence, you would have to type theStringReaderbyString.To prevent registration of default JSON providers and to ensure correct selection of a JSON provider, set theskip.default.json.provider.registration propertytotrue, for example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Security changes 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
- The STS (Security Token Service) now issues tokens using the RSA-SHA256 signature algorithm by default, and the SHA-256 digest algorithm . Previously it used RSA-SHA1 and SHA-1 respectively.
- Some security configuration tags have been renamed from
ws-security.*tosecurity.*, as they are now shared with some of the JAX-RS stack. The old tags will continue to work as before however without any change. See the Security Configuration page for more information. - The SAML/XACML functionality previously available in the
cxf-rt-securitymodule is now in thecxf-rt-security-samlmodule. - If you are explicitly specifying the SAML version in a SAML
CallbackHandler, then this is changed in CXF 3.1 due to the migration to use OpenSAML 3.1. The version is now set on theSAMLCallbackusing anorg.apache.wss4j.common.saml.bean.Versionclass. Previously there was a dependency on OpenSAML'sSAMLVersionclass. - It is now possible to plug in custom
WS-SecurityPolicyvalidators if you want to change the default validation logic for a particular policy.
New Features 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
- The CXF JAX-WS code generator has a new option,
seiSuper, that can be used to specify additional super interfaces for the SEI. This makes the code nonportable to other JAX-WS containers. The primary use would be to addAutoCloseableto the interface to allow use of the clients in Java7 try with resource blocks. - New metrics feature for collecting metrics about a CXF services. Codahale/DropWizard based collector included.
- New throttling feature for easily throttling CXF services. Sample included that uses the metrics component to help make the throttling decisions.
- New logging feature for more advanced logging than the logging available in
cxf-core. - New metadata service for SAML SSO to allow you to publish SAML SSO metadata for your service provider.
- The
cxffrontend to the JAX-WS code generator,-fe cxfnow generates code that is more Java7-friendly as the return type of thegetPort(...)calls is a sub-interface of the SEI that also implementsAutoCloseable,BindingProvider, andClient. Code that used to look like:(AddNumbersPortType port = service.getAddNumbersPort(); ((BindingProvider)port).getRequestContext() .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address); port.addNumbers3(-1, 2); ((Closeable)port).close();(AddNumbersPortType port = service.getAddNumbersPort(); ((BindingProvider)port).getRequestContext() .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address); port.addNumbers3(-1, 2); ((Closeable)port).close();Copy to Clipboard Copied! Toggle word wrap Toggle overflow can be replaced with:try (AddNumbersPortTypeProxy port = service.getAddNumbersPort()) { port.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address); port.addNumbers3(-1, 2); }try (AddNumbersPortTypeProxy port = service.getAddNumbersPort()) { port.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address); port.addNumbers3(-1, 2); }Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Major Dependency Changes 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
- The Jetty based HTTP transport has been updated to support Jetty 9 as well as Jetty 8. However, support for Jetty 7 has been dropped.
- Due to the Jetty upgrade, support for running Jetty based endpoints in Karaf 2.3.x has been dropped.
- Support for using JAX-WS 2.1 based API jars has been removed. Java 7 (now required) includes JAX-WS 2.2 so this should not be an issue.
- WSS4J 2.1 is included, which in turn includes OpenSAML 3.0.