Hi,

It seems a problem loading de xsd.
Maybe the header in your xml config file should looks like this (look at the
order in the xsi:schema location attribute):

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:tx="http://www.springframework.org/schema/tx";
       xmlns:osgi="http://www.springframework.org/schema/osgi";
       xsi:schemaLocation="
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/osgi
           http://www.springframework.org/schema/osgi/spring-osgi.xsd
           http://www.springframework.org/schema/tx
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
">


Hope this helps,

Agus

2010/5/6 Charles Moulliard <[email protected]>

> Hi,
>
> I have configured a bundle to use sprint tx:annotation-driven but get
> this error :
>
> 16:24:04,109 | ERROR | ExtenderThread-2 | ContextLoaderListener
>    | BundleApplicationContextListener   50 | Application context
> refresh failed
> (OsgiBundleXmlApplicationContext(bundle=com.goodyear.emea.gicl.esb.sap-prodspec-service,
> config=osgibundle:/META-INF/spring/*.xml))
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> Line 37 in XML document from URL
> [bundle://138.0:0/META-INF/spring/service-context.xml] is invalid;
> nested exception is org.xml.sax.SAXParseException:
> cvc-complex-type.2.4.c: The matching wildcard is strict, but no
> declaration can be found for element 'tx:annotation-driven'.
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
>        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:176)
>        at
> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
>        at
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
>        at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
>        at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
>        at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
>        at
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>        at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
>        at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)
>        at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
>        at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
>        at
> org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The
> matching wildcard is strict, but no declaration can be found for
> element 'tx:annotation-driven'.
>        at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
>        at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
>
> Here is the config
>
> <beans xmlns="http://www.springframework.org/schema/beans";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>        xmlns:tx="http://www.springframework.org/schema/tx";
>        xmlns:osgi="http://www.springframework.org/schema/osgi";
>        xsi:schemaLocation="
>            http://www.springframework.org/schema/beans
>
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>            http://www.springframework.org/schema/osgi
>            http://www.springframework.org/schema/tx
>            http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
>        http://www.springframework.org/schema/osgi/spring-osgi.xsd";>
>
>        <!--
>                enable the configuration of transactional behavior based on
>                annotations
>        -->
>        <tx:annotation-driven transaction-manager="txManager" />
>
>        <osgi:reference id="txManager"
> interface="org.springframework.transaction.PlatformTransactionManager"
> />
>
> The Spring TX bundle is well installed, my bundle use Dynamic-Import :
>
> [  10] [Active     ] [Created     ] [       ] [   30] Apache Felix
> Karaf :: Spring Deployer (1.4.0)
> [  34] [Active     ] [            ] [       ] [   60] Spring Core
> (2.5.6.SEC01)
> [  35] [Active     ] [            ] [       ] [   60] Spring Beans
> (2.5.6.SEC01)
> [  36] [Active     ] [            ] [       ] [   60] Spring AOP
> (2.5.6.SEC01)
> [  37] [Active     ] [            ] [       ] [   60] Spring Context
> (2.5.6.SEC01)
> [  38] [Active     ] [            ] [       ] [   60] Spring Context
> Support (2.5.6.SEC01)
> [  51] [Active     ] [            ] [       ] [   60] Spring
> Transaction (2.5.6.SEC01)
> [  72] [Active     ] [            ] [       ] [   60] Spring JMS
> (2.5.6.SEC01)
> [ 109] [Active     ] [            ] [       ] [   60] Spring JDBC
> (2.5.6.SEC01)
> [ 110] [Active     ] [            ] [       ] [   60] Spring ORM
> (2.5.6.SEC01)
>
> Does anybody knows how to solve this  ?
>
> Kind regards,
>
> Charles Moulliard
>
> Senior Enterprise Architect (J2EE, .NET, SOA)
> Apache Camel Committer
>
> *******************************************************************
> - Blog : http://cmoulliard.blogspot.com
> - Twitter : http://twitter.com/cmoulliard
> - Linkedlin : http://www.linkedin.com/in/charlesmoulliard
>

Reply via email to