-
Notifications
You must be signed in to change notification settings - Fork 303
Apache CXF uses a wrong version of JAXB? #140
Comments
@mmatczak you did not yet commit/push anything related to this, right? The dependencies to "jaxb-:2.2.10-" come from "cxf-rt-databinding-jaxb:3.0.2".
How exactly did you get this error? With WAR file in local tomcat outside eclipse? Which tomcat version? |
My Eclipse m2e POM view and Maven Dependencies says that we are using jaxb 2.2.10-.... |
The comment from CXF pom is also wrong - it is not java5 profile but 1.7 that triggers the 2.2 version:
|
It must be a problem with the war packaging. Try this
This command resolves the
|
Another interesting finding. When I build in |
After downgrading to CXF 3.0.0 the I got the same effect -- it means the problem was not caused by any CXF upgrade |
@mmatczak when do you have this problem? I'm starting it from InteliJ and have no problem |
The problem is caused by with plugin enabled:
and
with plugin disabled:
and
|
I have attached build outputs with and without flatten plugin and diff of the both builds
Probably analysis of these files helps |
I should also mention similar problem was reported in CXF community (https://issues.apache.org/jira/browse/CXF-5894) but was rejected. |
To clarify the problem: when using JDK 7, the sample war should contain JAXB in version |
@hohwille as I know you should known very good internals of the flatten plugin. Could you check why it makes problems with building the war file? |
@sobkowiak thanks for investigation and figuring this out. To fix this issue I disabled flatten here. |
Removing the plugin from |
There are two issues here:
So far we have some workarounds to build the WAR correctly and still being able to create proper releases. |
I could reproduce this problem. It appears when from any reason the war file contains both versions of JAXB. So it's not CXF problem but problem with building war file and flatten plugin. |
As we now have new versions of flatten available, we shall give it another try. |
I have fixed the bug tonight. We can update flatten-maven-plugin to 1.0.0 as soon as it is released. Then we can close this issue. |
Done. |
…out the need for profile
When starting Tomcat I got: java.lang.NoSuchFieldError: REFLECTION. The reason were incompatible JAXB versions taken by org.apache.cxf / cxf-rt-frontend-jaxws / 3.0.2:
com.sun.xml.bind / jaxb-impl / 2.2.10-b140310.1920
com.sun.xml.bind / jaxb-core / 2.2.10-b140310.1920
However according to http://mvnrepository.com/artifact/org.apache.cxf/cxf-core/3.0.2, org.apache.cxf / cxf-rt-frontend-jaxws / 3.0.2 depends on com.sun.xml.bind / jaxb-* / 2.1.14.
After I excluded the version 2.2.10-b140310.1920 and explicitly added the 2.1.14 one of com.sun.xml.bind / jaxb-*, the problem disappeared.
I am not a Maven expert, did anyone have a similar issue?
The text was updated successfully, but these errors were encountered: