Liubsyy / JarEditor

IDEA plugin for directly editing and modifying files in jar without decompression. (一款无需解压直接编辑修改jar包内文件的IDEA插件)
Apache License 2.0
533 stars 46 forks source link

Compile err:java.lang.NullPointerException: getHost(...) must not be null #17

Closed airqj closed 1 month ago

airqj commented 1 month ago

when click "save", idea show above message。 idea version: 2024.2.0.1 Ultimate Edition system: debian 12 package: engine.io-client-2.1.0

Liubsyy commented 1 month ago

看不出来具体问题,用这个包再试一下吧,会把整个异常链打印出来,然后再贴一下整个异常链 JarEditor.zip 选择从磁盘安装插件zip即可

airqj commented 1 month ago

看不出来具体问题,用这个包再试一下吧,会把整个异常链打印出来,然后再贴一下整个异常链 JarEditor.zip 选择从磁盘安装插件zip即可

Compile err:java.lang.RuntimeException: java.lang.NullPointerException: getHost(...) must not be null at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:204) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:119) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:68) at com.liubs.jareditor.compile.MyRuntimeCompiler.compile(MyRuntimeCompiler.java:92) at com.liubs.jareditor.editor.JarEditorCore$1.run(JarEditorCore.java:178) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:477) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:528) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:249) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:96) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221) at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:96) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:249) at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:501) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:466) at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92) at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92) at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97) at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:464) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.NullPointerException: getHost(...) must not be null at com.intellij.platform.ijent.community.impl.nio.IjentNioFileSystemProvider.typicalUriChecks(IjentNioFileSystemProvider.kt:376) at com.intellij.platform.ijent.community.impl.nio.IjentNioFileSystemProvider.newFileSystem(IjentNioFileSystemProvider.kt:42) at com.intellij.platform.ijent.community.impl.nio.IjentNioFileSystemProvider.newFileSystem(IjentNioFileSystemProvider.kt:70) at com.intellij.platform.ijent.community.impl.nio.IjentNioFileSystemProvider.newFileSystem(IjentNioFileSystemProvider.kt:28) at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:528) at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:400) at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFile(Locations.java:389) at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:349) at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:337) at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:343) at jdk.compiler/com.sun.tools.javac.file.Locations$SimpleLocationHandler.handleOption(Locations.java:712) at jdk.compiler/com.sun.tools.javac.file.Locations.handleOption(Locations.java:2120) at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:291) at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.handleOption(JavacFileManager.java:1338) at jdk.compiler/com.sun.tools.javac.file.BaseFileManager$2.handleFileManagerOption(BaseFileManager.java:244) at jdk.compiler/com.sun.tools.javac.main.Option.process(Option.java:1222) at jdk.compiler/com.sun.tools.javac.main.Option.handleOption(Option.java:1165) at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:254) at java.compiler@21.0.3/javax.tools.ForwardingJavaFileManager.handleOption(ForwardingJavaFileManager.java:107) at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.handleOption(ClientCodeWrapper.java:256) at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Arguments.java:391) at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Arguments.java:348) at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:247) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:191) ... 34 more

airqj commented 1 month ago

看不出来具体问题,用这个包再试一下吧,会把整个异常链打印出来,然后再贴一下整个异常链 JarEditor.zip 选择从磁盘安装插件zip即可

Compile err:java.lang.RuntimeException: java.lang.NullPointerException: getHost(...) must not be null at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:204) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:119) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:68) at com.liubs.jareditor.compile.MyRuntimeCompiler.compile(MyRuntimeCompiler.java:92) at com.liubs.jareditor.editor.JarEditorCore$1.run(JarEditorCore.java:178) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:477) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:528) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:249) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:96) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221) at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:96) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:249) at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:501) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:466) at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92) at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92) at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97) at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:464) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.NullPointerException: getHost(...) must not be null at com.intellij.platform.ijent.community.impl.nio.IjentNioFileSystemProvider.typicalUriChecks(IjentNioFileSystemProvider.kt:376) at com.intellij.platform.ijent.community.impl.nio.IjentNioFileSystemProvider.newFileSystem(IjentNioFileSystemProvider.kt:42) at com.intellij.platform.ijent.community.impl.nio.IjentNioFileSystemProvider.newFileSystem(IjentNioFileSystemProvider.kt:70) at com.intellij.platform.ijent.community.impl.nio.IjentNioFileSystemProvider.newFileSystem(IjentNioFileSystemProvider.kt:28) at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:528) at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:400) at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFile(Locations.java:389) at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:349) at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:337) at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:343) at jdk.compiler/com.sun.tools.javac.file.Locations$SimpleLocationHandler.handleOption(Locations.java:712) at jdk.compiler/com.sun.tools.javac.file.Locations.handleOption(Locations.java:2120) at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:291) at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.handleOption(JavacFileManager.java:1338) at jdk.compiler/com.sun.tools.javac.file.BaseFileManager$2.handleFileManagerOption(BaseFileManager.java:244) at jdk.compiler/com.sun.tools.javac.main.Option.process(Option.java:1222) at jdk.compiler/com.sun.tools.javac.main.Option.handleOption(Option.java:1165) at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:254) at java.compiler@21.0.3/javax.tools.ForwardingJavaFileManager.handleOption(ForwardingJavaFileManager.java:107) at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.handleOption(ClientCodeWrapper.java:256) at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Arguments.java:391) at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Arguments.java:348) at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:247) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:191) ... 34 more

PS: When editing the source jar file, it works。 But when editing the jar file, it shows the above error message。

Liubsyy commented 1 month ago

我没复现这个问题,可能是编译依赖的classpath报错导致,试试打开一个空的工程,然后修改一个jar有问题吗?

airqj commented 1 month ago

It worked properly with an empty project thanks :+1: