Results 1 to 9 of 9

Thread: aspectj library problem in new Spring Roo Project

  1. #1

    Default aspectj library problem in new Spring Roo Project

    I'm creating a new Spring Roo Project (using STS in Eclipse), but the brand new project has an error:

    classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath)

    I can fix it by manually going into the project Properties -> Java Build Path -> Add Variable... and selecting the ASPECTJRT_LIB, but it didn;t use to do that. Is this an error in my setup, or a bug I need to report?

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    Does your project in Eclipse show aspectjrt and aspectjweaver in the 'Maven Dependencies' view?
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  3. #3

    Default

    Yes, both are in the dependencies list.

    Edit:
    I'm suspecting that Maven is borked up, because I'm not able to search to find the matching version of org.aspectj. I also only get one choice for Maven (dependency management only) when I'm creating the new Spring Roo project.
    Last edited by dsp; Jul 29th, 2011 at 08:26 AM.

  4. #4

    Default

    Definitely Maven problems. Poking around showed that the project wasn't even "mavenized". I went in to the project context menu and selected Configure -> convert to Maven, then had to monkey around with updating the project configuration. It finally started to behave better, but I've got 2 errors:

    Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (execution: default, phase: process-sources)
    Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:test-compile (execution: default, phase: process-test-sources)

    and a warning:
    Overriding managed version 2.2-beta-5 for maven-assembly-plugin

    in the generated pom.xml.

  5. #5

    Default

    Any ideas why the new Spring Roo project isn't created as Mavenized? And shouldn't there be two options for Maven integration, instead of just dependency? When I check the .project file I get:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
    	<name>test2</name>
    	<comment></comment>
    	<projects>
    	</projects>
    	<buildSpec>
    		<buildCommand>
    			<name>org.eclipse.ajdt.core.ajbuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    		<buildCommand>
    			<name>org.springframework.ide.eclipse.core.springbuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    	</buildSpec>
    	<natures>
    		<nature>org.eclipse.jdt.core.javanature</nature>
    		<nature>org.eclipse.ajdt.ui.ajnature</nature>
    		<nature>com.springsource.sts.roo.core.nature</nature>
    		<nature>org.springframework.ide.eclipse.core.springnature</nature>
    		</natures>
    </projectDescription>
    but after I manually Mavenize it, I get:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
    	<name>test</name>
    	<comment></comment>
    	<projects>
    	</projects>
    	<buildSpec>
    		<buildCommand>
    			<name>org.eclipse.ajdt.core.ajbuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    		<buildCommand>
    			<name>org.springframework.ide.eclipse.core.springbuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    		<buildCommand>
    			<name>org.eclipse.m2e.core.maven2Builder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    	</buildSpec>
    	<natures>
    		<nature>org.eclipse.m2e.core.maven2Nature</nature>
    		<nature>org.eclipse.jdt.core.javanature</nature>
    		<nature>org.eclipse.ajdt.ui.ajnature</nature>
    		<nature>com.springsource.sts.roo.core.nature</nature>
    		<nature>org.springframework.ide.eclipse.core.springnature</nature>
    	</natures>
    </projectDescription>

  6. #6

    Default

    Even more peculiar, if I:

    1. create a new Spring Roo Project
    2. restart Eclipse
    3. Open a Roo Shell in Eclipse for the project

    the error goes away. It doesn't complain about aspectj, but it doesn't modify .project to be mavenized, so I have no idea what's going on to make that work. Just starting the Roo Shell after creatingthe project doesn't help, I have to exit and restart.

  7. #7
    Join Date
    Aug 2011
    Posts
    1

    Default

    I'm using vanilla eclipse (Version: Indigo Release Build id: 20110615-0604), not STS. After running the "perform eclipse" command in Roo (1.1.5.RELEASE [rev d3a68c3]), many M2_REPO...jar entries are added to the build path, but since aspectjweaver-1.6.11.jar is missing, I have to add that one manually. Is there a reason for this? I also notice that if I rerun the "perform eclipse" command, the build path is wiped out and I have to re-add the missing jar. Thanks!

  8. #8

    Default

    After doing perform eclipse and importing your project, right-click and convert to Maven. This will add the Maven stuff (through the now built-in m2e plugins) and fix the problem with AspectJ. It will produce two other errors and a warning in the pom. You can quick fix those, then use the Maven context menu to update the project configuration, and things should be functional.

  9. #9

    Default Restarting fixed it

    Quote Originally Posted by dsp View Post
    Even more peculiar, if I:

    1. create a new Spring Roo Project
    2. restart Eclipse
    3. Open a Roo Shell in Eclipse for the project

    the error goes away. It doesn't complain about aspectj, but it doesn't modify .project to be mavenized, so I have no idea what's going on to make that work. Just starting the Roo Shell after creatingthe project doesn't help, I have to exit and restart.
    I had the same exact issue. I created a new Roo project and reverse engineered a database that I had created. I got this exact aspectj error. I spent about an hour trying to fix it and then stumbled upon your post. I restarted STS and everyone builds now. Thanks for posting this...you probably saved me a couple of hours.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •