mapstruct坑:Internal error in the mapping processor: java.lang.NullPointerException at org.mapstruct.
错误描述
项目中如果使用了mapstruct框架,在使用Idea新版本后,启动会报错!
Internal error in the mapping processor: java.lang.NullPointerException at org.mapstruct.ap.internal.processor.DefaultVersionInformation.createManifestUrl(DefaultVersionInformation.java:182) at org.mapstruct.ap.internal.processor.DefaultVersionInformation.openManifest(DefaultVersionInformation.java:153) at org.mapstruct.ap.internal.processor.DefaultVersionInformation.getLibraryName(DefaultVersionInformation.java:129) at org.mapstruct.ap.internal.processor.DefaultVersionInformation.getCompiler(DefaultVersionInformation.java:122) at org.mapstruct.ap.internal.processor.DefaultVersionInformation.fromProcessingEnvironment(DefaultVersionInformation.java:95) at org.mapstruct.ap.internal.processor.DefaultModelElementProcessorContext.<init>(DefaultModelElementProcessorContext.java:50) at org.mapstruct.ap.MappingProcessor.processMapperElements(MappingProcessor.java:218) at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:156) at org.jetbrains.jps.javac.APIWrappers$ProcessorWrapper.process(APIWrappers.java:157) 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.jetbrains.jps.javac.APIWrappers$1.invoke(APIWrappers.java:313) at org.mapstruct.ap.MappingProcessor.process(Unknown Source) 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.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:238) at org.jetbrains.jps.incremental.java.JavaBuilder.lambda$compileJava$2(JavaBuilder.java:518) at org.jetbrains.jps.incremental.java.JavaBuilder.invokeJavac(JavaBuilder.java:564) at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:516) at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:359) at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:284) at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:238) at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1529) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1163) at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1310) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:1128) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:877) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:459) at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:197) at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:131) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:334) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:162) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:218) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
解决方案:
方案一
Idea设置:
Setting -->Build,Execution,Deployment -->Compiler -->User-local build process VM options (overrides Shared options):
加上参数:
-Djps.track.ap.dependencies=false
方案二
mapstruct框架引入版本升至1.4.1.Final或更高版本
总结
mapstruct这东西怎么说呢,经常有各种问题,而且很多人没有用过,增加上手熟悉的成本。以后的项目还是决定不用了,不要啥都听风就是雨的,性能好归好,但也得建立在稳定和好用的基础上。
mapstruct坑:Internal error in the mapping processor: java.lang.NullPointerException at org.mapstruct.的更多相关文章
- An internal error occured during :"C/C++" . java.lang.NullPointerException
用eclipse 导入cocos2d项目的时候报了这个错,导致项目在eclipse 里面是空的,反复导入也不行. 解决办法,把其他正常项目里面的proj.android目录下面的.cproject文件 ...
- 【待解决】An internal error occurred during: "Launching baiduTest1". java.lang.NullPointerException
编写的一个Java类,以junit运行可以正常执行,以testNG执行就报如下错误 解决方法:
- idea使用mapstruct报错,Internal error in the mapping processor
错误信息如下: java: Internal error in the mapping processor: java.lang.NullPointerException at org.ma... 修 ...
- Eclipse报错An internal error occurred during: "J2EE Component Mapping Update". java.lang.NullPointerException
Eclipse每次打开.java文件时,报错信息如下: An internal error occurred during: "J2EE Component Mapping Update&q ...
- myecplise上将工程部署到应用下时,经常出现 An internal error occurred during: "Add Deployment". java.lang.NullPointEx
myecplise上将工程部署到应用下时,经常出现 An internal error occurred during: "Add Deployment". java.lang.N ...
- spring mybatis 整合问题Error parsing Mapper XML. Cause: java.lang.NullPointerException
14:30:40,872 DEBUG SqlSessionFactoryBean:431 - Parsed configuration file: 'class path resource [myba ...
- Spring 与 mybatis整合 Error parsing Mapper XML. Cause: java.lang.NullPointerException
mapper配置文件中的namespace没有填:而且namespase的值应该填为:mapper的权限定名:否则还是会抛出异常 org.springframework.beans.factory.B ...
- Eclipse:An error has occurred. See error log for more details. java.lang.NullPointerException
问题描述 在使用 Eclipse Clean 项目时报错:An error has occurred. See error log for more details. java.lang.Null ...
- eclipse报An error has occurred,See error log for more details. java.lang.NullPointerException错误
eclipse报An error has occurred,See error log for more details. java.lang.NullPointerException错误,解决办法: ...
- zepplin0.7.2报错ERROR, exception: null, result: %text java.lang.NullPointerException的处理
zepplin0.7.2报错ERROR, exception: null, result: %text java.lang.NullPointerException的处理 问题描述: 使用zeppli ...
随机推荐
- Trace32 simulator调试以及简单实用命令介绍
目录 Trace32 Simulator debug Trace32工具配置 Trace32命令简介 memory class 常见命令索引 v.v使用实例 不同CPU运行信息查看 Trace32 S ...
- iOS关于屏蔽暗黑模式小结
不想适配暗黑模式可以关闭暗黑模式:在xcode12之前的版本Info.plist文件中添加Key:User Interface Style,值类型设置为String,值为Light,就可以不管在什么模 ...
- 59.ref和reactive的区别
首先,ref和reactive 定义响应式数据的,& vue3中的数据分为 2 类,一类没有响应式数据 第二类是响应式数据 : 如果没有使用ref 或者 reactive 定义数据,那么默认是 ...
- 排查sshfs挂载失败的问题
排查sshfs挂载失败的问题 写代码在Linux上运行,但是熟悉的IDE(比如VS code)在自己的电脑上,可以使用sshfs把linux上的目录挂载到本地,再用VScode打开即可,可以使用下面的 ...
- 0201 为什么 Pytorch 定义模型要有一个 init 和一个 forward,两者怎么区分
https://www.bilibili.com/video/BV1GB4y1H7hq?spm_id_from=333.999.0.0&vd_source=b1ce52b6eb3a9e6c23 ...
- k8s的pod的理解
pod共享相同的IP地址和端口空间. 这意味着在同一 pod中的容器运行的 多个进程需要注意不能绑定到相同的端口号, 否则会导致端口冲突, 但这只涉及同一pod中的容器. 由于每个pod都有独立的端口 ...
- spring cloud openfeign源码分析
大体流程鱼骨图 1.读取配置 启动类上添加注解@EnableFeignClients,工程启动后会自动读取注解上的配置 1 @Retention(RetentionPolicy.RUNTIME) 2 ...
- 通过自定义字符串内插处理程序(InterpolatedStringHandler)和CallerArgumentExpression特性来实现一个好玩的场景
背景知识介绍 什么是自定义字符串内插处理程序? 简单来讲就是自定义一个高性能的字符串拼接程序 通过 $"{a}{b}"的方式. 什么是CallerArgumentExpressio ...
- 初学者浅析C++类与对象
C++类与对象 class class基本语法 class ClassName { public: // 公有成员 Type memberVariable; // 数据成员 ReturnType me ...
- oracle下拼同比环比查询sql方法
拼接方法: /// <summary> /// 生成计算同比环比查询语句 /// table:表名称:statColumns:要统计的值字段;yearColumn:年份字段名:monthC ...