Fully featured low overhead profiler for Java EE and Java SE platforms.
Easy to use performance and memory .NET profiler for Windows and Linux.
Performance monitoring and profiling of Jenkins, Bamboo, TeamCity, Gradle, Maven, Ant and JUnit.

Interaction with AOP

Moderators: Vladimir Kondratyev, Anton Katilin

Interaction with AOP

Postby cahaverl » Mon Jun 16, 2008 9:04 pm

I'm using YourKit 7.5.2 with JBoss 4.0.4 and Spring framework 2.0.6. When I try to start up my .ear file under the profiler from Eclipse 3.3, I get an exception and the deployment is aborted. When I run directly with no profiling, the code starts up fine. I tried this with both JDK 1.5.0 and 1.6 under MacOS Leopard. The Exception follows.

Carl


Code: Select all
13:05:57,442 INFO  [ContentDomainAuthenticationFilter] Setting LandingPageBaseUrl: https://www.next-dev.sflab.acrobat.com
13:05:57,717 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventMessengingListener' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot create inner bean 'jmsQueueParent$child#5513f9a2' of type [org.springframework.jndi.JndiObjectFactoryBean] while setting bean property 'destination'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsQueueParent$child#5513f9a2' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: java.lang.ClassFormatError: Illegal exception table range in class file $Proxy71
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsQueueParent$child#5513f9a2' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: java.lang.ClassFormatError: Illegal exception table range in class file $Proxy71
Caused by:
java.lang.IllegalArgumentException: java.lang.ClassFormatError: Illegal exception table range in class file $Proxy71
   at java.lang.reflect.Proxy.getProxyClass(Proxy.java:514)
   at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
   at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:117)
   at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
   at org.springframework.jndi.JndiObjectFactoryBean$JndiObjectProxyFactory.createJndiObjectProxy(JndiObjectFactoryBean.java:282)
   at org.springframework.jndi.JndiObjectFactoryBean$JndiObjectProxyFactory.access$000(JndiObjectFactoryBean.java:265)
   at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:173)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
cahaverl
 
Posts: 3
Joined: Mon Jun 16, 2008 8:57 pm

Postby Anton Katilin » Tue Jun 17, 2008 10:54 am

Hello Carl

Please look into this thread: viewtopic.php?t=782

This seems related. The problem was that AspectJ incorrectly instrumented the bytecode when it ran with profiler. The problem appeared for certain application only with profiler because the profiler (correctly!) instrumented the bytecode inserting instructions which AspectJ, in its turn, handled incorrectly.

Best regards,
Anton
Anton Katilin
 
Posts: 6086
Joined: Wed Aug 11, 2004 8:37 am

Postby Anton Katilin » Tue Jun 17, 2008 11:03 am

P.S.:

The workaround for that AspectJ bug was to ensure that AspectJ instrumentation is performed _before_ the profiler's instrumentation.

To achieve this, profiling and AspectJ weaving should be manually configured by placing corresponding VM parameters in appropriate order (first -agentpath:full_path_to_yjpagent.dll for the profiler, then -javaagent for aspectjweaver), and using "Run" instead of "Profile". Using "Profile", the parameter order depends on Eclipse internals implementation detail and cannot be affected.
Anton Katilin
 
Posts: 6086
Joined: Wed Aug 11, 2004 8:37 am

Postby cahaverl » Wed Aug 13, 2008 3:39 am

That works. Thanks.
cahaverl
 
Posts: 3
Joined: Mon Jun 16, 2008 8:57 pm


Return to Java Profiler

Who is online

Users browsing this forum: No registered users and 1 guest

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.