Re: [aspectj-users] AspectJ third-party class is not weaved in weblogic

2019-03-03 Thread Martin Gainty
Weblogic ClassLoader Application Tool will clear your understanding of WebLogic 
ClassLoader issues

https://docs.oracle.com/middleware/1213/wls/WLPRG/classloading.htm#WLPRG495
Understanding WebLogic Server Application 
Classloading
Java Classloader Hierarchy. Classloaders contain a hierarchy with parent 
classloaders and child classloaders. The relationship between parent and child 
classloaders is analogous to the object relationship of super classes and 
subclasses.
docs.oracle.com

hth


From: aspectj-users-boun...@eclipse.org  on 
behalf of Alexander Kriegisch 
Sent: Sunday, March 3, 2019 9:41 AM
To: aspectj-users@eclipse.org
Subject: Re: [aspectj-users] AspectJ third-party class is not weaved in weblogic

> First, it's not possible to upload code to git as full deployment is
> very complex.

That is incorrect. It **is** possible, it might just be somewhat
difficult because you need to extract a simplified MCVE reproducing your
problem from your code base. An MCVE is not your full application, by
the way - did you follow the link and read what MCVE means?

> I will try to play with classpath and see if it changes anything,

If you prefer to **play** (trial & error) instead of someone else to
help you **analyse** the situation, be my guest and do that. Just don't
ask on a mailing list then because if you need answers, the community
needs sufficient information first. No offense meant, I am just
explaining a basic fact.

> After additional weblogic log analyze, third party class loaded twice
> (from different jars locations) , the first time is loaded from
> weblogic's server/lib/consoleapp/APP-INF/lib, and it happens BEFORE
> aop.xml is loaded.
>
> Can it be the reason?

Absolutely. There is no way it could work if the weaving agent is loaded
after the classes it should weave because the weaving agent itself hooks
into the classloading mechanism and transforms the classes while they
are being loaded. I hope you can find out how to fix the classloading.

Good luck!
--
Alexander Kriegisch
https://scrum-master.de

___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.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://www.eclipse.org/mailman/listinfo/aspectj-users

Re: [aspectj-users] AspectJ third-party class is not weaved in weblogic

2019-03-03 Thread yev yev
well, i don't see how I can  do anything to classloading, agent is attached
to JVM that lunches weblogic what else can I do?
Maybe there is a weblogic expert in the group that might advice what should
I try to do.


On Sun, 3 Mar 2019 at 16:41, Alexander Kriegisch 
wrote:

> > First, it's not possible to upload code to git as full deployment is
> > very complex.
>
> That is incorrect. It **is** possible, it might just be somewhat
> difficult because you need to extract a simplified MCVE reproducing your
> problem from your code base. An MCVE is not your full application, by
> the way - did you follow the link and read what MCVE means?
>
> > I will try to play with classpath and see if it changes anything,
>
> If you prefer to **play** (trial & error) instead of someone else to
> help you **analyse** the situation, be my guest and do that. Just don't
> ask on a mailing list then because if you need answers, the community
> needs sufficient information first. No offense meant, I am just
> explaining a basic fact.
>
> > After additional weblogic log analyze, third party class loaded twice
> > (from different jars locations) , the first time is loaded from
> > weblogic's server/lib/consoleapp/APP-INF/lib, and it happens BEFORE
> > aop.xml is loaded.
> >
> > Can it be the reason?
>
> Absolutely. There is no way it could work if the weaving agent is loaded
> after the classes it should weave because the weaving agent itself hooks
> into the classloading mechanism and transforms the classes while they
> are being loaded. I hope you can find out how to fix the classloading.
>
> Good luck!
> --
> Alexander Kriegisch
> https://scrum-master.de
>
> ___
> aspectj-users mailing list
> aspectj-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.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://www.eclipse.org/mailman/listinfo/aspectj-users

Re: [aspectj-users] AspectJ third-party class is not weaved in weblogic

2019-03-03 Thread Alexander Kriegisch
> First, it's not possible to upload code to git as full deployment is
> very complex.

That is incorrect. It **is** possible, it might just be somewhat
difficult because you need to extract a simplified MCVE reproducing your
problem from your code base. An MCVE is not your full application, by
the way - did you follow the link and read what MCVE means?

