Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Why Aspectj is weaving excluded packages

Can you turn off the security manager temporarily to see what the exception is that it is trying to dump?

Andy


On 9 July 2013 02:06, Krishna Jasty <krishna.jasty@xxxxxxx> wrote:
Thanks Andy,
 
I did the code change accordingly, here is the changed code. I tested the aspectj accordingly.
 
 pointcut apppackage(): within(com.tcs..*);
 pointcut thirdpartypack():execution(* com.ibm..*(..));
 pointcut seperate(): !within(com.ibm..*);
 pointcut UtilMethods() :  apppackage() && (call( * java.util..add(..)) || call( * java.util.Map..put(..))) && !myclass() && !cflow(thirdpartypack()) && seperate();
 
 
Then the following AccessControl Permission is coming from the websphere7 application server. Here is the error trace.
 
[7/9/13 14:29:20:728 GMT+05:30] 00000000 Dump          I org.aspectj.weaver.tools.Jdk14Trace info Dumping to stderr
[7/9/13 14:29:20:759 GMT+05:30] 00000000 Aj            E org.aspectj.weaver.tools.Jdk14Trace error com/ibm/ws/runtime/WsServer$Implementation
                                 java.security.AccessControlException: Access denied (java.util.PropertyPermission * read,write)
 at java.security.AccessController.checkPermission(AccessController.java:108)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
 at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1252)
 at java.lang.System.getProperties(System.java:318)
 at org.aspectj.weaver.Dump.dumpSytemProperties(Dump.java:363)
 at org.aspectj.weaver.Dump.dumpDefault(Dump.java:298)
 at org.aspectj.weaver.Dump.dumpOnExit(Dump.java:154)
 at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:112)
 at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:54)
 at sun.instrument.TransformerManager.transform(TransformerManager.java:181)
 at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:377)
 at java.lang.ClassLoader.defineClassImpl(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:265)
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:160)
 at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:550)
 at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:520)
 at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:451)
 at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassName(ClasspathManager.java:430)
 at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417)
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:188)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:334)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:386)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
 at com.ibm.ws.runtime.WsServer.<clinit>(WsServer.java:51)
 at java.lang.J9VMInternals.initializeImpl(Native Method)
 at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
 at java.lang.J9VMInternals.newInstanceImpl(Native Method)
 at java.lang.Class.newInstance(Class.java:1325)
 at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:157)
 at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:770)
 at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
 at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
 at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:173)
 at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:93)
 at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:74)
 at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
 at java.lang.reflect.Method.invoke(Method.java:599)
 at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)
 at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
 at org.eclipse.core.launcher.Main.run(Main.java:981)
 at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:340)
 at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:110)

Thanks
Krishna
To: aspectj-users@xxxxxxxxxxx
From: Andy Clement
Sent by: aspectj-users-bounces@xxxxxxxxxxx
Date: 07/09/2013 05:13AM
Subject: Re: [aspectj-users] Why Aspectj is weaving excluded packages


It is trying to weave com.ibm.db2.jcc.b.kc because it contains calls to add or put. Cflow is implemented by inserting a check at the joinpoint of interest which does the check as to whether we are actually in the specified control flow.  Your code might be in com.tcs..* but maybe you use code in com.ibm.db2.jcc.b.kc (we don't know) - that would mean calls made from add/put are in the control flow of your code.

Unfortunately com.ibm.db2.jcc.b.kc looks to be near some size limits for bytecode and is dangerous to weave because the limits will get blown. I would add a !within(com.ibm.db2.jcc.b.kc) to your pointcut to skip that class.

If you are only interested in calls made from code within com.tcs..* and not from any transitively invoked code you could skip cflow and use within(com.tcs..*)

Andy



On 4 July 2013 00:53, Krishna Jasty <krishna.jasty@xxxxxxx> wrote:
Hi ,
 
I specified weaving as follows in the code
 
pointcut myclass() : within(HeapAspect);
pointcut apppackage(): execution (* com.tcs..*(..));
pointcut UtilMethods() : cflow(apppackage()) && (call( * java.util..add(..)) || call( * java.util.Map..put(..))) && !myclass();
But it is trying to weave the com.ibm package as well. Is there a solution for this.
 
[java] [AppClassLoader@df6ccd] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
  [java] [AppClassLoader@df6ccd] error at com\ibm\db2\jcc\b\kc.java::0 problem generating method com.ibm.db2.jcc.b.kc.<clinit> : Code size too big: 94185
  [java] Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file com/ibm/db2/jcc/b/kc
 
Thanks,
Krishnachaitanya Jasty

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you


_______________________________________________
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

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top