Announcement Announcement Module
Collapse
No announcement yet.
Spring Extensible XML with Apache CXF Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Extensible XML with Apache CXF

    Hello,

    I'm working with CXF to expose service via webservice. CXF extends spring XML.
    I made a Bundle where I have included CXF libraries in the META-INFlib directory.
    But when I use the CXF XML bean definition and deploy on S2AP, I get an error :

    org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws]

    It seems that Spring Framework doesn't integrate the CXF libraries that I includ in the Bundle.
    I did the test with a simple WAR and it works properly.

    Thank you for your help.

  • #2
    Spring Extensible XML with Apache CXF

    It's hard to tell from your description what you are trying to do exactly. You are trying to create an ApplicationContext inside a bundle (not letting SPring DM do it for you)? Maybe if you show the rest of the stack trace it would be easier to see?

    Comment


    • #3
      Spring Extensible XML with Apache CXF

      Right.

      For example, I build a simple bundle where I use the code found in the demo on http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html.

      Then when I deploy it I get this trace :


      org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws]
      Offending resource: URL [bundleentry://69/META-INF/spring/beans.xml]

      at org.springframework.beans.factory.parsing.FailFast ProblemReporter.error(FailFastProblemReporter.java :68)
      at org.springframework.beans.factory.parsing.ReaderCo ntext.error(ReaderContext.java:85)
      at org.springframework.beans.factory.parsing.ReaderCo ntext.error(ReaderContext.java:80)
      at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.error(BeanDefinitionParserDelegat e.java:281)
      at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1252)
      at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1245)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:135)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:92)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:507)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:398)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:342)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:310)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149)
      at org.springframework.osgi.context.support.OsgiBundl eXmlApplicationContext.loadBeanDefinitions(OsgiBun dleXmlApplicationContext.java:166)
      at org.springframework.osgi.context.support.OsgiBundl eXmlApplicationContext.loadBeanDefinitions(OsgiBun dleXmlApplicationContext.java:132)
      at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:123)
      at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:423)
      at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.startRefresh(A bstractDelegatedExecutionApplicationContext.java:2 11)
      at org.springframework.osgi.extender.internal.depende ncies.startup.DependencyWaiterApplicationContextEx ecutor.stageOne(DependencyWaiterApplicationContext Executor.java:221)
      at org.springframework.osgi.extender.internal.depende ncies.startup.DependencyWaiterApplicationContextEx ecutor.refresh(DependencyWaiterApplicationContextE xecutor.java:172)
      at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.refresh(Abstra ctDelegatedExecutionApplicationContext.java:136)
      at org.springframework.osgi.extender.internal.activat or.ContextLoaderListener$2.run(ContextLoaderListen er.java:746)
      at com.springsource.platform.kernel.dm.ContextPropaga tingTaskExecutor$2.run(ContextPropagatingTaskExecu tor.java:82)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:619)



      The beans.xml files is where I use the CXF XML extension.

      Thanks.

      Comment


      • #4
        Spring Extensible XML with Apache CXF

        In your bundle did you import the package where the CXF schema and NamespaceHandler is exported? If this is ever going to work it should be adequate to import the bundle which contains those things. If that doesn't work, maybe we need to look at that bundle and see if it has problems itself.

        Comment


        • #5
          Spring Extensible XML with Apache CXF

          The fact is that I tried to deploy the CXF bundle directly in the pickup directory and get an error :

          ***
          com.springsource.platform.osgi.manifest.parse.Fata lParseException: The manifest identified by Name 'Apache CXF Bundle Jar', Symbolic Name 'org.apache.cxf.cxf-bundle', and Version '2.1.2' has the following errors [Unrecoverable NoViableAltException on Import-Package at postion [4], no additional information avaliable. Error may have occurred near 'META-INF.cxf,antlr;resol'.,Unrecoverable NoViableAltException on Export-Package at postion [23767], no additional information avaliable. Error may have occurred near 'version="2.1.2",META-INF.cxf,org.apache.'.]
          ***

          So I put the CXF bundle in the META-INFlib directory of my bundle.

          Comment


          • #6
            Spring Extensible XML with Apache CXF

            So you added the CXF jar to your Bundle-Classpath?

            Comment


            • #7
              Spring Extensible XML with Apache CXF

              Yes yes I do !!

              I put CXF jar and its dependancies in the Bundle-Classpath.

              Comment


              • #8
                Spring Extensible XML with Apache CXF

                OK. I'm stumped. I suspect the problem is with Spring DM. You might want to raise an issue in JIRA (http://jira.springframework.org/browse/OSGI).

                Comment

                Working...
                X