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'
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 () 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.
Thanks for your help, Glyn. This is now fixed for 3.1.3 and 3.2 RC1. /cc Juergen Hoeller
Author: Chris Beams <firstname.lastname@example.org>
Commit: Chris Beams <email@example.com>
Fix split package introduced by @EnableSpringConfigured
@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" 
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