Exceptions in Conflunce server due to class not found exception

Hi,

We a situation with our Confluence plugin on a customer installation where the following exception is being thrown in the server logs:

Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.DatatypeConverterImpl not found by com.gliffy.plugin.confluence.gliffy-confluence-plugin [282]

We have not been able to reproduce the issue on any of our own Confluence server instances. I have concluded that there is probably an incompatible version of JAXB in Confluence that is conflicting with the one we are using.

Some background:
We include JAXB using provided a provided scope in our pom.xml:

javax.xml.bind
jaxb-api
${jaxb.version}
provided


javax.xml
jaxb-impl
${jaxb.version}
provided

where JAXB version is 2.1

Is this due to a potential conflict with a version of JAXB being used by another plugin?

One potential solution I am considering is too add an explicit import javax.xml.bind.*;version=${jaxb.version}, to in the pom file. Is this a viable solution? I do not have a great deal of expertise in resolving package conflicts.

Some things that you should check first:

  • atlas-clean
  • Try version 2.3.1 of jaxb-api for Confluence 7.3.3
  • Use confluence-plugins-platform-pom at least as part of your dependencyManagement section to ensure you are having the correct dependency versions.
  • Try adding an explicit import javax.xml.bind.*;version:=${jaxb.version}
  • Use AMPS version 8.1.0 (specify in pom.xml or use -u 8.1.0 flag)

There is an open problem with some Confluence versions but that affects NoClassDefFoundError - which does not seem to be your problem. NoClassDefFoundError for Spring JDBC classes since Confluence 7.1.1

Thank you for the suggestions Dennis. I am currently trying the explicit import, but will also look at the other suggestions if that does not prove to be effective.

@jan.revis There could be a simpler reason:
Run atlas-mvn dependency:tree and grep for jaxb-api. Check which version is picked. It is possible that some other library overrides your dependency due to, e.g. , compile scope, and then you end up with the wrong version. In that case, add an exclusion or downgrade/upgrade the other library.