title: Weblogic 12c - Mapstruct - 1.0.0.Final - ClassNotFoundException: Cannot find implementation
body: <p>I've been using mapstruct for a while now, but have found this problem while trying to deploy one of my webservices:</p>
  
  <pre><code>Target state: deploy failed on Server my_server
  java.lang.ClassNotFoundException: Cannot find implementation for bar.foo.mapper.MyMapper
  
  at weblogic.deploy.api.tools.deployer.Jsr88Operation.report(Jsr88Operation.java:547)
  at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:140)
  at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
  at weblogic.utils.compiler.Tool.run(Tool.java:158)
  at weblogic.utils.compiler.Tool.run(Tool.java:115)
  at weblogic.Deployer.run(Deployer.java:74)
  ... 15 more
  </code></pre>
  
  <p>When I check the WAR being deployed, in the same bar.foo.mapper folder there's MyMapper.class and MyMapperImpl.class, as in other services that work correctly.</p>
  
  <p>In the POM, I've followed the setup as stated in the official <a href="http://mapstruct.org/documentation/1.0/reference/html/index.html" rel="nofollow noreferrer">doc</a>.</p>
  
  <p>I've already read @gunnar's answer <a href="https://stackoverflow.com/a/31966858/1606953">here</a>, but in my case the implementation is beside the interface in the WAR.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>
  
  <p><strong>UPDATE</strong>: I just tried with version 1.1.0.Beta1 with the same results</p>
  
  <p><strong>UPDATE-2</strong>: This is the log of the exception thrown:</p>
  
  <pre><code>Caused By: java.lang.ClassNotFoundException: Cannot find implementation for bar.foo.mapper.MyMapper
          at org.mapstruct.factory.Mappers.getMapper(Mappers.java:94)
  </code></pre>
  
  <p>While debugging, the exception is thrown here:</p>
  
  <pre><code>T mapper = (T) classLoader.loadClass( clazz.getName() + IMPLEMENTATION_SUFFIX ).newInstance();
  </code></pre>
  
  <p>...because classLoader.loadClass doesn't find bar.foo.mapper.MyMapperImpl, even though the class is beside the interface.</p>