Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » AspectJ problem
AspectJ problem [message #1756426] Thu, 16 March 2017 16:53
kamil kamil is currently offline kamil kamilFriend
Messages: 1
Registered: March 2017
Junior Member
My aspect dont get called.

So i made easier example - and it also does not get called.

core.xml
<?xml version="1.0" encoding="UTF-8"?>

<beans 
You can only use links to eclipse.org sites while you have fewer than 1 message.

    <!-- <aop:aspectj-autoproxy /> -->

    <context:load-time-weaver/>


    <!-- Aspect -->
    <!--  
    <bean id="beanName"  class="class.sth.ClazzName" />
    <bean id="beanName2"  class="class.sth.Clazz2Name" />
    -->

<!-- other beans - not aspects -->
    </beans>



aop.xml
<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>

    <weaver>
        <!-- only weave classes in our application-specific packages -->
         <include within="*"/>
    <exclude within="org.jibx*"/>
    </weaver>

    <aspects>
        <!-- weave in just this aspect -->
        <aspect name="class.sth.ClazzName"/>
        <aspect name="class.sth.Clazz2Name"/>
    </aspects>

</aspectj>



My aspect:

@Aspect
@Order(3)
public class ClazzName {

@Before("execution(* *(..))")
public void testMethod(ProceedingJoinPoint joinPoint) {
Object o = joinPoint.getArgs();
System.out.println("test");
}
}


When i run JUnit test i see this:
[ContextOverridingClassLoader@3dfaa1e4] warning parse definitions failed -- (NullPointerException) null
null
java.lang.NullPointerException
	at org.aspectj.weaver.loadtime.definition.DocumentParser.resolveEntity(DocumentParser.java:177)
	at org.apache.xerces.util.EntityResolverWrapper.resolveEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.aspectj.weaver.loadtime.definition.DocumentParser.saxParsing(DocumentParser.java:158)
	at org.aspectj.weaver.loadtime.definition.DocumentParser.parse(DocumentParser.java:123)
	at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(ClassLoaderWeavingAdaptor.java:272)
	at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(DefaultWeavingContext.java:130)
	at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:156)
	at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(Aj.java:340)
	at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(Aj.java:345)
	at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:319)
	at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:113)
	at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:54)
	at sun.instrument.TransformerManager.transform(Unknown Source)
	at sun.instrument.InstrumentationImpl.transform(Unknown Source)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at org.springframework.context.support.ContextTypeMatchClassLoader$ContextOverridingClassLoader.loadClassForOverriding(ContextTypeMatchClassLoader.java:109)
	at org.springframework.core.OverridingClassLoader.loadClass(OverridingClassLoader.java:61)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.springframework.context.support.ContextTypeMatchClassLoader.loadClass(ContextTypeMatchClassLoader.java:63)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:260)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1287)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1261)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:578)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1338)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:405)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:357)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:327)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
	at org.springframework.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:216)
	at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:192)
	at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:172)
	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:133)
	at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:101)
	at junit.framework.TestCase.runBare(TestCase.java:132)
	at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:79)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Previous Topic:How the Aspect Bundle run with Eclipse
Next Topic:Odd StackMap error with 1.8.9 and wrapping new calls
Goto Forum:
  


Current Time: Thu Dec 14 04:26:15 GMT 2017

Powered by FUDForum. Page generated in 0.02034 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software