Announcement Announcement Module
Collapse
No announcement yet.
"Aspect and introduction must be in identical packages" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "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
    I am also getting this error. Did you ever figure out a way to resolve it? I am using version 1.1.4.

    Thanks

    Comment


    • #3
      I am also getting this error... Any help?

      Thanks

      Comment


      • #4
        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 	}

        Comment


        • #5
          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...

          Comment


          • #6
            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.

            Comment


            • #7
              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.

              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...

              Comment


              • #8
                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

                Comment


                • #9
                  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

                  Comment

                  Working...
                  X