title: Cannot be cast to class because they are in unnamed module of loader 'app'
body: <p>I'm trying to create a bean from sources that were generated by <a href="https://github.com/nilsmagnus/wsdl2java" rel="noreferrer"><code>wsdl2java</code></a>.</p>
  
  <p>Every time I try to run my Spring Boot app, I get the following error:</p>
  
  <blockquote>
    <p>Caused by: java.lang.ClassCastException: class
    org.apache.cxf.endpoint.ClientImpl cannot be cast to class
    com.xignite.services.XigniteCurrenciesSoap
    (org.apache.cxf.endpoint.ClientImpl and
    com.xignite.services.XigniteCurrenciesSoap are in unnamed module of
    loader 'app')</p>
  </blockquote>
  
  <p>I'm not sure how exactly I'm to include generated sources in my main Spring Boot application as a module.</p>
  
  <p>My directory structure is:</p>
  
  <pre><code>├── build
  │   └── generatedsources
  │       └── src
  │           └── main
  │               └── java
  │                   └── com
  │                       └── xignite
  │                           └── services
  │      
  └── src
      └── main
          ├── java
          │   └── io
          │       └── mateo
          │           └── stackoverflow
          │               └── soapconsumption
          └── resources
             └── wsdls
  </code></pre>
  
  <p>Relevant system info:</p>
  
  <pre><code>openjdk version "11.0.1" 2018-10-16
  OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
  OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
  </code></pre>
  
  <ul>
  <li>Spring Boot 2.1.2.RELEASE</li>
  <li>Gradle 5.2</li>
  </ul>
  
  <p>I've also uploaded the project onto Github here: <a href="https://github.com/ciscoo/soap-consumption-spring-boot" rel="noreferrer">https://github.com/ciscoo/soap-consumption-spring-boot</a></p>