PSTADU
PSTADU

Reputation: 31

Unable to locate Spring NamespaceHandler for XML schema namespace in OSGi (Karaf) with java standalone application

While deploying the Java standalone module as bundle which has a dependency with spring modules in Felix osgi container karaf(3.0.3). The spring 3.1.4 version is installed properly and it is imported in the bundle. However, while loading appcontext.xml through classloader. classpathXMLApplicationContext from the bundle, we are getting,

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]

Any help to resolve this issue?

Other details: spring-context is deployed as a seperate bundle in the osigi container(karaf).

Question1: Is it possible to refer the spring-context.xsd from the bundle without any configuration changes?

Upvotes: 0

Views: 597

Answers (1)

PSTADU
PSTADU

Reputation: 31

I have resolved this issue by following the below steps. It might useful if you are migrating the existing spring project to OSGI karaf.

First of all use spring-dm feature provided by osgi container(karaf). Place the appContext-*.xml(all the spring configutration file under /META_INF/spring folder). spring-dm will take care of resolving the namespace handler and creating the application context for your project.

Upvotes: 0

Related Questions