Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Unable to locate Spring NamespaceHandler Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • rodolfobarbeiro
    started a topic Unable to locate Spring NamespaceHandler

    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?

  • ak13
    replied
    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

    Leave a comment:


  • back2grave
    replied
    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 ?

    Leave a comment:


  • ak13
    replied
    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
    ****************************************
    ************************************************** ************

    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"*".

    Leave a comment:


  • back2grave
    replied
    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"*".

    Leave a comment:


  • ak13
    replied
    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.

    Leave a comment:


  • back2grave
    replied
    Never mind, found the issue and resolved it...

    Leave a comment:


  • back2grave
    replied
    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 ?

    Leave a comment:


  • rodolfobarbeiro
    replied
    [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.

    Leave a comment:


  • polosatiy
    replied
    What version of Spring are you using?

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

    Leave a comment:

Working...
X