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'
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!
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.
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 <cbeams@vmware.com>
Commit: Chris Beams <cbeams@vmware.com>
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.
[1]: http://wiki.osgi.org/wiki/Split_Packages
Issue: SPR-9811, SPR-9441
Backport-Commit: 54db7387de861273a1faa4ed2f3c30052999ddea
Samuel Henault opened SPR-9811 and commented
Cannot start Spring on Eclipse Virgo Tomcat Server 3.5. The following error appear :
http://forum.springsource.org/showthread.php?128203-Spring-Framework-3-1-2-Released!&p=422143#post422143
Affects: 3.1.2
Reference URL: http://forum.springsource.org/showthread.php?128203-Spring-Framework-3-1-2-Released!&p=422143#post422143
Issue Links:
@EnableSpringConfigured
The text was updated successfully, but these errors were encountered: