Results 1 to 9 of 9

Thread: "Aspect and introduction must be in identical packages"

  1. #1
    Join Date
    Jul 2008
    Location
    Maasmechelen (Belgium)
    Posts
    157

    Question "Aspect and introduction must be in identical packages"

    From time to time I get an "Aspect and introduction must be in identical packages" that leads to Roo stop functioning.

    I work around by just recreating the project. But maybe there's another wat I could accomplish (or prevent?) this?

    At a first look I never see my source files and .aj files being in wrong packages or anything, but I'm not 100% sure.

    Thanks in advance!

  2. #2
    Join Date
    May 2011
    Posts
    3

    Default

    I am also getting this error. Did you ever figure out a way to resolve it? I am using version 1.1.4.

    Thanks

  3. #3
    Join Date
    Aug 2010
    Location
    Brazil
    Posts
    9

    Default

    I am also getting this error... Any help?

    Thanks

  4. #4
    Join Date
    Aug 2010
    Location
    Brazil
    Posts
    9

    Default

    Found the code that generates this error at http://static.springsource.org/sprin...eComposer.html


    Code:
    private void appendTypeDeclaration() {
    111 		Assert.isTrue(introductionTo.getPackage().equals(aspect.getPackage()), "Aspect and introduction must be in identical packages");
    112 		
    113 		this.appendIndent();
    114 		if (itdTypeDetails.isPrivilegedAspect()) {
    115 			this.append("privileged ");
    116 		}
    117 		this.append("aspect " + aspect.getSimpleTypeName() + " {");
    118 		this.newLine(false);
    119 		this.indent();
    120 		this.newLine();
    121 
    122 		// Set to false, as it was set true during the above operations
    123 		content = false;
    124 	}

  5. #5
    Join Date
    Aug 2010
    Location
    Brazil
    Posts
    9

    Default

    I found a strange behavior that was causing this problem here. Assuming you created your project with --toplevelpackage com.foo and your project name bar, you will have yout root package com.foo.bar. Your project should have a folder strucuture like src/test/java/com/foo/bar where roo creates the IntegrationTests classes. I have created a test class in default (root) package on the test folder structure (src/test/java). After this, roo presents the error message above. When I deleted the test class in the root package on test folder, roo stoped presenting the error message. Why? I don't know...

  6. #6

    Default

    Hello I am rickywillson from USA and it is my first post in this forum. I feel very glad to come in this site. I am here to collect some information about this forum.

  7. #7
    Join Date
    Nov 2009
    Posts
    7

    Default

    Thanks camiloporto, very helpful reply. I had done exactly the same, a test class in root package of test folder and the same problem. After removing the test class everything work like a charm.

    Quote Originally Posted by camiloporto View Post
    I found a strange behavior that was causing this problem here. Assuming you created your project with --toplevelpackage com.foo and your project name bar, you will have yout root package com.foo.bar. Your project should have a folder strucuture like src/test/java/com/foo/bar where roo creates the IntegrationTests classes. I have created a test class in default (root) package on the test folder structure (src/test/java). After this, roo presents the error message above. When I deleted the test class in the root package on test folder, roo stoped presenting the error message. Why? I don't know...

  8. #8
    Join Date
    Dec 2005
    Posts
    929

    Default

    This is a curious bug. I raised https://jira.springsource.org/browse/ROO-2972 and resolved it with an NPE check, as I created a class (called FooTest) in src/test/java in our generated petclinic sample.

    I then proceeded to annotate it with @RooIntegrationTest and created a domain class called Foo so that the new class references it in the annotation and also created a FooDataOnDemand class with the @RooDataOnDemand annotation in the same annotation, but no ITDs were produced,. I had to move these classes under the top level package for the ITDs to trigger.

    More investigation is required
    Alan
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  9. #9
    Join Date
    Jun 2007
    Location
    Vienna, Austria
    Posts
    68

    Default

    I just experienced the same problem with ROO 1.2.2 and I have no class in the default (root) package of the test folder.

    It would be good if Roo would be more specific in the error message 'Aspect and introduction must be in identical packages' and would also write which packages are responsible for the error.

    Thanks for considering this.
    Martin

Posting Permissions

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