activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Neumeier (JIRA)" <>
Subject [jira] Commented: (AMQ-2010) META-INF/services files ended up in wrong bundle (jar), missing imports
Date Mon, 09 Feb 2009 17:54:59 GMT


Kyle Neumeier commented on AMQ-2010:

I am having the same problem.  I have been able to work around this problem by adding an EclipseBuddyPolicy:global
statement to the manifest of the bundle that has the spring xml file for configuring activemq.

> META-INF/services files ended up in wrong bundle (jar), missing imports
> -----------------------------------------------------------------------
>                 Key: AMQ-2010
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.1.0
>         Environment: Springsource DM 1.0.0.RC2, java jdk (sun) 1.6_07, Linux 32bit
>            Reporter: Hrvoje Habjanic
>            Priority: Trivial
> Hi!
> I'm unable to use namespaces in spring xml files. It just cannot resolve namespace
> ...
> [2008-11-21 15:06:59.627] server-dm-7              rk.beans.factory.xml.DefaultBeanDefinitionDocumentReader.unknown
D Loading bean definitions
> [2008-11-21 15:06:59.628] server-dm-7    
D Trying to resolving namespace handler for
> [2008-11-21 15:06:59.630] server-dm-7              .app.spring.GenericModuleOsgiBundleXmlApplicationContext.unknown
E Pre refresh error
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration
problem: Unable to locate Spring NamespaceHandler for XML schema namespace []
> Offending resource: URL [bundleentry://89/META-INF/spring/bundle-context-amq.xml]
>         at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(
>         at org.springframework.beans.factory.parsing.ReaderContext.error(
>         at org.springframework.beans.factory.parsing.ReaderContext.error(
>         at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(
> ...
> To make long story short, it seems that in the process of building jar, someone forgot
to move META-INF/services files in separate bundles.
> In OSGI enviroment, classpath loader of one bundle can only see files in jars (bundles)
which he has import directive, including local root. In current build of activemq, META-INF/services
files are all stored in META-INF/services dir under activemq-core bundle.On the other hand,
namespace parser is in xbean.spring bundle (referenced by META-INF/spring.handlers). Because
parser is in separate bundle, it can not "see" META-INF/services directory, and it dies. Also,
import for org.apache.xbean.spring.context.v2 is missing from activemq-core. Additionally,
for bundle loader to scan for spring.schema file, bundle _must_ import org.springframework.beans.factory.xml,
which is also missing from manifest file. I'm not 100% shure in this, maybe all files from
META-INF/services should be moved from activemq-core to xbaen.spring ...
> Anyhow, fix to make it work is to:
> - move META-INF/services in propriate bundles
> - add following import to activemq-core:
>  org.springframework.beans.factory.xml;resolution:=optional,
>  org.apache.xbean.spring.context.v2;resolution:=optional
> That's it for now. :-)
> H.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message