Comments (11)
...a bit more info...
Please ignore the Type.a(null, 0) values above, they're wrong (post-exception).
The
char array (b[]) definitely has the poison value: This value is just a string
in
a .class. But apparently while doing mapPath(), the type is created as an
ARRAY
sort, and it's not, it's a string. Then mapType() is called, tries to get the
element type descriptor for the internal name, and barfs.
So in a nutshell, having a String in a class that happens to start with "[" and
also
contains something that looks like a RESOURCE causes the problem.
Original comment by [email protected]
on 7 Aug 2007 at 1:53
from jarjar.
I'm experiencing the same Exception while bundling Objectweb asm-3.0.jar to a
jar.
Tried 1.0rc3 and 1.0rc5
Original comment by [email protected]
on 8 Aug 2007 at 8:52
from jarjar.
FYI, I've temporarily added an ugly hack around the problem in my local
com.tonicsystems.jarjar.PackageRemapper.mapPath(). Given the current impl of
ASM,
it looks like this method is especially dangerous before and after the hack -
it
could easily still fail: there are an infinite number of poison values that
will
throw or cause other havoc. I changed this section (look at the original code
and
it'll be obvious):
boolean absolute = s.startsWith("/");
if (absolute)
s = s.substring(1);
boolean array = s.startsWith("[");
if (array)
s = s.substring(1);
String after = mapType(s);
s = after;
if (array)
s = "[" + s;
if (absolute)
s = "/" + s;
Original comment by [email protected]
on 8 Aug 2007 at 5:53
from jarjar.
The jarjar task is working again after making this change.
Original comment by [email protected]
on 9 Aug 2007 at 6:51
from jarjar.
New JarJar release coming soon with this fix in it? JRuby is pushing a release
in a
couple weeks and we need to update JarJar to handle our annotation-based classes
correctly; but we ship ASM.
Original comment by [email protected]
on 22 Oct 2007 at 1:25
from jarjar.
FYI, here's the JRuby issue that's prompted us to upgrade JarJar:
http://jira.codehaus.org/browse/JRUBY-1456. Hopefully this is fixed already?
Original comment by [email protected]
on 22 Oct 2007 at 1:29
from jarjar.
This issue also appears when repackaging Rhino 1.6 R7.
Original comment by [email protected]
on 22 Oct 2007 at 10:16
from jarjar.
The hack (downloadable from http://jira.codehaus.org/browse/JRUBY-1456)
repackages
Rhino 1.6 R7 without failing to build, however, the new version of Rhino still
creates class files using the old types. Presumably jarjar would have to
change the
behaviour of org.mozilla.javascript.optimizer.Codegen as well.
Original comment by [email protected]
on 22 Oct 2007 at 10:28
from jarjar.
I had the named problem directly after downloading jarjar and trying to apply
it to a
project where Groovy (groovy-all-1.0.jar) is involved.
I think that AsmClassGenerator.class causes the problem (the next one expected
to be
listed but missing in the 'adding'-list below).
The hack provided by psychesy in Comment No 3 seems to have solved it.
--------------------------------------------------------------------------------
-----
[...]
[jarjar] adding entry org/codehaus/groovy/bsf/GroovyEngine.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$1.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$2.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$3.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$4.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$5.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$6.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$7.class
BUILD FAILED
D:\Sdegui\build.xml:74: java.lang.ArrayIndexOutOfBoundsException: 20
at org.apache.tools.ant.Task.perform(Task.java:373)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1220)
at org.apache.tools.ant.Project.executeTarget(Project.java:1189)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1072)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 20
at com.tonicsystems.jarjar.asm.Type.a(Unknown Source)
at com.tonicsystems.jarjar.asm.Type.getElementType(Unknown Source)
at com.tonicsystems.jarjar.asm.commons.Remapper.mapType(Unknown Source)
at com.tonicsystems.jarjar.asm.commons.Remapper.mapType(Unknown Source)
at com.tonicsystems.jarjar.PackageRemapper.mapPath(PackageRemapper.java:82)
at com.tonicsystems.jarjar.PackageRemapper.mapValue(PackageRemapper.java:104)
at
com.tonicsystems.jarjar.asm.commons.RemappingMethodAdapter.visitLdcInsn(Unknown
Source)
at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
at
com.tonicsystems.jarjar.ext_util.JarTransformer.process(JarTransformer.java:35)
at
com.tonicsystems.jarjar.ext_util.JarProcessorChain.process(JarProcessorChain.jav
a:31)
at com.tonicsystems.jarjar.MainProcessor.process(MainProcessor.java:83)
at
com.tonicsystems.jarjar.ext_util.AntJarProcessor.zipFile(AntJarProcessor.java:55
)
at org.apache.tools.ant.taskdefs.Zip.zipFile(Zip.java:1146)
at org.apache.tools.ant.taskdefs.Zip.addResources(Zip.java:681)
at org.apache.tools.ant.taskdefs.Zip.executeMain(Zip.java:481)
at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:350)
at
com.tonicsystems.jarjar.ext_util.AntJarProcessor.execute(AntJarProcessor.java:42
)
at com.tonicsystems.jarjar.JarJarTask.execute(JarJarTask.java:50)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
... 10 more
--- Nested Exception ---
java.lang.ArrayIndexOutOfBoundsException: 20
at com.tonicsystems.jarjar.asm.Type.a(Unknown Source)
at com.tonicsystems.jarjar.asm.Type.getElementType(Unknown Source)
at com.tonicsystems.jarjar.asm.commons.Remapper.mapType(Unknown Source)
at com.tonicsystems.jarjar.asm.commons.Remapper.mapType(Unknown Source)
at com.tonicsystems.jarjar.PackageRemapper.mapPath(PackageRemapper.java:82)
at com.tonicsystems.jarjar.PackageRemapper.mapValue(PackageRemapper.java:104)
at
com.tonicsystems.jarjar.asm.commons.RemappingMethodAdapter.visitLdcInsn(Unknown
Source)
at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
at
com.tonicsystems.jarjar.ext_util.JarTransformer.process(JarTransformer.java:35)
at
com.tonicsystems.jarjar.ext_util.JarProcessorChain.process(JarProcessorChain.jav
a:31)
at com.tonicsystems.jarjar.MainProcessor.process(MainProcessor.java:83)
at
com.tonicsystems.jarjar.ext_util.AntJarProcessor.zipFile(AntJarProcessor.java:55
)
at org.apache.tools.ant.taskdefs.Zip.zipFile(Zip.java:1146)
at org.apache.tools.ant.taskdefs.Zip.addResources(Zip.java:681)
at org.apache.tools.ant.taskdefs.Zip.executeMain(Zip.java:481)
at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:350)
at
com.tonicsystems.jarjar.ext_util.AntJarProcessor.execute(AntJarProcessor.java:42
)
at com.tonicsystems.jarjar.JarJarTask.execute(JarJarTask.java:50)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1220)
at org.apache.tools.ant.Project.executeTarget(Project.java:1189)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1072)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Original comment by [email protected]
on 7 Nov 2007 at 11:21
from jarjar.
Sorry, for some reason I was not getting notification of issues posted here.
I'll
investigate the problem and get a new release out ASAP.
Original comment by [email protected]
on 7 Nov 2007 at 8:57
- Changed state: Accepted
from jarjar.
Fixes checked into SVN. Please give it a go. I'll put out a new release later
this week.
Sorry for the delay! The project was configured to send issue updates to the
mailing
list but something must have gone wrong.
Original comment by [email protected]
on 8 Nov 2007 at 6:21
- Changed state: Fixed
from jarjar.
Related Issues (20)
- Resources repackaged but not zapped
- Upgrade to ASM 4 HOT 5
- Missing 1.2 in Maven Central HOT 3
- Fix up Export-Package in MANIFEST.MF when running jar jar.
- jarjarXXXXXX.jar files are not deleted from the temp directory
- Jarjar rules file syntax should support comments HOT 1
- Provide public API for reusing jarjar as library (e.g. in a gradle task)
- The jarjar-1.4 binary package is empty
- jarjar-1.4.jar package does not contain any class file
- Java source filenames ignored by jarjar rules that work for classes.
- jarjar should rename inner $SwitchMap$com$foo$MyEnum class generated by enum switch
- version 1.4 not published in maven
- Empty directories in jar HOT 1
- Class not included in jar but it should be
- Please add to wiki (i'll be happy to if i have permission) a command line example with conversion of jar
- jarjar fails to repackage Java8 classes
- jarjar doesn't support JDK8/JDK9 HOT 1
- Support single class files as the classpath(s) to "find"
- Jarjar not shrink jar library
- Not exported to GitHub by the maintainers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jarjar.