I've been using mapstruct for a while now, but have found this problem while trying to deploy one of my webservices:
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
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.
In the POM, I've followed the setup as stated in the official doc.
I've already read @gunnar's answer here, but in my case the implementation is beside the interface in the WAR.
Any ideas?
Thanks!
UPDATE: I just tried with version 1.1.0.Beta1 with the same results
UPDATE-2: This is the log of the exception thrown:
Caused By: java.lang.ClassNotFoundException: Cannot find implementation for bar.foo.mapper.MyMapper
at org.mapstruct.factory.Mappers.getMapper(Mappers.java:94)
While debugging, the exception is thrown here:
T mapper = (T) classLoader.loadClass( clazz.getName() + IMPLEMENTATION_SUFFIX ).newInstance();
...because classLoader.loadClass doesn't find bar.foo.mapper.MyMapperImpl, even though the class is beside the interface.