CXF build error

814 Views Asked by At

I'm trying to build CXF and i'm getting the error:

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Thrown by JAXB: cvc-complex-type.3.2.2: Attribute 'xjc:recursive' is not allowed to appear in element 'class'. at line 44 column 28 of schema jar:file:/home/XXX/Downloads/apache-cxf-2.2.10-src/tools/wsdlto/databinding/jaxb/target/cxf-tools-wsdlto-databinding-jaxb-2.2.10.jar!/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding_jaxb22.xml

I searched for the problem and some said that it was an issue with older versions of JAXB and it was resolved in version 2.2.

I have xjc 2.2.4-2 which is ok.

Any help is appreciated.

2

There are 2 best solutions below

0
On

Here is an hint in the CXF mailing list.

But that's not the issue I am facing, as I have nothing in my endorsed directory. But I made the switch from Oracle JDK 7 to OpenJDK 8. Have you done something similar?

0
On

I moved from JDK 1.7 to 1.8 and started getting this error. It is because of below versions of jaxb which needs to be 2.2.x

com.sun.xml.bind:jaxb-xjc:2.1.13
com.sun.xml.bind:jaxb-impl:2.1.13

If we are using old version of org.apache.cxf (in my case 2.5.4), then even if we explicitly move above dependencies to new versions in pom file still 2.1.13 versions are used because these are referred from org\apache\cxf\cxf-parent\2.5.4\cxf-parent-2.5.4.pom

Solution is to move to new org.apache.cxf version which is compatible to JDK 1.8