javassist icon indicating copy to clipboard operation
javassist copied to clipboard

Cannot find META-INF.versions.9.....?

Open buriedpot opened this issue 3 years ago • 5 comments

When I use javassist to getRefClasses, I got the exception below:

java.lang.RuntimeException: cannot find META-INF.versions.9.kotlin.reflect.jvm.internal.impl.serialization.deserialization.builtins.BuiltInsResourceLoader: kotlin.reflect.jvm.internal.impl.serialization.deserialization.b
uiltins.BuiltInsResourceLoader found in META-INF/versions/9/kotlin/reflect/jvm/internal/impl/serialization/deserialization/builtins/BuiltInsResourceLoader.class
        at javassist.CtClassType.getClassFile3(CtClassType.java:213)
        at javassist.CtClassType.getClassFile2(CtClassType.java:178)
        at javassist.CtClass.getRefClasses(CtClass.java:528)
        at neu.lab.conflict.container.AllRefedCls.<init>(AllRefedCls.java:32)
        at neu.lab.conflict.container.AllRefedCls.i(AllRefedCls.java:69)
        at neu.lab.conflict.vo.DepJar.getRiskMthds(DepJar.java:778)
        at neu.lab.conflict.risk.jar.DepJarJRisk.setThrownMthdsNoFilter(DepJarJRisk.java:110)
        at neu.lab.conflict.writer.RiskLevelWriter.writeRiskLevelXML(RiskLevelWriter.java:86)
        at neu.lab.conflict.PrintRiskLevelMojo.run(PrintRiskLevelMojo.java:24)
        at neu.lab.conflict.ConflictMojo.execute(ConflictMojo.java:475)
        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)

The version of javassist I use is 3.27.0-GA.

buriedpot avatar Aug 22 '21 12:08 buriedpot

The jar path which includes the class META-INF.versions.9.kotlin.reflect.jvm.internal.impl.serialization.deserialization.builtins.BuiltInsResourceLoader has been added into the javassist classpath.

buriedpot avatar Aug 22 '21 12:08 buriedpot

According to my observation, the the exception will be thrown out when the class name is inconsistent with the class storage location. For example, org.example.AClass's file 'AClass.class' is located in the directory 'org1.org.example'.

buriedpot avatar Aug 25 '21 12:08 buriedpot

Is this issue solved?

pidanxiangjiao avatar Jan 24 '24 07:01 pidanxiangjiao

Is this issue solved?

Thank you for checking this issue. No, when I use javassist to analyze a Jar with 'META-INF' directory, this error will occur.

buriedpot avatar Jan 24 '24 07:01 buriedpot

Do you want to find a class file for org.example.Aclass at META-INF/org/example.Aclass.class in a jar file?

chibash avatar Jan 28 '24 16:01 chibash