Announcement Announcement Module
Collapse
No announcement yet.
holidayService throws java.lang.NoSuchMethodError Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • holidayService throws java.lang.NoSuchMethodError

    I am trying to get the very simple webservice, HolidayService, to respond successfully to soapUi call.
    Server jboss EnterprisePlatform-5.1.2, jdk is 1.6.

    pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany.hr</groupId>
    <artifactId>holidayService</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>holidayService Spring-WS Application</name>
    <url>http://www.springframework.org/spring-ws</url>
    <build>
    <finalName>holidayService</finalName>
    <plugins>
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
    <source>1.5</source>
    <target>1.5</target>
    </configuration>
    </plugin>
    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.1</version>
    </plugin>
    </plugins>
    </build>
    <dependencies>
    <dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-core</artifactId>
    <version>2.1.2.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>jdom</groupId>
    <artifactId>jdom</artifactId>
    <version>1.0</version>
    </dependency>
    <dependency>
    <groupId>jaxen</groupId>
    <artifactId>jaxen</artifactId>
    <version>1.1</version>
    <scope>provided</scope>
    </dependency>
    </dependencies>
    </project>

    The generated war file deploys.
    The wsdl http://localhost:8080/holidayService/holiday.wsdl presents itself as

    This XML file does not appear to have any style information associated
    with it. The document tree is shown below.
    <wsdl:definitions targetNamespace="http://mycompany.com/hr/definitions">
    <wsdl:types>
    <xs:schema elementFormDefault="qualified"
    targetNamespace="http://mycompany.com/hr/schemas">
    <xs:element name="HolidayRequest">
    <xs:complexType>
    <xs:all>
    <xs:element name="Holiday" type="hr:HolidayType" />
    <xs:element name="Employee" type="hr:EmployeeType" />
    </xs:all>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="HolidayType">
    <xs:sequence>
    <xs:element name="StartDate" type="xs:date" />
    <xs:element name="EndDate" type="xs:date" />
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="EmployeeType">
    <xs:sequence>
    <xs:element name="Number" type="xs:integer" />
    <xs:element name="FirstName" type="xs:string" />
    <xs:element name="LastName" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    </wsdl:types>
    <wsdl:message name="HolidayRequest">
    <wsdlart element="sch:HolidayRequest" name="HolidayRequest">
    </wsdlart>
    </wsdl:message>
    <wsdlortType name="HumanResource">
    <wsdl:operation name="Holiday">
    <wsdl:input message="tns:HolidayRequest" name="HolidayRequest">
    </wsdl:input>
    </wsdl:operation>
    </wsdlortType>
    <wsdl:binding name="HumanResourceSoap11" type="tns:HumanResource">
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="Holiday">
    <soap:operation soapAction="" />
    <wsdl:input name="HolidayRequest">
    <soap:body use="literal" />
    </wsdl:input>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="HumanResourceService">
    <wsdlort binding="tns:HumanResourceSoap11" name="HumanResourceSoap11">
    <soap:address location="/holidayService/" />
    </wsdlort>
    </wsdl:service>
    </wsdl:definitions>

    In soapUI the following is sent to URL http://localhost:8080/holidayService/holiday.wsdl.
    content sent is
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://cleartrack.com/hr/schemas">
    <soapenv:Header/>
    <soapenv:Body>
    <sch:HolidayRequest>
    <!--You may enter the following 2 items in any order-->
    <sch:Holiday>
    <sch:StartDate>2006-07-03</sch:StartDate>
    <sch:EndDate>2006-07-03</sch:EndDate>
    </sch:Holiday>
    <sch:Employee>
    <sch:Number>33</sch:Number>
    <sch:FirstName>Herman</sch:FirstName>
    <sch:LastName>Munster</sch:LastName>
    </sch:Employee>
    </sch:HolidayRequest>
    </soapenv:Body>
    </soapenv:Envelope>

    And the error received is

    exception

    org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is java.lang.NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.newInstan ce(Ljava/lang/String;Ljava/lang/ClassLoaderLjavax/xml/parsers/DocumentBuilderFactory;
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:894)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:789)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)


    root cause

    java.lang.NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.newInstan ce(Ljava/lang/String;Ljava/lang/ClassLoaderLjavax/xml/parsers/DocumentBuilderFactory;
    org.jboss.wsf.common.DOMUtils$1.initialValue(DOMUt ils.java:120)
    org.jboss.wsf.common.DOMUtils$1.initialValue(DOMUt ils.java:107)
    java.lang.ThreadLocal.setInitialValue(ThreadLocal. java:141)
    java.lang.ThreadLocal.get(ThreadLocal.java:131)
    org.jboss.wsf.common.DOMUtils.getDocumentBuilder(D OMUtils.java:219)
    org.jboss.wsf.common.DOMUtils.getOwnerDocument(DOM Utils.java:760)
    org.jboss.ws.core.soap.SOAPDocument.<init>(SOAPDoc ument.java:56)
    org.jboss.ws.core.soap.SOAPPartImpl.<init>(SOAPPar tImpl.java:74)
    org.jboss.ws.core.soap.SOAPMessageImpl.<init>(SOAP MessageImpl.java:95)
    org.jboss.ws.core.soap.MessageFactoryImpl.createMe ssage(MessageFactoryImpl.java:215)
    org.jboss.ws.core.soap.MessageFactoryImpl.createMe ssage(MessageFactoryImpl.java:193)
    org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory.createWebServiceMessage(SaajSoapMessageFacto ry.java:184)
    org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory.createWebServiceMessage(SaajSoapMessageFacto ry.java:60)
    org.springframework.ws.transport.AbstractWebServic eConnection.receive(AbstractWebServiceConnection.j ava:90)
    org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:86)
    org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:59)
    org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:239)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:882)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:789)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)

    Need some assistance determining the remedy.

    Thx,
    Robert
Working...
X