Announcement Announcement Module
Collapse
No announcement yet.
HTTP 404 Error - Issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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>

      Comment


      • #4
        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

        Comment


        • #5
          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>

          Comment


          • #6
            Sorry, the namespace string is http://www.boea.com/caob/webservices...tation/schemas

            Comment


            • #7
              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

              Comment


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

                Comment


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

                  Comment


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

                    Comment


                    • #11
                      Ray, any other pointers ? Appreciate it.

                      Comment


                      • #12
                        This is the tomcat log:

                        INFO: Server startup in 2207 ms
                        - Initializing Spring FrameworkServlet 'caob-shared'
                        - FrameworkServlet 'caob-shared': initialization started
                        - Refreshing org.springframework.web.context.support.XmlWebAppl icationContext@1f
                        0b7d3: display name [WebApplicationContext for namespace 'caob-shared-servlet'];
                        startup date [Thu Oct 25 11:04:44 EDT 2007]; root of context hierarchy
                        - Loading XML bean definitions from ServletContext resource [/WEB-INF/caob-share
                        d-servlet.xml]
                        - Bean factory for application context [org.springframework.web.context.support.
                        XmlWebApplicationContext@1f0b7d3]: org.springframework.beans.factory.support.Def
                        aultListableBeanFactory@754fc
                        - Bean 'org.springframework.ws.server.endpoint.intercepto r.PayloadLoggingInterce
                        ptor#ffd135' is not eligible for getting processed by all BeanPostProcessors (fo
                        r example: not eligible for auto-proxying)
                        - Validating using ServletContext resource [/xsd/DocumentService.xsd]
                        - Bean 'org.springframework.ws.soap.server.endpoint.inter ceptor.PayloadValidatin
                        gInterceptor#1000bcf' is not eligible for getting processed by all BeanPostProce
                        ssors (for example: not eligible for auto-proxying)
                        - Bean 'org.springframework.ws.server.endpoint.mapping.Pa yloadRootAnnotationMeth
                        odEndpointMapping' is not eligible for getting processed by all BeanPostProcesso
                        rs (for example: not eligible for auto-proxying)
                        - Pre-instantiating singletons in org.springframework.beans.factory.support.Defa
                        ultListableBeanFactory@754fc: defining beans [documentationServiceEndpoint,docum
                        entationService,marshaller,org.springframework.ws. server.endpoint.mapping.Payloa
                        dRootAnnotationMethodEndpointMapping,org.springfra mework.ws.server.endpoint.adap
                        ter.MarshallingMethodEndpointAdapter,documentServi ce]; root of factory hierarchy

                        - Creating JAXBContext with context path [com.boea.jaxb.caob.documentation.ws.ja
                        xb]
                        - Creating SAAJ 1.2 MessageFactory
                        - FrameworkServlet 'caob-shared': initialization completed in 2507 ms
                        - No endpoint mapping found for [SaajSoapMessage {http://www.boea.com/c
                        aob/webservices/documentation/schemas}GetDocumentListRequest]

                        Comment


                        • #13
                          Is that contextPath correct on your Jaxb2Marshaller?
                          com.boea.jaxb.caob.documentation.ws.jaxb

                          Comment


                          • #14
                            Yes, thats right Ray.

                            <property name="contextPath" value="com.boea.jaxb.caob.documentation.ws.jaxb"/>

                            Comment


                            • #15
                              Any other pointers pls. I need to resolve this very urgently. Been stuck with this since last 2 days.

                              Thanks
                              Sunil

                              Comment

                              Working...
                              X