Yes - I'm building with JDK 1.8.  If it is helpful, I can try to put
together a POC to demonstrate the issue, but not sure how easy that will be
to do.

I suspect (although not sure why) that AJ is failing might have something
to do with running the entire build with the -noverify flag (so the classes
are generated and enhanced without updating the stackmap, and then AJC is
run within the same -noverify jvm).  If I remove the -noverify flag and
only run the AJC part, the error disappears.  But of course, my problem
stems that I can't compile my persistence layer module without the
-noverify flag (uses Java7+ code) or my persistence enhancer generates
invalid stackmaps that break later processes.

I am working on updating the enhancer library to regenerate the stackmap in
the meantime to "fix it properly" ish.

Thanks,

Eric

On Thu, Oct 12, 2017 at 12:45 PM, Andy Clement <andrew.clem...@gmail.com>
wrote:

> You are only able to turn off the stackmap generation if targeting 1.6
> because that is the level where they were optional.
> (-Xset:generateStackMaps=false) at targets 1.7 and above your error
> indicates this code is failing:
>
>
> *try* {
>
> Class<?> reader = Class.forName("aj.org.objectweb.asm.ClassReader");
>
> Class<?> visitor = Class.forName("aj.org.objectweb.asm.ClassVisitor");
>
> Method m = reader.getMethod("accept", *new* Class[] { visitor, Integer.
> *TYPE* });
>
> isAsmAround = m != *null*;
>
> } *catch* (Exception e) {
>
> isAsmAround = *false*;
>
> }
>
> For some reason we can't find those classes even though they should be in
> the AspectJ jars you are using? (You could check your 1.8.10 artifacts
> include them... but I can't see why not).  There is a 1.8.11 you could also
> try but the packaging has not changed there. I am confused why the check
> above is failing for you. You could raise an issue but without being able
> to recreate I'm not sure how I'd diagnose things.  What JDK are you running
> the build itself on, 1.8 I presume?
>
> cheers,
> Andy
>
> On 10 October 2017 at 20:06, Eric B <ebenza...@gmail.com> wrote:
>
>> Thanks Andy!
>>
>> I'll take a look into this and see if I can leverage it for my own use
>> case.
>>
>> Also, please let me know if the Error that I am seeing is a bug in AJ, or
>> expected behaviour.  Do you need me to open a ticket for that?
>>
>> Thanks,
>>
>> Eric
>>
>>
>> On Tue, Oct 10, 2017 at 3:34 PM, Andy Clement <andrew.clem...@gmail.com>
>> wrote:
>>
>>> The very basic visitor AspectJ uses is here: https://github.com/eclip
>>> se/org.aspectj/blob/6d6738cfece6328027916681e67e54225531db38
>>> /weaver/src/org/aspectj/weaver/bcel/asm/StackMapAdder.java
>>>
>>> cheers,
>>> Andy
>>>
>>> On 10 October 2017 at 12:32, Andy Clement <andrew.clem...@gmail.com>
>>> wrote:
>>>
>>>> Hey Eric,
>>>>
>>>> The error above is saying it can't find the asm rather than that there
>>>> is an issue with missing stack maps. Although possibly the error is
>>>> occurring because as a side effect of the missing stack maps, I'd need to
>>>> check.
>>>>
>>>> > Are there libraries to manipulate/generate a stackmap?
>>>>
>>>> This is exactly what AspectJ is using Asm for. We weave/modify the
>>>> bytecode and rather than incrementally try and patch up the stack maps, we
>>>> just generate entirely fresh ones at the end of the process. A very basic
>>>> Asm visitor to read/write the bytecode will produce them.  Which is why I'm
>>>> surprised about the message - we aren't looking for existing ones to fix
>>>> up, we are just looking for that version of asm to write out entirely new
>>>> ones.
>>>>
>>>> cheers,
>>>> Andy
>>>>
>>>>
>>>> On 7 October 2017 at 05:49, Eric B <ebenza...@gmail.com> wrote:
>>>>
>>>>> While I don't disagree with your answer, I dont have the first clue
>>>>> how to fix a legacy jdo library (circa 2004) that performs byte 
>>>>> enhancement
>>>>> and does not write the stackmap.    Are there libraries to
>>>>> manipulate/generate a stackmap?
>>>>>
>>>>> Is there anything else can I do in the meantime to unblock the
>>>>> situation?
>>>>>
>>>>> Thanks
>>>>> Eric
>>>>>
>>>>>
>>>>> On Oct 7, 2017 12:11 AM, "Alexander Kriegisch" <
>>>>> alexan...@kriegisch.name> wrote:
>>>>>
>>>>> I know that this is not the answer you are looking for, but my
>>>>> suggestion is to heal the illness instead of taking pills against its
>>>>> symptoms. Go fix your problem in the other module which requires noverify
>>>>> in the first place. Generating broken bytecode does not sound like a wise
>>>>> approach to me.
>>>>>
>>>>> --
>>>>> Alexander Kriegisch
>>>>>
>>>>>
>>>>> > Am 07.10.2017 um 02:55 schrieb Eric B <ebenza...@gmail.com>:
>>>>> >
>>>>> > I'm running into a problem with AspectJ 1.8.10, and not sure how to
>>>>> resolve this.
>>>>> >
>>>>> > I have a multi-module maven build.  One of my modules requires
>>>>> running an ant task (using the antrun-maven-plugin) with the jvm -noverify
>>>>> flag.  Consequently, I run the entire maven build using the -noverify 
>>>>> flag.
>>>>> >
>>>>> > However, my last module in my build is an AspectJ module.  When I
>>>>> try to compile it using the aspectj-maven-plugin, I get the following 
>>>>> error
>>>>> thrown:
>>>>> >
>>>>> > [ERROR] Failed to execute goal 
>>>>> > org.codehaus.mojo:aspectj-maven-plugin:1.10:compile
>>>>> (default) on project adams-aspects: AJC compiler errors:
>>>>> > [ERROR] abort ABORT -- (BCException) Unable to find Asm for stackmap
>>>>> generation (Looking for 'aj.org.objectweb.asm.ClassReader'). Stackmap
>>>>> generation for woven code is required to avoid verify errors on a Java 1.7
>>>>> or higher runtime
>>>>> > [ERROR] when weaving type webapp.tiles.AthleteBasedForm
>>>>> > [ERROR] when weaving classes
>>>>> > [ERROR] when weaving
>>>>> > [ERROR] when batch building BuildConfig[null] #Files=8 AopXmls=#0
>>>>> > [ERROR]
>>>>> >
>>>>> >
>>>>> > So I'm a bit in a bind.  I can't figure out any way to reconcile
>>>>> both requirements - that module1 needs to run a plugin with the -noverify
>>>>> parameter, and the aspectj plugin that needs to run it without.
>>>>> >
>>>>> > Is there anyway I can disable the need for the stackmap generation
>>>>> to exist in AJ 1.8.10?  I've looked for parameters I can pass to ajc but
>>>>> can't find any.
>>>>> >
>>>>> > Thanks,
>>>>> >
>>>>> > Eric
>>>>> >
>>>>> > _______________________________________________
>>>>> > aspectj-users mailing list
>>>>> > aspectj-users@eclipse.org
>>>>> > To change your delivery options, retrieve your password, or
>>>>> unsubscribe from this list, visit
>>>>> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>>>>
>>>>> _______________________________________________
>>>>> aspectj-users mailing list
>>>>> aspectj-users@eclipse.org
>>>>> To change your delivery options, retrieve your password, or
>>>>> unsubscribe from this list, visit
>>>>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> aspectj-users mailing list
>>>>> aspectj-users@eclipse.org
>>>>> To change your delivery options, retrieve your password, or
>>>>> unsubscribe from this list, visit
>>>>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> aspectj-users mailing list
>>> aspectj-users@eclipse.org
>>> To change your delivery options, retrieve your password, or unsubscribe
>>> from this list, visit
>>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>>
>>
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@eclipse.org
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to