Search code examples
javaspringmavensoapsoap-client

javax.xml.rpc does not exist - maven


I'm using IntelliJ and I'm working on a Maven project. I've imported a SOAP Web Service. When I run my project, I recieve a "java: package javax.xml.rpc does not exist." error. I've researched the error and tried to add new dependencies about this xml but IntelliJ couldn't find these dependencies.


Solution

  • Make sure that you have in pom dependency like

    <!-- https://mvnrepository.com/artifact/javax.xml.rpc/javax.xml.rpc-api -->
    <dependency>
        <groupId>javax.xml.rpc</groupId>
        <artifactId>javax.xml.rpc-api</artifactId>
        <version>1.1.1</version>
    </dependency>
    

    After that in your IntelliJ on the right side of the maven menu, go maven clean, and then go, maven, install ( or from your terminal you can go mvn clean install ), which will pull fresh dependencies again. Or, from what I remember there is a trick to just add a dependency, add any code change in your intellij pom.xml and IntelliJ will automatically offer you to pull dependencies, but not sure if that is enabled in your IDE.