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

  • sunil_g1
    started a topic HTTP 404 Error - Issue

    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

  • sarath
    replied
    Useful discussion.. was able to narrow down my issue ...I had my payload method as protected which gave me 404 Not Found..

    Thanks to all

    Leave a comment:


  • cloutierm
    replied
    i had a similar problem.. thanks for the help!

    Leave a comment:


  • RayKrueger
    replied
    haha yeah that'd do it

    Leave a comment:


  • sunil_g1
    replied
    Ray.

    It works now. I found the problem, the webservice method was not declared public.

    It was:
    GetDocumentListResponse getDocumentList(GetDocumentListRequest request) {

    Changed it to:
    public GetDocumentListResponse getDocumentList(GetDocumentListRequest request) {

    Thanks
    Sunil

    Leave a comment:


  • RayKrueger
    replied
    Ok, now we're getting somewhere.

    It found endpoint by it's @Endpoint annotation. We know that because it said...
    Registering methods for endpoint: [com.bofa.caob.ws.Documentat
    [email protected]]

    Notice how we don't see any message that says "Lookup key for method [blah]: [blah]"? That means either it didn't see your PayloadMapping annotation or something else might be wrong...

    Can you change the method getLookupKeyForMethod to this:
    Code:
        protected String getLookupKeyForMethod(Method method) {
            log.info("Looking up key for method: [" + method + "]");
            String key = super.getLookupKeyForMethod(method);
            log.debug("Lookup key for method [" + method + "] is [" + key + "]");
            return key;
        }
    And run it again please?

    I'm interested to see if we see a "Looking up key for method" message at all. If we see the message, Spring-WS saw your endpoint. If not, then something else is wrong...

    Leave a comment:


  • sunil_g1
    replied
    Ray.

    Here's the log, after I included the class you sent:

    2007-10-29 11:36:20,286 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Initializing servlet 'caob-shared'
    2007-10-29 11:36:20,444 INFO [org.springframework.ws.transport.http.MessageDispa
    tcherServlet] - FrameworkServlet 'caob-shared': initialization started
    2007-10-29 11:36:20,460 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Servlet with name 'caob-shared' will try to create custom WebAp
    plicationContext context of class 'org.springframework.web.context.support.XmlWe
    bApplicationContext', using parent context [null]
    2007-10-29 11:36:21,076 INFO [com.bofa.caob.ws.DebugPayloadRootAnnotationMethodE
    ndpointMapping] - Potential Endpoint: [class com.bofa.caob.service.Documentation
    ServiceImpl]
    2007-10-29 11:36:21,108 INFO [com.bofa.caob.ws.DebugPayloadRootAnnotationMethodE
    ndpointMapping] - Potential Endpoint: [class com.bofa.caob.ws.DocumentationServi
    ceEndpoint]
    2007-10-29 11:36:21,139 INFO [com.bofa.caob.ws.DebugPayloadRootAnnotationMethodE
    ndpointMapping] - Registering methods for endpoint: [com.bofa.caob.ws.Documentat
    [email protected]]
    2007-10-29 11:36:21,139 INFO [com.bofa.caob.ws.DebugPayloadRootAnnotationMethodE
    ndpointMapping] - Potential Endpoint: [class com.bofa.caob.ws.DocumentationServi
    ceEndpoint]
    2007-10-29 11:36:21,187 INFO [com.bofa.caob.ws.DebugPayloadRootAnnotationMethodE
    ndpointMapping] - Potential Endpoint: [class org.springframework.oxm.jaxb.Jaxb2M
    arshaller]
    2007-10-29 11:36:21,218 INFO [org.springframework.oxm.jaxb.Jaxb2Marshaller] - Cr
    eating JAXBContext with context path [com.bofa.jaxb.caob.documentation.ws.jaxb]
    2007-10-29 11:36:22,293 INFO [com.bofa.caob.ws.DebugPayloadRootAnnotationMethodE
    ndpointMapping] - Potential Endpoint: [class org.springframework.ws.server.endpo
    int.adapter.MarshallingMethodEndpointAdapter]
    2007-10-29 11:36:22,309 INFO [com.bofa.caob.ws.DebugPayloadRootAnnotationMethodE
    ndpointMapping] - Potential Endpoint: [class org.springframework.ws.wsdl.wsdl11.
    SimpleWsdl11Definition]
    2007-10-29 11:36:22,324 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Published WebApplicationContext of servlet 'caob-shared' as Ser
    vletContext attribute with name [org.springframework.web.servlet.FrameworkServle
    t.CONTEXT.caob-shared]
    2007-10-29 11:36:22,388 INFO [org.springframework.ws.soap.saaj.SaajSoapMessageFa
    ctory] - Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
    2007-10-29 11:36:22,388 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - No WebServiceMessageFactory found in servlet 'caob-shared': usi
    ng default
    2007-10-29 11:36:22,451 DEBUG [org.springframework.ws.soap.server.SoapMessageDis
    patcher] - No EndpointExceptionResolvers found, using defaults
    2007-10-29 11:36:22,451 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - No MessageDispatcher found in servlet 'caob-shared': using defa
    ult
    2007-10-29 11:36:22,451 INFO [org.springframework.ws.transport.http.MessageDispa
    tcherServlet] - FrameworkServlet 'caob-shared': initialization completed in 2007
    ms
    2007-10-29 11:36:22,451 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Servlet 'caob-shared' configured successfully
    2007-10-29 11:36:22,530 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Successfully completed request

    Thanks
    Sunil

    Leave a comment:


  • RayKrueger
    replied
    You can google how to remote debug tomcat...

    In the mean time add the class below to your application. Then replace your usage of the PayloadRootAnnotationMethodEndpointMapping in your application context with it...

    Code:
    public class DebugPayloadRootAnnotationMethodEndpointMapping extends PayloadRootAnnotationMethodEndpointMapping {
    
        private static final Logger log = Logger.getLogger(DebugPayloadRootAnnotationMethodEndpointMapping.class);
    
        protected Class getEndpointClass(Object endpoint) {
            Class endpointClass = super.getEndpointClass(endpoint);
            log.info("Potential Endpoint: [" + endpointClass + "]");
            return endpointClass;
        }
    
        protected void registerMethods(Object endpoint) {
            log.info("Registering methods for endpoint: [" + endpoint + "]");
            super.registerMethods(endpoint);
        }
    
        protected String getLookupKeyForMethod(Method method) {
            String key = super.getLookupKeyForMethod(method);
            log.info("Lookup key for method [" + method + "]: [" + key + "]");
            return key;
        }
    }
    Fire up your app and let us know what the output looks like. Mainly, does it mention your endpoint as a "Potential Endpoint"? If so, what lookup key does it use?

    Leave a comment:


  • sunil_g1
    replied
    There is really not much of difference between the MTOM sample and the example I am working on. Am I missing something ?

    Leave a comment:


  • sunil_g1
    replied
    Ray.

    These are the imports I have in the endpoint class:

    import javax.xml.bind.JAXBElement;

    import org.apache.log4j.Logger;
    import org.springframework.util.Assert;
    import org.springframework.ws.server.endpoint.annotation. Endpoint;
    import org.springframework.ws.server.endpoint.annotation. PayloadRoot;

    Regarding setting breakpoint, will have to try that. Do I need to setup a remote debugger? How should I do that ?

    Appreciate your help.

    Thanks
    Sunil

    Leave a comment:


  • RayKrueger
    replied
    Hey, quick question...

    The @Endpoint annotation on your DocumentationServiceEndpoint...

    Can you double check that it is actually the org.springframework.ws.server.endpoint.annotation. Endpoint annotation, and not some other "Endpoint" annotation?

    Leave a comment:


  • RayKrueger
    replied
    Any chance you can attach the spring-ws source to your ide and fire up your debugger?

    Set a breakpoint in the PayloadRootAnnotationMethodEndpointMapping::getLoo kupKeyForMethod method, it should get hit at startup.

    And see if it ever gets hit. If not, try setting one in the AbstractAnnotationMethodEndpointMapping:ostProcessBeforeInitialization method and see if it gets hit at startup.

    I'm going to open a Jira to get some more debug logging in place around the AbstractMethodEndpointMapping based operations.

    Leave a comment:


  • sunil_g1
    replied
    Ray,
    Here are the logs from tomcat, this is while I request the url from the url http://localhost:8080/caobshared/ser...aobshared.wsdl

    INFO: Find registry server-registry.xml at classpath resource
    Oct 29, 2007 10:01:16 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 2938 ms
    2007-10-29 10:01:24,302 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Initializing servlet 'caob-shared'
    2007-10-29 10:01:24,476 INFO [org.springframework.ws.transport.http.MessageDispa
    tcherServlet] - FrameworkServlet 'caob-shared': initialization started
    2007-10-29 10:01:24,476 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Servlet with name 'caob-shared' will try to create custom WebAp
    plicationContext context of class 'org.springframework.web.context.support.XmlWe
    bApplicationContext', using parent context [null]
    2007-10-29 10:01:25,219 INFO [org.springframework.oxm.jaxb.Jaxb2Marshaller] - Cr
    eating JAXBContext with context path [com.bofa.jaxb.caob.documentation.ws.jaxb]
    2007-10-29 10:01:26,309 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Published WebApplicationContext of servlet 'caob-shared' as Ser
    vletContext attribute with name [org.springframework.web.servlet.FrameworkServle
    t.CONTEXT.caob-shared]
    2007-10-29 10:01:26,388 INFO [org.springframework.ws.soap.saaj.SaajSoapMessageFa
    ctory] - Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
    2007-10-29 10:01:26,388 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - No WebServiceMessageFactory found in servlet 'caob-shared': usi
    ng default
    2007-10-29 10:01:26,435 DEBUG [org.springframework.ws.soap.server.SoapMessageDis
    patcher] - No EndpointExceptionResolvers found, using defaults
    2007-10-29 10:01:26,435 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - No MessageDispatcher found in servlet 'caob-shared': using defa
    ult
    2007-10-29 10:01:26,435 INFO [org.springframework.ws.transport.http.MessageDispa
    tcherServlet] - FrameworkServlet 'caob-shared': initialization completed in 1959
    ms
    2007-10-29 10:01:26,451 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Servlet 'caob-shared' configured successfully
    2007-10-29 10:01:26,514 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Successfully completed request

    And this is the log, when I submit a webservice request:

    2007-10-29 10:27:37,187 DEBUG [org.springframework.ws.soap.server.SoapMessageDis
    patcher] - MessageDispatcher with name 'caob-shared' received request [SaajSoapM
    essage {http://www.bankofamerica.com/caob/webservices/documentation/schemas}GetD
    ocumentListRequest]
    2007-10-29 10:27:37,250 DEBUG [org.springframework.ws.server.endpoint.mapping.Pa
    yloadRootAnnotationMethodEndpointMapping] - Looking up endpoint for [{http://www
    .bankofamerica.com/caob/webservices/documentation/schemas}GetDocumentListRequest
    ]
    2007-10-29 10:27:37,250 DEBUG [org.springframework.ws.soap.server.SoapMessageDis
    patcher] - Endpoint mapping [org.springframework.ws.server.endpoint.mapping.Pay l
    [email protected]] has no mapping for request
    2007-10-29 10:27:37,250 WARN [org.springframework.ws.EndpointNotFound] - No endp
    oint mapping found for [SaajSoapMessage {http://www.bankofamerica.com/caob/webse
    rvices/documentation/schemas}GetDocumentListRequest]
    2007-10-29 10:27:37,250 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Successfully completed request

    Appreciate it.

    Thanks
    Sunil

    Leave a comment:


  • RayKrueger
    replied
    Would you mind posting a new log showing the failure you're having again please?

    Bad input was making the sample fail. Now that we know the sample works we can once again focus on your application.

    I see your endpoint and it's annotations, I see your schema, I see your applicationContext.xml.

    Please post a new log snippet and at least the opening snippet of the XML request you're sending.

    Leave a comment:


  • sunil_g1
    replied
    Arjen.

    That fixed the MTOM sample. But I still have the problem with my example, which was the original post. The tomcat logs shows as below, which says that

    No EndpointExceptionResolvers found

    INFO: Server startup in 2938 ms
    2007-10-28 18:43:32,369 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Initializing servlet 'caob-shared'
    2007-10-28 18:43:32,495 INFO [org.springframework.ws.transport.http.MessageDispa
    tcherServlet] - FrameworkServlet 'caob-shared': initialization started
    2007-10-28 18:43:32,495 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Servlet with name 'caob-shared' will try to create custom WebAp
    plicationContext context of class 'org.springframework.web.context.support.XmlWe
    bApplicationContext', using parent context [null]
    2007-10-28 18:43:33,048 INFO [org.springframework.oxm.jaxb.Jaxb2Marshaller] - Cr
    eating JAXBContext with context path [com.bofa.jaxb.caob.documentation.ws.jaxb]
    2007-10-28 18:43:33,712 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - Published WebApplicationContext of servlet 'caob-shared' as Ser
    vletContext attribute with name [org.springframework.web.servlet.FrameworkServle
    t.CONTEXT.caob-shared]
    2007-10-28 18:43:33,759 INFO [org.springframework.ws.soap.saaj.SaajSoapMessageFa
    ctory] - Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
    2007-10-28 18:43:33,759 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - No WebServiceMessageFactory found in servlet 'caob-shared': usi
    ng default
    2007-10-28 18:43:33,791 DEBUG [org.springframework.ws.soap.server.SoapMessageDis
    patcher] - No EndpointExceptionResolvers found, using defaults
    2007-10-28 18:43:33,791 DEBUG [org.springframework.ws.transport.http.MessageDisp
    atcherServlet] - No MessageDispatcher found in servlet 'caob-shared': using defa
    ult
    2007-10-28 18:43:33,791 INFO [org.springframework.ws.transport.http.MessageDispa
    tcherServlet] - FrameworkServlet 'caob-shared': initialization completed in 1296
    ms

    Here's the snippet of my endpoint:
    @Endpoint
    public class DocumentationServiceEndpoint implements DocumentationWebServiceConstants {
    ....
    @PayloadRoot(localPart = "GetDocumentListRequest", namespace = "http://www.bankofamerica.com/caob/webservices/documentation/schemas")

    }

    This is my xsd:
    <xsd:element name="GetDocumentListRequest">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="requestHeader" type="xsd:string" minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="GetDocumentListResponse">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="responseHeader" type="xsd:string" minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>


    My caob-shared-servlet.xml file contains:

    <bean id="documentationService" class="com.bofa.caob.service.DocumentationServiceI mpl"/>

    <bean class="com.bofa.caob.ws.DocumentationServiceEndpoi nt">
    <constructor-arg ref="documentationService"/>
    </bean>

    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping"/>

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

    <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.bofa.jaxb.caob.documentation.ws.jaxb"/>
    <property name="mtomEnabled" value="true"/>
    </bean>

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

    Pls. help me. Its kinda crazy, that the sample finds the mapping methods as shown in logs below, but not my example.

    2007-10-28 12:19:41,469 DEBUG [org.springframework.ws.server.endpoint.mapping.Pa
    yloadRootAnnotationMethodEndpointMapping] - Mapped key [{http://www.springframew
    ork.org/ws/samples/mtom/schema}LoadImageRequest] onto endpoint [public javax.xml
    .bind.JAXBElement org.spring.ws.samples.mtom.ws.ImageRepositoryEndpo int.load(jav
    ax.xml.bind.JAXBElement) throws java.io.IOException]
    2007-10-28 12:19:41,469 DEBUG [org.springframework.ws.server.endpoint.mapping.Pa
    yloadRootAnnotationMethodEndpointMapping] - Mapped key [{http://www.springframew
    ork.org/ws/samples/mtom/schema}StoreImageRequest] onto endpoint [public void org
    .spring.ws.samples.mtom.ws.ImageRepositoryEndpoint .store(javax.xml.bind.JAXBElem
    ent) throws java.io.IOException]

    I really need some pointers here, am not able to figure out what is going on here.

    Thanks
    Sunil

    Leave a comment:

Working...
X