IllegalArgumentException from ASM
See original GitHub issueExperiencing this issue when trying to Jib up the Groovy project at https://github.com/coollog/skaffold-code.one/tree/master/frontend-service
* What went wrong:
Execution failed for task ':jib'.
> java.lang.IllegalArgumentException (no error message)
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
...
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:64)
at com.google.cloud.tools.jib.frontend.MainClassFinder$MainClassVisitor.<init>(MainClassFinder.java:123)
at com.google.cloud.tools.jib.frontend.MainClassFinder$MainClassVisitor.<init>(MainClassFinder.java:111)
at com.google.cloud.tools.jib.frontend.MainClassFinder.findMainClass(MainClassFinder.java:190)
at com.google.cloud.tools.jib.frontend.MainClassFinder.find(MainClassFinder.java:161)
at com.google.cloud.tools.jib.plugins.common.MainClassResolver.findMainClassInClassFiles(MainClassResolver.java:129)
at com.google.cloud.tools.jib.plugins.common.MainClassResolver.resolveMainClass(MainClassResolver.java:61)
at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.computeEntrypoint(PluginConfigurationProcessor.java:278)
at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.processCommonConfiguration(PluginConfigurationProcessor.java:208)
at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.processCommonConfigurationForRegistryImage(PluginConfigurationProcessor.java:155)
at com.google.cloud.tools.jib.gradle.BuildImageTask.buildImage(BuildImageTask.java:104)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at
...
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
GWT application fails with IllegalArgumentException in org ...
asm :7.1 . Check that your project does not have a dependency on ASM that is earlier than 7. (Note that this could...
Read more >PI96826: ILLEGALARGUMENTEXCEPTION IN ... - IBM
AnnotationConfigReader.getAnnota tionData(AnnotationConfigReader.java:883) : Caused by: java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.
Read more >565254 – [java 14] java.lang.IllegalArgumentException ... - Bugs
Created attachment 283612 [details] LTW java 14 asm fails on readConst I recently upgraded my tycho project to java 14. I use LTWeaving...
Read more >java.lang.IllegalArgumentException at org.objectweb.asm ...
IllegalArgumentException at org.objectweb.asm.ClassVisitor.<init>. 62 views ... IllegalArgumentException [INFO] at org.objectweb.asm.
Read more >"java.lang.IllegalArgumentException" while running postInstall ...
This issue occurs due to a bug in the WAS libraries. The WAS class scanner cannot handle any jar files that have a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I could solve this problem by adding the main class to the Manifest
Example:
@MartijnDwars thanks for the feedback. Normally Gradle should pick up the most latest versions for dependencies when there are conflicts. However, we learned that it is a general and recurring issue in Gradle where an old version of a dependency is loaded in a multi-module Gradle project which leads to a frequent 'Method Not Found" or “Class Not Found” exception. The good news is that, with proper project configuration, this can be fixed, so in some sense, this is a Gradle configuration issue in your project. Check out this FAQ to learn more.
Since this is a general Gradle configuration issue that can happen with any transitive dependencies of Jib (ASM happens to be the one here) and whose error can manifest in any unpredictable behavior (e.g., Method Not Found, or some behavior that works slightly differently, etc.), generally it doesn’t make much sense to increase Jib’s code complexity by adding a special handling for this particular
IllegalArgummentException
only for ASM. This is more or less out of the scope of Jib. However, if this particular error is frequent and consistent enough and many users keep running into it, it may not be unreasonable to try to catch this situation and return a helpful message. But for now, I think adding an FAQ entry is good enough. I’ll reopen this issue for tracking. Doc contributions are welcome.