Announcement Announcement Module
Collapse
No announcement yet.
neo4j - ant -aspectj - the method persist() is undefined Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • neo4j - ant -aspectj - the method persist() is undefined

    Hi,

    Java 1.7u01
    Spring 3.0.6
    Neo4j 1.5
    Spring Data Neo4j 2.0.0.RC1

    I'm trying to compile a simple class:

    Code:
    @NodeEntity
    public class Person {
    
        @Indexed
        private String id; 
    
        public String getId() {
            return id; 
        }   
    
        public void setId(String id) {
            this.id = id; 
        }   
    }
    I have a little controller that persists:

    Code:
    @Controller("saveController")
    public class SaveControllerImpl {
    
        @ResponseBody
        @RequestMapping(value = "/ktt")
        public Map ofir(@PathVariable final Long id) {
    
            Person person = new Person();
            person.setId("ktt");
            person.persist();
    
            return Collections.singletonMap("key", "val7");
        }   
    }
    I have this set as my ant target:

    Code:
        <target name="aspectj" unless="skip.aspectj" description="Compiles classes in the src directory.">
            <taskdef classpathref="build.all.classpath" resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" />
            <iajc debug="true" deprecation="false" nowarn="true" sourceroots="${src.dir}" destDir="${build.tmp.dir}" classpathref="build.classpath" source="1.6" showWeaveInfo="true" target="1.6" >
                <aspectpath>
                    <pathelement location="${libs.dir}/runtime/spring-aspects-${spring.version}.jar"/>
                </aspectpath>
                <aspectpath>
                    <pathelement location="${libs.dir}/runtime/spring-data-neo4j-${spring.data.neo4j.version}.jar"/>
                </aspectpath>
            </iajc>
        </target>
    However, when I come to compile the src, I am repeatingly getting this error in compliation:

    Code:
    aspectj:
         [iajc] error at person.persist();
         [iajc]        
         [iajc] /Users/bootlaces/development/workspaces/java/ktt/ktt-seo/src/main/java/uk/co/ktt/controller/impl/SaveControllerImpl.java:27:0::0 The method persist() is undefined for the type Person
         [iajc] warning at /Users/bootlaces/development/workspaces/java/ktt/ktt-seo/libs/runtime/spring-aspects-3.0.6.RELEASE.jar!org/springframework/orm/jpa/aspectj/JpaExceptionTranslatorAspect.class:14::0 advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has not been applied [Xlint:adviceDidNotMatch]
         [iajc] warning at org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControl.aj:64::0 advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
         [iajc] warning at /Users/bootlaces/development/workspaces/java/ktt/ktt-seo/libs/runtime/spring-aspects-3.0.6.RELEASE.jar!org/springframework/mock/staticmock/AbstractMethodMockingControl.class:160::0 advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
         [iajc] warning at /Users/bootlaces/development/workspaces/java/ktt/ktt-seo/libs/runtime/spring-aspects-3.0.6.RELEASE.jar!org/springframework/mock/staticmock/AbstractMethodMockingControl.class:169::0 advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
         [iajc] warning at /Users/bootlaces/development/workspaces/java/ktt/ktt-seo/libs/runtime/spring-aspects-3.0.6.RELEASE.jar!org/springframework/scheduling/aspectj/AbstractAsyncExecutionAspect.class:52::0 advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
         [iajc] MessageHolder:  (10 info)  (5 warning)  (1 error) 
         [iajc] [error   0]: error at person.persist();
         [iajc]        
         [iajc] /Users/bootlaces/development/workspaces/java/ktt/ktt-seo/src/main/java/uk/co/ktt/controller/impl/SaveControllerImpl.java:27:0::0 The method persist() is undefined for the type Person
    Here is a list of my jars that I'm compiling against:

    Code:
    aopalliance-1.0.jar
    asm-3.3.1.jar
    asm-tree-3.3.1.jar
    aspectjrt-1.6.12.jar
    aspectjtools-1.6.12.jar
    cglib-2.2.jar
    geronimo-jta_1.1_spec-1.1.1.jar
    guava-10.0.jar
    hibernate-validator-4.2.0.Final.jar
    jackson-core-lgpl-1.8.5.jar
    jackson-mapper-lgpl-1.8.5.jar
    jcl-over-slf4j-1.6.4.jar
    jsr305-1.3.9.jar
    logback-classic-1.0.0.jar
    logback-core-1.0.0.jar
    lucene-core-3.1.0.jar
    neo4j-1.5.jar
    neo4j-community-1.5.jar
    neo4j-cypher-1.5.jar
    neo4j-cypher-dsl-1.5.M1.jar
    neo4j-graph-algo-1.5.jar
    neo4j-graph-matching-1.5.jar
    neo4j-jmx-1.5.jar
    neo4j-kernel-1.5.jar
    neo4j-lucene-index-1.5.jar
    neo4j-udc-1.5.jar
    persistence-api-1.0.jar
    scala-library-2.9.0-1.jar
    slf4j-api-1.6.4.jar
    slf4j-log4j12-1.6.1.jar
    spring-aop-3.0.6.RELEASE.jar
    spring-asm-3.0.6.RELEASE.jar
    spring-aspects-3.0.6.RELEASE.jar
    spring-beans-3.0.6.RELEASE.jar
    spring-context-3.0.6.RELEASE.jar
    spring-context-support-3.0.6.RELEASE.jar
    spring-core-3.0.6.RELEASE.jar
    spring-data-commons-core-1.2.0.M2.jar
    spring-data-neo4j-2.0.0.RC1.jar
    spring-data-neo4j-aspects-2.0.0.RC1.jar
    spring-expression-3.0.6.RELEASE.jar
    spring-jdbc-3.0.6.RELEASE.jar
    spring-orm-3.0.6.RELEASE.jar                                                                                                                                                                                                                                     
    spring-test-3.0.6.RELEASE.jar
    spring-tx-3.0.6.RELEASE.jar
    spring-web-3.0.6.RELEASE.jar
    spring-webmvc-3.0.6.RELEASE.jar
    validation-api-1.0.0.GA.jar
    I'm at a loss as to what could be the problem. Would anyone have any idea?

    Thanks - greatly appreciated

    -=bootlaces=-

  • #2
    I had the very same issue using maven instead.
    I think you should wave aspects into spring-data-neo4j-aspects-${spring.data.neo4j.version}.jar

    Doing that I managed to compile my tests with injected methods like persist().

    ( unfortunately I can't say the same thing for build with eclipse )

    Comment

    Working...
    X