Announcement Announcement Module
Collapse
No announcement yet.
Cannot locate BeanDefinitionParser for element [annotation-driven] Spring Web Service Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot locate BeanDefinitionParser for element [annotation-driven] Spring Web Service

    Hi, I am getting following exception


    type Exception report

    message Servlet.init() for servlet spring-ws2 threw exception

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Servlet.init() for servlet spring-ws2 threw exception
    org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:310)
    java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    java.lang.Thread.run(Unknown Source)


    root cause

    org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [annotation-driven]
    Offending resource: ServletContext resource [/WEB-INF/spring-ws2-servlet.xml]
    org.springframework.beans.factory.parsing.FailFast ProblemReporter.fatal(FailFastProblemReporter.java :59)
    org.springframework.beans.factory.parsing.ReaderCo ntext.fatal(ReaderContext.java:68)
    org.springframework.beans.factory.parsing.ReaderCo ntext.fatal(ReaderContext.java:55)
    org.springframework.beans.factory.xml.NamespaceHan dlerSupport.findParserForElement(NamespaceHandlerS upport.java:84)
    org.springframework.beans.factory.xml.NamespaceHan dlerSupport.parse(NamespaceHandlerSupport.java:73)
    org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1419)
    org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1409)
    org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:184)
    org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.doRegisterBeanDefinitions( DefaultBeanDefinitionDocumentReader.java:140)
    org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:111)
    org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:493)
    org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:390)
    org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
    org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
    org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:174)
    org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:209)
    org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:180)
    org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:125)
    org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:94)
    org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:131)
    org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:522)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:436)
    org.springframework.web.servlet.FrameworkServlet.c onfigureAndRefreshWebApplicationContext(FrameworkS ervlet.java:631)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:5 88)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:6 45)
    org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:508 )
    org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:449)
    org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:133)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:160)
    org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:310)
    java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    java.lang.Thread.run(Unknown Source)


    Here is my servlet xml file

    <?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:context="http://www.springframework.org/schema/context"
    xmlns:sws="http://www.springframework.org/schema/web-services"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/web-services http://www.springframework.org/schem...rvices-2.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <!-- To detect @Endpoint -->
    <sws:annotation-driven/>

    <!-- To detect @Service, @Component etc -->
    <context:component-scan base-package="ankeet.spring" />

    <!-- To generate dynamic wsdl -->
    <sws:dynamic-wsdl
    id="getSquare"
    portTypeName="SquareService"
    locationUri="/squareService"
    targetNamespace="http://ankeetmaini.wordpress.com/spring-ws2-square">
    <sws:xsd location="/WEB-INF/spring-ws2-square.xsd"/>
    </sws:dynamic-wsdl>

    <!-- For validating your request and response -->
    <!-- So that you don't send a string instead of an integer -->

    <sws:interceptors>
    <bean id="validatingInterceptor"
    class="org.springframework.ws.soap.server.endpoint .interceptor.PayloadValidatingInterceptor">
    <property name="schema" value="/WEB-INF/spring-ws2-square.xsd"/>
    <property name="validateRequest" value="true"/>
    <property name="validateResponse" value="true"/>
    </bean>
    </sws:interceptors>

    </beans>




    Please help!!
Working...
X