Search code examples
javanosuchmethoderror

Caused by: java.lang.NoSuchMethodError: com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource


I am using openjdk11, getting below error while building using maven.

Below is the error i am getting in logs :

Caused by: org.apache.maven.plugin.PluginContainerException: An API incompatibility was encountered while executing org.jvnet.jaxb1.maven2:maven-jaxb1-plugin:1.0-rc10:generate: java.lang.NoSuchMethodError

I have created my own openjdk11 rpm, i think i am missing to include some files in the rpm i am not sure about

How do i fix it ?


Solution

  • Developers on JDK 9+ can deploy standalone versions of the Java EE and CORBA technologies on the class path or use the --add-modules flag on the command line to resolve the modules in the JDK runtime image. If you wish to compile or run applications on the latest JDK can find and deploy alternate versions of the Java EE technologies.

    Add third-party dependencies that contain the classes you need. The easiest way to do that is to stick to the reference implementations (given as Maven coordinates without version – use the most current ones):

    JAF: with com.sun.activation:javax.activation

    CORBA: there is currently no artifact for this

    JTA: javax.transaction:javax.transaction-api

    JAXB: com.sun.xml.bind:jaxb-impl

    JAX-WS: com.sun.xml.ws:jaxws-ri

    Commons Annotation: javax.annotation:javax.annotation-api