alibaba / alibaba/arthas

不支持自定义url

Open
#3,103 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
37.5k
Forks
7.6k
Avg merge
1d 22h
Merged PRs (30d)
4

Description

- [x] 我已经在 [issues](https://github.com/alibaba/arthas/issues) 里搜索,没有重复的issue。

### 环境信息

* arthas-boot.jar
* Arthas 版本: v4.1.3
* 操作系统版本: 深度linux25
* 目标进程的JVM版本: 17
* 执行`arthas-boot`的版本: 同一个

### 重现问题的步骤

在我的世界java版forge 1.20.1任意forge版本

### 期望的结果
正常编译
### 实际运行的结果

```Caused by: java.lang.RuntimeException: Wasn't able to open union:/home/1luik/1/mods/irons_spellbooks-1.20.1-3.4.0.10(1).jar%23316!/io/redspace/ironsspellbooks/block/inscription_table as a jar file
at com.taobao.arthas.compiler.PackageInternalsFinder.fuse(PackageInternalsFinder.java:120)
at com.taobao.arthas.compiler.PackageInternalsFinder.processJar(PackageInternalsFinder.java:91)
at com.taobao.arthas.compiler.PackageInternalsFinder.listUnder(PackageInternalsFinder.java:71)
at com.taobao.arthas.compiler.PackageInternalsFinder.find(PackageInternalsFinder.java:60)
at com.taobao.arthas.compiler.DynamicJavaFileManager.list(DynamicJavaFileManager.java:80)
at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.list(ClientCodeWrapper.java:223)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:737)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:674)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:555)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:299)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:682)
at jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1176)
at jdk.compiler/com.sun.tools.javac.code.Symtab.listPackageModules(Symtab.java:863)
at jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:346)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:544)
at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:286)
at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:301)
at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:603)
at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:587)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1042)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:917)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
... 15 common frames omitted
Caused by: java.lang.ClassCastException: class cpw.mods.cl.ModularURLHandler$FunctionURLConnection cannot be cast to class java.net.JarURLConnection (cpw.mods.cl.ModularURLHandler$FunctionURLConnection is in module cpw.mods.securejarhandler of loader 'app'; java.net.JarURLConnection is in module java.base of loader 'bootstrap')
at com.taobao.arthas.compiler.PackageInternalsFinder.fuse(PackageInternalsFinder.java:99)
... 37 common frames omitted
```

Contributor guide

Open the contributing guide

Research direction

Start with com.taobao.arthas.compiler.PackageInternalsFinder.java, especially the fuse method around lines 99-120, and inspect how DynamicJavaFileManager invokes it. Reproduce the Forge 1.20.1 case on Java 17, then verify compilation succeeds without the custom URL connection causing a ClassCastException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.