Idea奇怪的Bug

文章讲述了在项目开发中遇到的两个问题:一是Debug无法启动,原因是未结束的调试会阻止新项目启动;二是高版本Idea使用MapStruct时遇到空指针异常,解决方案是在设置中禁用`jps.track.ap.dependencies`。
摘要由CSDN通过智能技术生成

目录

1、Debug起不来

问题描述:

解决方案:

2、高版本Idea使用mapstruct

问题描述:

解决方案:

1、Debug起不来

问题描述:

今天分享一个特别有意思的事情

在项目中,我可以正常启动项目,但是debug启动不起来

破案了:今天复现了这个场景,发现是由于之前的debug没结束,然后就重启项目,就会造成项目启动不起来,还卡在之前的debug中。这时候使用 Ctrl+Shift+F8调出Debug断点,全给取消掉就可以了。

解决方案:

Ctrl+Shift+F8调出快捷键,取消勾选所有断点。

-------------------------------------------------------分割线-----------------------------------------------------------------

2024/04/26更新

2、高版本Idea使用mapstruct

问题描述:

Idea项目中有使用到mapstruct依赖,可能高版本的Idea可能启动就会直接报空指针

java: 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 lombok.launch.AnnotationProcessorHider$AnnotationProcessor.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:519)  	at org.jetbrains.jps.incremental.java.JavaBuilder.invokeJavac(JavaBuilder.java:565)  	at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:517)  	at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:360)  	at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:285)  	at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:239)  	at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1519)  	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1149)  	at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1299)  	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:1114)  	at 
org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:885)  	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:467)  	at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:197)  	at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:150)  	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:348)  	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:175)  	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:218)  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  	at java.lang.Thread.run(Thread.java:745)  

解决方案:

File->Settings->Compiller->User-local build process VM options (overrides Shared options )->-Djps.track.ap.dependencies=false

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值