Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix split package introduced by @EnableSpringConfigured [SPR-9811] #14444

spring-projects-issues opened this issue Sep 19, 2012 · 3 comments
in: core type: bug


Copy link

@spring-projects-issues spring-projects-issues commented Sep 19, 2012

Samuel Henault opened SPR-9811 and commented

Cannot start Spring on Eclipse Virgo Tomcat Server 3.5. The following error appear :

Caused by: org.eclipse.virgo.kernel.osgi.framework.ImportMergeException?: cannot merge imports of package 'org.springframework.context.annotation' from sources 'Import-Library 'org.springframework.spring' version '3.1.2.RELEASE'(Import-Bundle 'org.springframework.aspects' version '3.1.2.RELEASE', Import-Bundle 'org.springframework.context' version '3.1.2.RELEASE')' because of conflicting values 'org.springframework.context', 'org.springframework.aspects' of attribute 'bundle-symbolic-name'!&p=422143#post422143

Affects: 3.1.2

Reference URL:!&p=422143#post422143

Issue Links:

  • #14077 Fix package cycle established by @EnableSpringConfigured
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 24, 2012

Chris Beams commented

Glyn Normington, I'd be happy to get a fix for this issue into the forthcoming 3.1.3 (due just days from now). Can you take a look and assess what the fix might be? Thanks!

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 26, 2012

Glyn Normington commented

The problem is that the package org.springframework.context.annotation has been split, in Spring framework 3.1.2, across the org.springframework.aspects and org.springframework.context bundles. Split packages ([1]) are an anti-pattern for OSGi which loads each bundle in a separate class loader. The solution is either to move the relevant portion of the package from org.springframework.aspects to org.springframework.context or, possibly more viably, to adopt the pattern (used everywhere else in the org.springframework.aspects bundle) of adding aspectj to the end of the package name.


Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 26, 2012

Chris Beams commented

Thanks for your help, Glyn. This is now fixed for 3.1.3 and 3.2 RC1. /cc Juergen Hoeller

commit 2cfd15899d94be7f201c634e877abec6db6bfbfb
Author: Chris Beams <>
Commit: Chris Beams <>

    Fix split package introduced by @EnableSpringConfigured
    Commit 6263c9abf950692c15b5bc5edd854b3949b10b19
    @EnableSpringConfigured from beans.factory.aspectj =>
    context.annotation within the spring-aspects module. This resolved a
    package cycle but had the side-effect of causing a "split package" [1]
    problem between spring-context and spring-aspects in OSGi-based
    classloader environments because the context.annotation package now
    exists in both modules.
    The simplest and best solution from an OSGi perspective is to relocate
    @EnableSpringConfigured and its supporting SpringConfiguredConfiguration
    class into a new package. This commit moves both these types into
    context.annotation.aspectj, following convention with other such
    "aspectj"-qualified packages in the spring-aspects module.
    As with the previous move, it is presumed this change will be low-impact
    as the "spring-configured" approach to domain object injection is a
    niche feature to begin with, and @EnableSpringConfigured has existed in
    its current location only since 3.1.2 and this change is being made in
    time for 3.1.3.
    Issue: SPR-9811, SPR-9441
    Backport-Commit: 54db7387de861273a1faa4ed2f3c30052999ddea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: core type: bug
None yet

No branches or pull requests

1 participant