Announcement Announcement Module
Collapse

JavaConfig forum decommissioned in favor of Core Container

As described at

http://static.springsource.org/sprin...fig/README.TXT

key features of the Spring JavaConfig project have been migrated into the core Spring Framework as of version 3.0.

Please see the Spring 3.0 documentation on @Configuration and @Bean support:

http://static.springsource.org/sprin...tml#beans-java

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at

http://forum.springsource.org/forumdisplay.php?f=26
See more
See less
Spring 3.0 and Spring JavaConfig compatability Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 3.0 and Spring JavaConfig compatability

    Hi

    I am really unsure on the compatability status here?
    From simply downloading the 1.0.0M4 JavaConfig release and Spring 3.0.1 release I have encountered numerous errors. Current one is below.

    Given these problems and simple things like the 1.0.0M5 link goes to a blank page I am not really happy to proceed with adoption now of JavaConfig and will stick with xml based which is a shame.

    Can you let me know when there is likely to be a final release of Spring JavaConfig which works out of the box with Spring 3.0.x releases, without ambiguity to where annotations live and without problems in getting the very simplest of examples working?

    Thanks

    Liam


    Exception in thread "main" java.lang.annotation.AnnotationFormatError: Invalid default: public abstract org.springframework.beans.factory.annotation.Autow ire org.springframework.config.java.annotation.Configu ration.defaultAutowire()
    at java.lang.reflect.Method.getDefaultValue(Method.ja va:726)
    at sun.reflect.annotation.AnnotationType.<init>(Annot ationType.java:99)
    at sun.reflect.annotation.AnnotationType.getInstance( AnnotationType.java:66)
    at sun.reflect.annotation.AnnotationParser.parseAnnot ation(AnnotationParser.java:202)
    at sun.reflect.annotation.AnnotationParser.parseAnnot ations2(AnnotationParser.java:69)
    at sun.reflect.annotation.AnnotationParser.parseAnnot ations(AnnotationParser.java:52)
    at java.lang.Class.initAnnotationsIfNecessary(Class.j ava:3070)
    at java.lang.Class.getAnnotation(Class.java:3029)
    at org.springframework.config.java.internal.util.Anno tationExtractionUtils.extractClassAnnotation(Annot ationExtractionUtils.java:41)
    at org.springframework.config.java.internal.model.Con figurationClass.<clinit>(ConfigurationClass.java:6 5)
    at org.springframework.config.java.internal.parsing.a sm.AsmConfigurationParser.parse(AsmConfigurationPa rser.java:72)
    at org.springframework.config.java.internal.factory.s upport.AsmJavaConfigBeanDefinitionReader.loadBeanD efinitions(AsmJavaConfigBeanDefinitionReader.java: 70)

  • #2
    The main part of javaconfig is part of the spring framework, so for the 80% cases you should be fine with the implementation provided default with spring.

    Comment


    • #3
      Thanks,

      But it has only been in scratching around replacing JavaConfigApplicationContext with the Annotated version, annotations etc, that I have managed to get even the simplest application working.

      I really think you need to document this better.

      a) What is included in the main Spring distribution?
      b) What is extra in JavaConfig?
      c) Where the crossover and compatability/incompatabilities lie?

      80% is a bit arbritary, what exactly would I be missing in ignoring JavaConfig entirely ?

      Having used Spring for a long, long time I am quite shocked how this hasn't been made obvious as in general the reference documentation for the main distributions is excellent.


      Regards

      Liam

      Comment


      • #4
        Hi Liam,

        The JavaConfig project will be formally shut down in the near future. Please keep in mind that JavaConfig was never brought to a GA release, and this was actually intentional. Porting the project into Spring Core represents the ability to have many many more users evaluate the approach and provide feedback. We have moved what is proven into the core, and some of the other more experimental features may make it in over time. This includes annotation support that mirrors the Spring XML namespaces, for example @ComponentScan.

        From this point forward, assuming you're using Spring 3.0 GA or better, JavaConfig should be considered deprecated and generally incompatible with core.

        If you have particular feature requests for @Configuration support within Spring 3.0, please do not hesitate to add issues in JIRA. Thanks for your feedback!

        Comment


        • #5
          Thanks Chris,

          I am pleased that this is the case as moving JavaConfig into the core where the other configuration API's live makes complete sense. The only thing I would suggest is please add some very clear notifcation on the JavaConfig home page just to prevent developers trying to combine in error.

          One other thing I was curious about was JUnit test support for. Is there are equivalent to the @ContextConfiguration annotation that takes Classes for the context resource location ?

          Regards

          Liam

          Comment


          • #6
            With regard to first-class support for @Configuration classes within the TestContext framework (including @ContextConfiguration), please put a watch on http://jira.springframework.org/browse/SPR-6184, which is scheduled for the upcoming Spring 3.1 release.

            Comment

            Working...
            X