You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Raymond Augé (JIRA)" <ji...@apache.org> on 2018/10/31 13:37:01 UTC

[jira] [Resolved] (ARIES-1755) IllegalArgumentException on weaving

     [ https://issues.apache.org/jira/browse/ARIES-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Augé resolved ARIES-1755.
---------------------------------
    Resolution: Cannot Reproduce
      Assignee: Raymond Augé

I tested against the latest SpiFly 1.1-SNAPSHOT (currently staged for release) and I could not reproduce. I only made 2 small changes:
 # I set the maven-bundle-version to latest (4.1.0)
 # I set the version of the snapshot spifly static tool

> IllegalArgumentException on weaving
> -----------------------------------
>
>                 Key: ARIES-1755
>                 URL: https://issues.apache.org/jira/browse/ARIES-1755
>             Project: Aries
>          Issue Type: Bug
>          Components: SPI Fly
>    Affects Versions: spifly-1.0.8
>            Reporter: James Phillpotts
>            Assignee: Raymond Augé
>            Priority: Major
>         Attachments: aries-test.zip
>
>
> On weaving a jar that contains a utility loading class like this (this example is an enum, but the same happens if it's a class, anonymous inner class, etc.):
> {code:java}
> public enum Loader {
>     LOADER;
>     public <S> S load(Class<S> type) {
>         Iterator<S> services = ServiceLoader.load(type).iterator();
>         return services.hasNext() ? services.next() : null;
>     }
> }
> {code}
> The weaving throws this exception:
> {noformat}
> java.lang.IllegalArgumentException: value null
> 	at org.objectweb.asm.ClassWriter.newConstItem(ClassWriter.java:1057)
> 	at org.objectweb.asm.MethodWriter.visitLdcInsn(MethodWriter.java:1126)
> 	at org.apache.aries.spifly.weaver.TCCLSetterVisitor$TCCLSetterMethodVisitor.visitMethodInsn(TCCLSetterVisitor.java:194)
> 	at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1416)
> 	at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1017)
> 	at org.objectweb.asm.ClassReader.accept(ClassReader.java:693)
> 	at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
> 	at org.apache.aries.spifly.statictool.Main.weaveDir(Main.java:196)
> 	at org.apache.aries.spifly.statictool.Main.weaveJar(Main.java:96)
> 	at org.apache.aries.spifly.statictool.Main.main(Main.java:73)
> 	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.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
> 	at java.lang.Thread.run(Thread.java:745)
> {noformat}
> This happens regardless of whether static or dynamic weaving is used.
> I'll attach a sample project.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)