public static DisableBeanConfigurerForSessionFactoryInitAspect
aspectOf() {
return
Aspects.aspectOf(DisableBeanConfigurerForSessionFactoryInitAspect.class);
}
When spring calls the aspectOf() method the aspect has not been
constructed by aspectj. This is a problem in my configuration that I can
fix. Also I suspect I should be catching NoAspectBoundException. But the
recursion shown below still seems to be a problem.
Here's the stacktrace:
13:16:43,765
WARN-org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy
- Factory method [public static
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect.aspectOf()]
threw exception
[][main][org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy]
org.aspectj.lang.NoAspectBoundException: Exception while initializing
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect:
java.lang.reflect.InvocationTargetException
at org.aspectj.lang.Aspects.aspectOf(Aspects.java:50)
at
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect.aspectOf(DisableBeanConfigurerForSessionFactoryInitAspect.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:109)
at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:281)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:524)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:364)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:238)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:148)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:63)
at
org.opentrader.platform.samples.transactional.TransactionalSample.loadContext(TransactionalSample.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:485)
at
org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:311)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:149)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:77)
at org.testng.TestRunner.privateRun(TestRunner.java:614)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:221)
at org.testng.SuiteRunner.run(SuiteRunner.java:147)
at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:98)
at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.aspectj.lang.Aspects.aspectOf(Aspects.java:47)
... 31 more
Caused by: org.aspectj.lang.NoAspectBoundException: Exception while
initializing
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect:
java.lang.reflect.InvocationTargetException
at org.aspectj.lang.Aspects.aspectOf(Aspects.java:50)
at
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect.aspectOf(DisableBeanConfigurerForSessionFactoryInitAspect.java:21)
... 36 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.aspectj.lang.Aspects.aspectOf(Aspects.java:47)
... 37 more
Caused by: org.aspectj.lang.NoAspectBoundException: Exception while
initializing
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect:
java.lang.reflect.InvocationTargetException
at org.aspectj.lang.Aspects.aspectOf(Aspects.java:50)
at
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect.aspectOf(DisableBeanConfigurerForSessionFactoryInitAspect.java:21)
... 42 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.aspectj.lang.Aspects.aspectOf(Aspects.java:47)
... 43 more
Caused by: org.aspectj.lang.NoAspectBoundException: Exception while
initializing
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect:
java.lang.reflect.InvocationTargetException
at org.aspectj.lang.Aspects.aspectOf(Aspects.java:50)
at
org.opentrader.infra.hibernate.DisableBeanConfigurerForSessionFactoryInitAspect.aspectOf(DisableBeanConfigurerForSessionFactoryInitAspect.java:21)
... 48 more