> I will try to play with classpath and see if it changes anything,

If you prefer to **play** (trial & error) instead of someone else to
help you **analyse** the situation, be my guest and do that. Just don't
ask on a mailing list then because if you need answers, the community
needs sufficient information first. No offense meant, I am just
explaining a basic fact.

> After additional weblogic log analyze, third party class loaded twice
> (from different jars locations) , the first time is loaded from
> weblogic's server/lib/consoleapp/APP-INF/lib, and it happens BEFORE
> aop.xml is loaded.
> 
> Can it be the reason?

Absolutely. There is no way it could work if the weaving agent is loaded
after the classes it should weave because the weaving agent itself hooks
into the classloading mechanism and transforms the classes while they
are being loaded. I hope you can find out how to fix the classloading.

Good luck!
-- 
Alexander Kriegisch
https://scrum-master.de

___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/aspectj-users


Re: [aspectj-users] AspectJ third-party class is not weaved in weblogic

2019-03-03 Thread yev yev
Thanks.

First, it's not possible to upload code to git as full deployment is very
complex.

I will try to play with classpath and see if it changes anything,


After additional weblogic log analyze, third party class loaded twice (from
different jars locations) , the first time is loaded  from weblogic's
server/lib/consoleapp/APP-INF/lib, and it happens BEFORE aop.xml is loaded.

Can it be the reason?

On Sun, 3 Mar 2019 at 08:53, Alexander Kriegisch 
wrote:

> Correction, see below:
>
> Alexander Kriegisch schrieb am 03.03.2019 10:11:
>
> Without an MCVE  it is difficult to
> say anything definitive, but in general you seem to have one of two
> possible problems:
>
>- Class visibility issues due to classloader isolation inside your
>container (application server): Maybe the two classloaders loading the
>aspect JAR and the WAR/EAR to be woven are isolated from each other.
>- Class-loading order: Maybe your aspect JAR is loaded after the
>target classes have already been woven loaded.
>
> There might be other possible causes, I am by no means a container expert
> because I mainly work with Java SE and without application servers. I think
> you need to change your configuration in order to address this issue. What
> to do exactly is beyond my knowledge. Maybe Andy knows more. Maybe it would
> also help to push an MCVE to GitHub for everyone to reproduce to problem.
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> yev yev schrieb am 02.03.2019 16:19:
>
> I am trying to "Weave" a third-party jar with AspectJ using aspectj agent.
>
> *First test case:*
>
> MyAspectJImpl.jar - contains class with my aspect and aop.xml (with debug
> enabled)inside Meta-inf with correct mapping, and a test main class.
>
> third-party.jar
>
> aspectJ core jars.
>
> I execute main class in commandline
>
> java -javaagent:aspectjweaver.jar -cp ...
>
> on console see that that third party class was weaved, and my
> implementation works.
>
> *Second test case:*
>
> I move to weblogic aspectj agent is set in script that starts weblogic.
> thirparty jar is added to classpath in that script.
>
> in weblogic log I see that my aop was loaded
>
> [ChangeAwareClassLoader@48537e4f] info AspectJ Weaver Version 1.7.1 built on 
> Thursday Sep 6, 2012 at 16:39:22 GMT
> [ChangeAwareClassLoader@48537e4f] info register classloader 
> weblogic.utils.classloaders.ChangeAwareClassLoader@48537e4f
> [DependencyClassLoader@4d5932c7] info using configuration 
>
> But this time i don't see in the log:
>
>  debug weaving ''
>
> I do see other weavings classes (from other aop.xml that are also
> deployed).
> (i verified that other aop.xmls don't exclude the thirdparty )
>
> for example:
>
> [GenericClassLoader@62b46385]  debug weaving 'com.core.BasicSessionBean'
>
> (this class is inside an ear which is deployed)
>
> I also verified that third party class was loaded (verbose:class).
>
> Any idea how to identify why that class was not weaved?
>
> The only difference that I see, that weaved classes are inside deployed
> ear file.
>
> Thirdparty classes are inside jar that added to classpath when starting
> weblogic.Server.
>
> I can provide aop.xml but I don't think it's important because it worked
> in my first test case.
>
>
>
> ___
> aspectj-users mailing list
> aspectj-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.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://www.eclipse.org/mailman/listinfo/aspectj-users