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
Fix for overriding abstract beans - 3.0.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fix for overriding abstract beans - 3.0.1

    Heya,

    I have a simple abstract app config class, with a concrete subclass that overrides an abstract bean definition. This was done following an example someone had written up, but probably dates back to when JavaConfig was a separate project.

    Using Spring 3.0.0.RELEASE, when I do this I get an error: config has 2 overloaded factory methods of name...

    I found that this was documented as a bug, and fixed in release 3.0.1 of spring. According to the spring download page, 3.0.1 is the latest production release. If that is the case, why is it not in maven central repository? Only 3.0.0.RELEASE exists there.

    I can avoid this problem by using composition instead of inheritance (@import), but figured I'd ask what the deal is. If 3.01. is very recent maybe it's just not been put on the central repo yet.

  • #2
    It can take a while for artifacts to show up in the central repo, as Spring 3.0.1 was released shortly ago. You can add the spring maven repo that way you can always have fast access to new releases, instead of waiting for it to show up in the central repo.

    Comment


    • #3
      Hi Marten

      Thanks for the response!

      When you say "spring maven repo", what is the URL? I've tried EBR, which is referenced here:
      http://blog.springsource.com/2009/12...ts-with-maven/

      and also you milestone repos, which is referenced here:
      http://blog.springsource.com/2007/09...n-artifacts-2/

      And in both cases I still get the error:
      Missing:
      ----------
      1) org.springframework:spring-context:jar:3.0.1.RELEASE

      Here is my POM dependency:

      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>3.0.1.RELEASE</version>
      </dependency>

      I notice that in my web browser when I hit maven central repo this morning, 3.0.1.RELEASE is present:
      http://repo2.maven.org/maven2/org/sp...3.0.1.RELEASE/

      But yet neither from maven commandline nor from indexer in eclipse can I seem to access it.

      Comment


      • #4
        here's the two repos entries I tried

        <repository>
        <id>spring-milestone</id>
        <name>Spring Portfolio Milestone Repository</name>
        <url>http://s3.amazonaws.com/maven.springframework.org/milestone</url>
        </repository>
        <repository>
        <id>com.springsource.repository.bundles.external </id>
        <name>EBR External Release Repository</name>
        <url>http:// repository.springsource.com/maven/bundles/external</url>
        </repository>

        thanks,

        jim

        Comment


        • #5
          OK, got it

          Actually repo1 worked.

          I think my issue is that we are using nexus at my company, and it is not reflecting the most recent additions to repo1. If I add repo1 or 2 directly to my pom and don't proxy through nexus, was able to download.

          sorry!

          Comment


          • #6
            You use neither, as the names imho clearly state.

            snapshot - nightly builds/snapshots
            milestone - milestone and candidate releases
            release - release builds
            external - external dependencies

            Next to that if you use the EBR instead of the maven repo you get OSGi bundles and the naming convention is different, so trying to use the default maven naming for EBR isn't going to work (which is also explained in the blog you read).

            Comment


            • #7
              I'm good to go now

              Thanks. Have the release and it fixes the bug.

              However, this page:
              http://blog.springsource.com/2007/09...n-artifacts-2/

              states that your "release repository" is:
              "For any final release (Spring 2.5, Spring Web Flow 2.0, etc.) the Maven artifacts for that release will be uploaded to the Maven Central repository (http://repo1.maven.org/maven2). Using this repository requires no effort on your part as Maven will automatically look for artifacts there."

              This is in fact precisely the place where 3.0.1.R was not present when I originally posted ;-). The day after my post it was uploaded there, thanks. If you were referring to a different repository where your release versions can be obtained before someone gets around to putting them on maven central, I don't see that URL described anywhere on that page.

              Comment


              • #8
                The blog you refer to is the old one this is the correct one, things change in 2 years .

                The central maven repo lags behind in comparision to the spring release repo, because first it is published to the spring release repo and later this syncs with the central maven repo. So it can take 24/48 hours to catch up. if next to that you use an internal repo which syncs with the central one it can take 24/48 hours extra to be available.

                Comment

                Working...
                X