Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nullptr when using shared configuration #1180

Closed
sjaakd opened this issue Apr 12, 2017 · 6 comments
Closed

nullptr when using shared configuration #1180

sjaakd opened this issue Apr 12, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@sjaakd
Copy link
Contributor

sjaakd commented Apr 12, 2017

ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project gmw_dao: Compilation failure: Compilation failure:
[ERROR] /C:/Development/workspace/gmw_common/gmw_dao/src/main/java/nl/bro/dao/gm/gmw/impl/SharedMappingConfig.java:[184,32] No property named "insertedPartDiameter" exists in source parameter(s).
[ERROR] /C:/Development/workspace/gmw_common/gmw_dao/src/main/java/nl/bro/dao/gm/gmw/impl/DtoToEntityCreateMapper.java:[55,17] Internal error in the mapping processor: java.lang.NullPointerException          
 at org.mapstruct.ap.internal.model.source.SourceReference.copyForInheritanceTo(SourceReference.java:310)       
 at org.mapstruct.ap.internal.model.source.Mapping.copyForInheritanceTo(Mapping.java:431)        
 at org.mapstruct.ap.internal.model.source.MappingOptions.applyInheritedOptions(MappingOptions.java:265)         
 at org.mapstruct.ap.internal.processor.MapperCreationProcessor.mergeInheritedOptions(MapperCreationProcessor.java:450)         
 at org.mapstruct.ap.internal.processor.MapperCreationProcessor.getMappingMethods(MapperCreationProcessor.java:274)      
 at org.mapstruct.ap.internal.processor.MapperCreationProcessor.getMapper(MapperCreationProcessor.java:152)     
 at org.mapstruct.ap.internal.processor.MapperCreationProcessor.process(MapperCreationProcessor.java:123)        
 at org.mapstruct.ap.internal.processor.MapperCreationProcessor.process(MapperCreationProcessor.java:80)        
 at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:280)         
 at org.mapstruct.ap.MappingProcessor.processMapperTypeElement(MappingProcessor.java:260)        
 at org.mapstruct.ap.MappingProcessor.processMapperElements(MappingProcessor.java:226)          
 at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:162)         
 at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)         
 at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)          
 at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)    
 at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)   
 at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)         
 at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)     
 at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)        
 at com.sun.tools.javac.main.Main.compile(Main.java:523)         
 at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)         
 at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)   
 at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125)         
 at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:171)      
 at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:886)        
 at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)         
 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)    
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)     
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)      
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)      
 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)    
 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)      
 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)       
 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)      
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)       
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)       
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)        
 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)     
 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)      
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)        
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)        
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)        
 at java.lang.reflect.Method.invoke(Method.java:498)    
 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)          
 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)          
 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)       
 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] -> [Help 1]
[ERROR]

@filiphr : this time on a valid line 😄

@filiphr
Copy link
Member

filiphr commented Apr 13, 2017

@sjaakd with the correct line it makes much more sense :). Does this mean that you can reproduce it? If you have a small example from at least how does the structure with the mapper and the config looks like, it would be great :)

@sjaakd
Copy link
Contributor Author

sjaakd commented Apr 15, 2017

@filiphr the real mappers are quite big. It happens when you have a shared config and non existing properties. The exact conditions I need to figure out...

@Alicja-Majewska
Copy link

I had the same problem reported in issue #1278. I tried debugging "process" maven goal (thanks for this advice, it was fun). It has turned out that my problem is related with #1198 - the inheriting mapper is located in a different jar than the inherited mapper, so all parameter names in inheriting mapper are overriden with names arg0, arg1, arg2, arg3 ... As a consequence each mapping method with multiple input parameters was not correctly defined. I work with Java 6, so solution with preserving parameter names during compilation avaibale in Java 8 is not applicable for me. The only one option in to use arg0, arg1 ... as parameter names. Thanks for your help!

@filiphr
Copy link
Member

filiphr commented Aug 25, 2017

@Alicja-Majewska glad that you think the debugging was fun 😄 . Yes having jars in a different jar is problematic when the parameter names are not preserved.

@sjaakd
Copy link
Contributor Author

sjaakd commented May 7, 2018

It is related to the combination SharedConfig and nested source properties.. .

sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue May 7, 2018
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue May 7, 2018
@filiphr filiphr added the bug label May 8, 2018
@filiphr filiphr added this to the 1.3.0.Beta1 milestone May 8, 2018
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue May 8, 2018
@filiphr
Copy link
Member

filiphr commented May 8, 2018

Closed via 6fbc4cf

@filiphr filiphr closed this as completed May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants