Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Aspect runs on laptop but not on server

Thanks, Andy.  I will get to that, but we are wondering about something else right now...

I am able to build the aspect, along with some supporting Groovy classes, and the resulting jar runs fine, as it has for months.  A colleague is trying to build my code, using my build script.  Everything seems essentially identical on the two machines (Groovy version is exact, Java version is off by a single build version (22 vs. 23), ajc is off by a single build version (10 vs 11)).  Yet he can't build a jar that works.  He gets "bad version number in .class file."  He is able to run with a jar that I build.  And I get the same "bad version number" with a jar that he builds.  It's clearly his build process, but it's a mystery what's different.  And we're not sure if it's the aspect class or the groovy classes.

Now, I don't necessarily expect you to resolve that for us, but something came up in the process of trying to figure this out...

My ajc command starts out like

	ajc -1.5 -target 1.5 -cp ...

When I set this up, I thought the 1.5's referred to the JVM version, but now I'm starting to wonder if they actually refer to the AspectJ version.  And, if so, what impact that might have on my AspectJ code, if I'm referring to 1.6 docs while compiling with 1.5 compliance.

The reason the version number is significant is that the version of Sonic we're using runs in Java 5 containers, so we have to build to Java 5 class files.

Can you please comment on the ajc arguments and how they might impact my aspect code?  And if you have any thoughts on the difference in builds on the two machines, we're all ears!

Many thanks,
Lee

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
Sent: Thursday, April 07, 2011 10:47 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Aspect runs on laptop but not on server

HI Lee,

You have the -showWeaveInfo option for LTW which will show if you are accidentally matching places you didn't expect to (and so doubly consuming your message).  To see 'all the calls' you can build an aspect that shows them all, something like "call(* *(..))" but you need to scope that or you'll get a million bits of output, either qualify the declaring type in the call "call(* TargetOfInterest.*(..))" or use a target "call(* *(..)) && target(TargetOfInterest)" or use a within "call(* *(..)) && within(codeThatMakesTheCalls)".  In the advice just printout the thisJoinPointStaticPart.

Andy

On 7 April 2011 07:35, Grey, Lee <Lee.Grey@xxxxxxx> wrote:
> Well, all is not resolved.  In the process of fixing the sandbox, I 
> broke the development environment.
>
> The way things are going now, it seems that the service() method's 
> around advice is being invoked more than once per message, which means 
> that the message gets consumed on the first pass and is therefore null 
> on the second pass through the advice.
>
> There is obviously some complexity to the path through the Sonic ESB 
> container.  What tools do I have at my disposal to actually see all 
> the calls and pick the spot where I want to advise the method call?  
> I'm flying blind, and I have no idea how to fix this now.
>
> To make things even more interesting, tomorrow is my last day at this 
> job, and I don't want to leave this problem for them.  I really need 
> to get this worked out this week.
>
> Help!
>
> Thanks,
> Lee
> ________________________________
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Grey, Lee
> Sent: Wednesday, April 06, 2011 7:07 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] Aspect runs on laptop but not on server
>
> I'll answer my own question for the benefit of others:
>
> The problem was that the container in the sandbox had different 
> services deployed into it than the container on my laptop.  In 
> particular, the services in the sandbox were a subset of the services 
> in the laptop container.  And, therefore, the pointcuts were just a 
> little bit different, in a way that matched on the laptop but not in the sandbox.
>
> By making the pointcuts a bit more inclusive, they started matching in 
> the sandbox.
>
> Thanks for wringing your hands with me,  ;-) Lee 
> ________________________________
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Grey, Lee
> Sent: Wednesday, April 06, 2011 3:30 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Aspect runs on laptop but not on server
>
> I've built an aspect to wrap around Sonic ESB's XQService.service() 
> method, and it's been working perfectly on my laptop (Windows XP, JRE 
> 1.5.0_22, Sonic Workbench).
>
> Now, I'm trying to deploy the same exact jars in the same exact way to 
> our sandbox pre-production environment (Red Hat 4.1.2-48, JDK 
> 1.5.0_22, Sonic MQ and ESB installation), but things aren't working.
>
> What seems to be happening is that on my laptop, the aspect weaving 
> takes place and the aspect is instantiated at the time the container starts up.
> In the sandbox, however, I see the same message regarding weaving, so 
> I am pretty confident that the -javaagent parameter did its thing, but 
> my pointcuts don't seem to match anything, either at initialization or 
> during normal runtime.  I am printing out a message in my advice when 
> SonicMQ messages are processed, and it appears on my laptop but not on the server.
> I see no signs of my advice ever executing on the server.
>
> This is the message I see in both environments during container 
> startup, so I believe that means the ltw happened:
>
> [DelegatingLoader@10d0eae] warning javax.* types are not being woven 
> because the
>  weaver option '-Xset:weaveJavaxPackages=true' has not been specified
>
> I don't know what might account for this kind of problem.  I am open 
> to any suggestions for getting to the bottom of this.
>
> Thanks,
> Lee Grey
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top