2 Replies Latest reply on Jul 24, 2012 8:14 PM by Freeman(Yue) Fang

    Client for Soap Web Service in servicemix shows Configuration problem

    shachi shachi Newbie

      Hi All,

       

      I am trying to invoke my soap webservice at http://localhost:8181/cxf/OrderProcess in service mix through spring-mvc controller

      using below code

       

      ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( new String[] { "com/cause/osgi/examples/spring_mvc_ex1/client-beans.xml" }); OrderProcess client = (OrderProcess) context.getBean("orderClient"); // Populate the Order bean Order order = new Order(); order.setCustomerID("C001"); order.setItemID("I001"); order.setQty(100); order.setPrice(200.00); String orderID = client.processOrder(order); String message = (orderID == null) ? "Order not approved" : "Order approved;order ID is " + orderID; System.out.println(message); System.exit(0);

       

      It is giving error shown below....

       

      HTTP ERROR 500

      Problem accessing /spring-mvc-ex1/authenticate.html. Reason:

       

          Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace http://cxf.apache.org/jaxws

      Offending resource: class path resource

       

       

      Caused by:

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

      Offending resource: class path resource

       

           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:1335)

           at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)

           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.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)

           at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)

           at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)

           at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)

           at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)

           at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)

           at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)

           at com.cause.osgi.examples.spring_mvc_ex1.LoginController.authenticateString(LoginController.java:202)

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           at java.lang.reflect.Method.invoke(Method.java:597)

           at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)

           at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)

           at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)

           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)

           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669)

           at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:585)

           at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)

           at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

           at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538)

           at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)

           at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)

           at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)

           at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:480)

           at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)

           at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:937)

           at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:116)

           at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)

           at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)

           at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:871)

           at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)

           at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:72)

           at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)

           at org.eclipse.jetty.server.Server.handle(Server.java:346)

           at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)

           at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1065)

           at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:823)

           at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)

           at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)

           at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)

           at java.lang.Thread.run(Thread.java:662)

       

       

       

      I have my client-beans.xml under src/main/resources --> META-INF/spring folder..

      content of client-beans.xml is

       

      <?xml version="1.0" encoding="UTF-8"?>

      <beans xmlns="http://www.springframework.org/schema/beans"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xmlns:jaxws="http://cxf.apache.org/jaxws"

      xmlns:osgi="http://www.springframework.org/schema/osgi"

      xsi:schemaLocation="http://www.springframework.org/schema/beans

                         http://www.springframework.org/schema/beans/spring-beans.xsd

                         http://cxf.apache.org/jaxws

                         http://cxf.apache.org/schemas/jaxws.xsd

                         http://www.springframework.org/schema/osgi/spring-osgi.xsd ">

                

      <jaxws:client id="orderClient" serviceClass="com.shachi.SoapWebService.SoapWebService.OrderProcess"

       

                      address="http://localhost:8181/cxf/OrderProcess"/>

                       

      </beans>

              

       

       

      I have checked my soap webservice published successfully at http://localhost:8181/cxf/OrderProcess and wsdl file is generated..when i run the client code in standalone app i am able to invoke the webservice..but no luck with spring mvc integration in service mix ...

      appreciate any kind of help

       

      Thanks,

      Shachi

       

      Edited by: shachi on Jul 24, 2012 1:42 PM

       

      Edited by: shachi on Jul 24, 2012 1:51 PM

       

      Edited by: shachi on Jul 24, 2012 1:52 PM

       

      Edited by: shachi on Jul 24, 2012 1:55 PM

       

      Edited by: shachi on Jul 24, 2012 1:56 PM