Liferay 7 GA4: What’s new about Apache CXF?
The last release of Liferay Portal 7 CE GA4 on June 28, 2017 was very significant regarding the Apache CXF framework that Liferay adopted for the AX-WS/JAX-RS stack. The most significant change is the upgrade from version 3.0.3 to 3.1.9 (December 2016). OSGi modules affected by the modification are part of the group apps:foundation:portal-remote:
- portal-remote-cxf-common
- portal-remote-cxf-jaxrs-common
- portal-remote-soap-extender
- portal-remote-rest-extender
Who has read the article Liferay 7: How to make a SOAP client with Apache CXF in OSGi Style will remind you that it was based on Liferay GA2 and the Apache CXF 3.1.6 bundles needed to develop the SOAP client.
On Liferay GA4, developing a SOAP client no longer requires the installation of all Apache CXF bundles on Liferay 7: How to build a SOAP client with Apache CXF in OSGi Style but it is more than enough to install the following bundles :
- Apache CXF Runtime Simple Frontend (v. 3.1.9)
- Apache CXF Runtime JAX-WS Frontend (v. 3.1.9)
- Apache CXF Runtime XML Binding (v. 3.1.9)
- Apache XmlSchema Core (v. 2.2.1)
The first three bundles of the list are used by the portal-remote-soap-extender module but are not exported, so you need to install to ensure that the SOAP client is working properly. The last bundle in the list is required by Apache CXF Runtime Simple Frontend, the one exported from Liferay is version 2.1.0 incompatible (and I did a pull-request yesterday on Liferay's repository). Figure 1 shows the Apache CXF bundles and the sample SOAP client installed on the Liferay 7 CE GA4 instance.
If your Liferay installation resides on JBoss EAP or Wildfly, I recommend that you turn off the module org.jboss.as.webservices to avoid common errors (such as following) caused by different versions of the Apache CXF framework loaded by the Class Loader
- java.lang.ClassCastException: Cannot cast org.apache.cxf.wsdl11.WSDLManagerImpl to org.apache.cxf.wsdl.WSDLManager
- java.lang.IllegalAccessError: tried to access class org.apache.cxf.BusFactory$BusHolder from class org.apache.cxf.BusFactory
The SOAP service that I have used on many occasions as an example (also in Article Liferay 7: How to make a SOAP client with Apache CXF in OSGi Style) is no longer available, so I will take advantage of shortly publishing an example of SOAP client with To integrate Liferay with the Salesforce CRM system.
For further information on JAX-WS and JAX-RS support you can follow my latest Symposium LIferay Italy 2016 (video + slide).