Results 1 to 10 of 10

Thread: Unable to locate Spring NamespaceHandler

  1. #1

    Unhappy Unable to locate Spring NamespaceHandler

    Hi,

    The following error occurs when starting my bundle:


    Code:
    10-06-2011 15:46:02,211 [SpringOsgiExtenderThread-1] ERROR Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=mybundle-engine, config=osgibundle:/META-INF/spring/*.xml))
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/osgi]
    Offending resource: URL [bundle://125.0:0/META-INF/spring/bundle-context-osgi.xml]
    
    	at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1332)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:172)
    	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:62)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:244)
    	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:87)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:222)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:225)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:178)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:159)
    	at org.springframework.osgi.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:223)
    	at java.lang.Thread.run(Unknown Source)
    10-06-2011 15:46:02,212 [SpringOsgiExtenderThread-1] ERROR Unable to create application context for [mybundle-engine], unsatisfied dependencies: none
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/osgi]
    Offending resource: URL [bundle://125.0:0/META-INF/spring/bundle-context-osgi.xml]
    
    	at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1332)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:172)
    	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:62)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:244)
    	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:87)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:222)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:225)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:178)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:159)
    	at org.springframework.osgi.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:223)
    	at java.lang.Thread.run(Unknown Source)
    My bundle-context-osgi.xml:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns="http://www.springframework.org/schema/osgi"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans 
    						http://www.springframework.org/schema/beans/spring-beans.xsd
    						http://www.springframework.org/schema/osgi 
    						http://www.springframework.org/schema/osgi/spring-osgi.xsd
    						http://www.springframework.org/schema/context
          					http://www.springframework.org/schema/context/spring-context.xsd">
    
    
    	<service ref="configurationManager" context-class-loader="service-provider" auto-export="all-classes" 
    		interface="org.home.mybundle.interfaces.services.ConfigurationManager">
    		<service-properties>
            	<beans:entry key="plugin.id" value="myBundle" />
            </service-properties>
    	</service>
    
    	<service ref="Service"
    		interface="org.home.mybundle.interfaces.services.Service" />
        
    </beans:beans>
    Any idea how to solve this?

  2. #2
    Join Date
    Sep 2006
    Location
    Russia
    Posts
    28

    Default

    What version of Spring are you using?

    Show the list of bundles, which are deployed in your app.

  3. #3

    Thumbs up [Resolved] Unable to locate Spring NamespaceHandler

    I know what was wrong.

    My bundle contains embedded dependencies and was conflicting with the bundles deployed in the OSGi environment.

    I removed the dependencies that caused the conflict and problem was solved.

  4. #4
    Join Date
    Feb 2008
    Posts
    27

    Default

    Quote Originally Posted by rodolfobarbeiro View Post
    I know what was wrong.

    My bundle contains embedded dependencies and was conflicting with the bundles deployed in the OSGi environment.

    I removed the dependencies that caused the conflict and problem was solved.
    I'm facing the same exception, can you tell me what all dependencies caused the conflict for you ?

  5. #5
    Join Date
    Feb 2008
    Posts
    27

    Default

    Never mind, found the issue and resolved it...

  6. #6
    Join Date
    Jun 2011
    Posts
    6

    Default

    Quote Originally Posted by rodolfobarbeiro View Post
    I know what was wrong.

    My bundle contains embedded dependencies and was conflicting with the bundles deployed in the OSGi environment.

    I removed the dependencies that caused the conflict and problem was solved.
    ***********
    I am also facing the same problem *****
    How you removed the dependencies that cuasued the confict.

  7. #7
    Join Date
    Feb 2008
    Posts
    27

    Default

    Quote Originally Posted by ak13 View Post
    ***********
    I am also facing the same problem *****
    How you removed the dependencies that cuasued the confict.
    ak13, you'll see this exception if your bundle contains any spring implementation with a different version than your osgi container.

    In my case, I removed them in the maven embed-dependency. Here's a sample :
    Code:
    <Embed-Dependency>*;scope=compile|runtime;artifactId=!spring-core|spring-jdbc|spring-aop|spring-asm|spring-beans|spring-context|spring-context-support|spring-expression|spring-tx|aopalliance|com.springsource.org.aopalliance|commons-collections|commons-logging|org.apache.felix.framework|icu4j|xercesImpl</Embed-Dependency>
    Other way it to include only required jars by replacing"*".

  8. #8
    Join Date
    Jun 2011
    Posts
    6

    Default

    Thanks for the quick response .
    **********************************
    How to find out which version is missing ,
    I am just try out generated code after new ->spring template -> shared service bundle project
    I am not adding anything.only the jars from server lib
    It their any way to fix this with spring tool suite
    ****************************************
    ************************************************** ************

    Quote Originally Posted by back2grave View Post
    ak13, you'll see this exception if your bundle contains any spring implementation with a different version than your osgi container.

    In my case, I removed them in the maven embed-dependency. Here's a sample :
    Code:
    <Embed-Dependency>*;scope=compile|runtime;artifactId=!spring-core|spring-jdbc|spring-aop|spring-asm|spring-beans|spring-context|spring-context-support|spring-expression|spring-tx|aopalliance|com.springsource.org.aopalliance|commons-collections|commons-logging|org.apache.felix.framework|icu4j|xercesImpl</Embed-Dependency>
    Other way it to include only required jars by replacing"*".

  9. #9
    Join Date
    Feb 2008
    Posts
    27

    Default

    As far my understanding, there's no easy way to deal with these issues. I'm using servicemix for couple of weeks and this is one of those pain points you've to face. Which OSGI container are you using ? What version of spring is installed in the container?

    Also, can you share your pom file ?

  10. #10
    Join Date
    Jun 2011
    Posts
    6

    Default

    I am using Spring server DM 2.0.5 Release , it uses equinox as osgi container
    reference : refer section 2.2 .http://static.springsource.org/s2-dm...mer-guide.html
    I am using spring tool suite. so POM is genereted by tool ony while creating project.
    I am creating New->spring template -->shared service bundle project

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •