Announcement Announcement Module
Collapse
No announcement yet.
Getting a Inferred type for Parameter is not within bounds Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting a Inferred type for Parameter is not within bounds

    I am following the document http://static.springsource.org/sprin...eference/html/ (all version numbers as prescribed on the document)

    I create my own Entity and wrote a simple test,

    Code:
    DirectGraphRepositoryFactory graphRepositoryFactory;
    graphRepositoryFactory.createGraphRepository(Event.class);
    I get a compile time error in the second line saying "Inferred type of parameter is not within bounds". That is because it expects a class of type "GraphBacked" I however notice that Entities in that example do not have any super classes they are just POJOs.

    Am I missing something?

  • #2
    AJ loggin

    I get the following when I build my project in IntelliJ

    abort ABORT -- (BCException) Unable to continue, this version of AspectJ supports classes built with weaver version 6.0 but the class org.springframework.data.graph.core.NodeBacked is version 7.0
    when batch building BuildConfig[null] #Files=1

    Unable to continue, this version of AspectJ supports classes built with weaver version 6.0 but the class org.springframework.data.graph.core.NodeBacked is version 7.0
    when batch building BuildConfig[null] #Files=1

    org.aspectj.weaver.BCException: Unable to continue, this version of AspectJ supports classes built with weaver version 6.0 but the class org.springframework.data.graph.core.NodeBacked is version 7.0
    when batch building BuildConfig[null] #Files=1

    Comment


    • #3
      Ok, I figured that the aspectj-maven-plugin actually injects implements at runtime. I am sure there is a reason for it. I have now got this to work

      I have other questions, all existing IDEs seem to be complaining at the syntax (and refuses to run) however only mvn install from command line works (obviously because the plugin is configured properly). Any ideas to get it work in IntelliJ?

      Comment


      • #4
        Hi,

        yes that is handled by the aspect, the annotation @NodeEntity tells the aspect to inject the NodeBacked interface along with several other members (variables, methods).

        This is described in the docs, do you feel we should point that out more often/refer to that more clearly?

        Which version of idea are you running?
        Version 10.5 takes the AspectJ compiler from the maven configuration and sets it up correctly. So it can at least compile and run the project w/o problems. The JetBrains guys work on better AspectJ support for IDEA 11, I'm in close contact with them and watch their progress.

        Eclipse and STS (2.7.0) should work nicely with the latest AspectJ plugin, that's also stated in the docs. You can get it from here for the plugin-install.
        http://download.eclipse.org/tools/ajdt/36/dev/update

        Can you please follow this version of the docs.
        http://bit.ly/sdg-html or http://bit.ly/sdg-book

        Obviously the "current" link was not updated with the latest milestone release.

        " get a compile time error in the second line saying "Inferred type of parameter is not within bounds"."
        Is this an error in the IDE-editor or during the compile process, or the maven build?

        The last two should work the IDE-editors of previous versions of the Eclipse-AJDT plugin and unfortunately IDEA (which I'm also using) are reporting some errors.

        Cheers

        Michael

        Comment


        • #5
          Hi Michael,
          Much appreciated. I did dig a little bit and got a very simple program working. The problem was that I was using the wrong version of AspectJ plus my IntelliJ was dumping my errors into an aj* file. For someone who is not used to using Aspects for adding interfaces it took me a while (Most people like me would be used to using aspects for method advices). And yes I cant see anywhere on the guide where this is explained (could be me bad)

          Thanks for your update. I am using Intellij 10.0 (and can update to 10.5) so I will give that a go.

          Also can I ask why Spring Data follows the pattern of injecting methods like persist(), relateTo() to a domain object? I am sure there is a reason as to why this does not look the JPA, but it would be great to explain that as well.

          And well done on the good work ! (am sure I am going to be pouring more question in the next week or so)

          Comment

          Working...
          X