Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: HTTP 404 Error - Issue

  1. #1

    Default HTTP 404 Error - Issue

    Have deployed our Spring-WS on Weblogic 9.2 on Windows environment. The spring-ws jars have been copied to server lib directory. The the app. is deployed at the webcontext caobshared. There were no issues while deploying. Am testing the service from a soapUI tool. The url I am using is http://localhost:7002/caobshared/services. Am getting HTTP 404 errors. I do not see any errors or any debug statements I have in the webservice methods in the server log. Believe I am missing something or specifying incorrectly.
    We need to make a decision on using Spring-WS soon, based on the POC I working on. Any help or suggestions highly appreciated.

    web.xml file:

    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <display-name>CAOB Shared Service</display-name>

    <!-- take especial notice of the name of this servlet -->
    <servlet>
    <servlet-name>caob-shared</servlet-name>
    <servlet-class>org.springframework.ws.transport.http.Messag eDispatcherServlet</servlet-class>
    <init-param>
    <param-name>transformWsdlLocations</param-name>
    <param-value>true</param-value>
    </init-param>
    </servlet>

    <servlet-mapping>
    <servlet-name>caob-shared</servlet-name>
    <url-pattern>/services</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>caob-shared</servlet-name>
    <url-pattern>*.wsdl</url-pattern>
    </servlet-mapping>

    </web-app>


    caob-shared-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:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">

    <!-- ===================== ENDPOINTS ===================================== -->

    <!--
    The marshallingEndpoint handle the messages.
    -->

    <bean id="documentationService" class="com.boea.caob.ws.documentation.Documentatio nService"/>

    <bean id="documentationServiceEndpoint" class="com.boea.caob.ws.DocumentationServiceEndpoi nt">
    <description>
    This endpoint handles the DocumentService Web Service messages using JAXB2 marshalling.
    </description>
    <constructor-arg ref="documentationService"/>
    </bean>

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <description>
    The JAXB 2 Marshaller is used by the endpoints.
    </description>
    <property name="contextPath" value="com.boea.jaxb.caob.documentation.ws.jaxb"/>
    </bean>

    <!-- ===================== ENDPOINT MAPPINGS ============================== -->

    <!-- ===================== ENDPOINT ADAPTERS ============================== -->

    <!--
    Endpoint adapters adapt from the incoming message to a specific object or method signature. Because this
    example application uses three different endpoint programming models, we have to define three adapters. This
    is done for illustration purposes only, typically you would use one adapter, for instance the
    MarshallingMethodEndpointAdapter.
    -->

    <bean class="org.springframework.ws.server.endpoint.adap ter.MarshallingMethodEndpointAdapter">
    <description>
    This adapter allows for methods that need and returns marshalled objects. The MarshallingEndpoint
    uses JAXB 2 objects.
    </description>
    <constructor-arg ref="marshaller"/>
    </bean>

    <!-- ===================== WSDL DEFINITION ============================== -->
    <!-- Exposing a static WSDL -->
    <!--
    <bean id="documentService" class="org.springframework.ws.wsdl.wsdl11.SimpleWs dl11Definition">
    <constructor-arg value="/xsd/DocumentService.wsdl"/>
    </bean>
    -->

    <!-- Dynamically creating a WSDL from an XSD -->
    <bean id="documentService" class="org.springframework.ws.wsdl.wsdl11.DynamicW sdl11Definition">
    <description>
    Dynamically builds a WSDL from the DocumentService.xsd.This bean definition represents the DocumentService.wsdl file found
    in the root of the web application. It is used
    by the WsdlDefinitionHandlerAdapter in caob-shared-servlet.xml.
    </description>
    <property name="builder">
    <bean class="org.springframework.ws.wsdl.wsdl11.builder. XsdBasedSoap11Wsdl4jDefinitionBuilder">
    <property name="schema" value="/xsd/DocumentService.xsd"/>
    <property name="portTypeName" value="DocumentationPort"/>
    <property name="locationUri" value="http://localhost:8080/documentation/services"/>
    <property name="targetNamespace"
    value="http://www.test.com/caob/webservices/documentation/definitions"/>
    </bean>
    </property>
    </bean>

    </beans>

    Thanks
    Sunil

  2. #2
    Join Date
    Oct 2004
    Posts
    207

    Default

    The 404 means your web application didn't deploy at all or it didn't deploy as "caobshared".

    Are you sure there are no errors when this webapp is deployed? Do you see Spring get initialized when you deploy the app?

    Is it possible your webapp isn't being deployed as "caobshared"? Maybe it deployed as root? Maybe try http://localhost:7002/services

  3. #3

    Default

    The web app. has been deployed successfully. I can see the welcome page at the url http://localhost:7002/caobshared

    I have deployed the webapp on Tomcat 5.5, and I still get the same HTTP 404error. In the server console I see the foll. message while testing one of the webservice methods.
    - No endpoint mapping found for [SaajSoapMessage {http://www.boea.com/caob/webservices/documentation/schemas}GetDocumentListRequest]

    Have updated the servlet xml file to include the PayloadRootAnnotationMethodEndpointMapping interceptors as follows:

    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping">
    <property name="interceptors">
    <list>
    <bean class="org.springframework.ws.server.endpoint.inte rceptor.PayloadLoggingInterceptor"/>
    <bean class="org.springframework.ws.soap.server.endpoint .interceptor.PayloadValidatingInterceptor">
    <property name="schema" value="/xsd/DocumentService.xsd"/>
    <property name="validateRequest" value="true"/>
    <property name="validateResponse" value="true"/>
    </bean>
    </list>
    </property>
    <property name="order" value="1"/>
    </bean>

  4. #4
    Join Date
    Oct 2004
    Posts
    207

    Default

    aaah ok, I forgot Spring-WS will give a 404 if it can't find the endpoint; sorry.

    You're using the PayloadRootAnnotationMethodEndpointMapping and it's saying it can't find an endpoint for {http://www.boea.com/caob/webservices/documentation/schemas}GetDocumentListRequest

    This means that you need to have an endpoint in your application context that is annotated with the @Endpoint that has at least one method annotated with: @PayloadRoot(localPart = "GetDocumentListRequest", namespace = "http://www.boea.com/caob/webservices/documentation/schemas")

    For example...

    Code:
    @Endpoint
    public class YourEndpoint {
    
      @PayloadRoot(localPart = "GetDocumentListRequest", namespace = "http://www.boea.com/caob/webservices/documentation/schemas")
      public DocumentList getDocumentList(...)
      }
    }
    And again, this bean endpoint has to be in your spring-ws application context xml...
    [code]
    <bean class="com.boea....YourEndpoint"/>
    [code]

    http://static.springframework.org/sp...er-at-endpoint

  5. #5

    Default

    Thanks for the quick reply. Here are the webservice methods which are annotated. Any other pointers? I know am pretty close. Appreciate your help.

    @Endpoint
    public class DocumentationServiceEndpoint implements DocumentationWebServiceConstants

    @PayloadRoot(localPart = "GetDocumentListRequest", namespace = "http://www.baeo.com/caob/webservices/documentation/schemas")
    GetDocumentListResponse getDocumentList(GetDocumentListRequest request)

    @PayloadRoot(localPart = "StagePackagesRequest", namespace = "http://www.baeo.com/caob/webservices/documentation/schemas")
    StagePackagesResponse stagePackages(StagePackagesRequest request)

    @PayloadRoot(localPart = "GetPackageListRequest", namespace = "http://www.baeo.com/caob/webservices/documentation/schemas")
    GetPackageListResponse getPackageList(GetPackageListRequest request)

    @PayloadRoot(localPart = "UpdateDocumentsRequest", namespace = "http://www.baeo.com/caob/webservices/documentation/schemas")
    UpdateDocumentsResponse updateDocuments(UpdateDocumentsRequest request)

    In the spring servlet xml I have the bean endpoint as:

    <bean id="documentationService" class="com.boea.caob.ws.documentation.Documentatio nService"/>

    <bean id="documentationServiceEndpoint" class="com.boea.caob.ws.DocumentationServiceEndpoi nt">
    <description>
    This endpoint handles the DocumentService Web Service messages using JAXB2 marshalling.
    </description>
    <constructor-arg ref="documentationService"/>
    </bean>

  6. #6

  7. #7
    Join Date
    Oct 2004
    Posts
    207

    Default

    You have a typo in your schemas

    Your request document is using
    http://www.boea.com/caob/webservices...tation/schemas

    Your endpoints are annotated to use
    http://www.baeo.com/caob/webservices...tation/schemas

  8. #8

    Default

    Mistake while pasting it here But it indeed is http://www.boea.com/caob/webservices...tation/schemas

  9. #9
    Join Date
    Oct 2004
    Posts
    207

    Default

    Fix those annotations and redeploy the webapp. Does that fix it?

  10. #10

    Default

    No it did not work. The code was refering to the correct annotations, it was a mistake while pasting it here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •