Forum Discussion

atlsgnz's avatar
atlsgnz
Occasional Contributor
11 years ago

No context found for request error on localhost

I have a web service deployed on Tomcat that I imported into soapUI using the wsdl on our development server. I then added two more endpoints for that project, one on our test server and one on my local machine. When I send a request to either the dev or test endpoints, everything is fine, I'm getting the expected results back. However, when I select my localhost endpoint, I get the following error:


<h1>404 Not Found</h1>No context found for request


Here is the full http error log:


DEBUG:>> "POST /services/MyService/webservices/myendpoint HTTP/1.1[\r][\n]"
DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]"
DEBUG:>> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
DEBUG:>> "SOAPAction: "http://mycompany.com/getXML"[\r][\n]"
DEBUG:>> "Content-Length: 322[\r][\n]"
DEBUG:>> "Host: localhost:8080[\r][\n]"
DEBUG:>> "Connection: Keep-Alive[\r][\n]"
DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"
DEBUG:>> "[\r][\n]"
DEBUG:>> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://mycompany.com/types/">[\n]"
DEBUG:>> " <soapenv:Header/>[\n]"
DEBUG:>> " <soapenv:Body>[\n]"
DEBUG:>> " <typ:getXMLElement>[\n]"
DEBUG:>> " <typ:pNumDays>40</typ:pNumDays>[\n]"
DEBUG:>> " </typ:getXMLElement>[\n]"
DEBUG:>> " </soapenv:Body>[\n]"
DEBUG:>> "</soapenv:Envelope>"
DEBUG:<< "HTTP/1.1 404 Not Found[\r][\n]"
DEBUG:<< "Content-Length: 50[\r][\n]"
DEBUG:<< "Content-Type: text/html[\r][\n]"
DEBUG:<< "Connection: close[\r][\n]"
DEBUG:<< "[\r][\n]"
DEBUG:<< "<h1>404 Not Found</h1>No context found for request"


I have deployed the exact same war file in all three places, so no trouble with the wsdl being different. I also have no trouble accessing the wsdl on localhost from both IE and Chrome, so the service has deployed correctly there.

The weirdest thing is that it was working fine until 4 days ago, then it suddenly stopped. I was using soapUI version 4.5.1, but upgraded to 4.5.2 when it stopped working to see if that fixed it. No go, still broken.

I'm using java 1.6 and tomcat 7.0.

Any ideas? Thanks in advance.

Cheers

9 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Do you see anything in the tomcat logs of local machine when service operation is hit?
  • atlsgnz's avatar
    atlsgnz
    Occasional Contributor
    Unfortunately no, there is no indication in the local tomcat log that the request is even getting to the server. This is why I'm thinking there is some strange configuration in soapUI having to do with localhost.
  • nmrao's avatar
    nmrao
    Champion Level 3
    Strange.

    Atleast is there any difference in soapui logs / raw request messages when it works and does not work?
  • atlsgnz's avatar
    atlsgnz
    Occasional Contributor
    I'm not seeing one. This is the log from a working message:


    DEBUG:>> "POST /services/MyService/webservices/myendpoint HTTP/1.1[\r][\n]"
    DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]"
    DEBUG:>> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
    DEBUG:>> "SOAPAction: "http://mycompany.com/getXML"[\r][\n]"
    DEBUG:>> "Content-Length: 322[\r][\n]"
    DEBUG:>> "Host: dev-server.mycompany.com[\r][\n]"
    DEBUG:>> "Connection: Keep-Alive[\r][\n]"
    DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"
    DEBUG:>> "[\r][\n]"
    DEBUG:>> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://mycompany.com/types/">[\n]"
    DEBUG:>> " <soapenv:Header/>[\n]"
    DEBUG:>> " <soapenv:Body>[\n]"
    DEBUG:>> " <typ:getXMLElement>[\n]"
    DEBUG:>> " <typ:pNumDays>40</typ:pNumDays>[\n]"
    DEBUG:>> " </typ:getXMLElement>[\n]"
    DEBUG:>> " </soapenv:Body>[\n]"
    DEBUG:>> "</soapenv:Envelope>"
    DEBUG:<< "HTTP/1.1 200 OK[\r][\n]"
    DEBUG:<< "Content-Type: text/xml;charset=UTF-8[\r][\n]"
    DEBUG:<< "Content-Length: 332[\r][\n]"
    DEBUG:<< "Keep-Alive: timeout=5, max=100[\r][\n]"
    DEBUG:<< "Connection: Keep-Alive[\r][\n]"
    DEBUG:<< "[\r][\n]"
    DEBUG:<< "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><getXMLResponseElement xmlns="http://mycompany.com/types/"><result><any xmlns:ns2="http://mycompany.com/types/" xmlns="">random data</any></result></getXMLResponseElement></soap:Body></soap:Envelope>"


    Another interesting note, I tried to create a new project using my localhost wsdl instead of the dev server and get this error:


    Error loading [http://localhost:8080/services/MyService/webservices/myendpoint?wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA


    Full error in the logs:


    ERROR:com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException
    com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException
    at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader.loadXmlObject(WsdlLoader.java:138)
    at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:535)
    at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:524)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionCache.update(AbstractDefinitionCache.java:97)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:236)
    at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
    at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
    at java.lang.Thread.run(Unknown Source)


    I did a diff on the two wsdl files just to be sure and the only difference was definitely the soap:address location element.
  • nmrao's avatar
    nmrao
    Champion Level 3
    Thanks for making multiple efforts. Is it possible to take the deployable archive from the environment where it is working and deploy the same in local machine and if the results are fruitful?
  • atlsgnz's avatar
    atlsgnz
    Occasional Contributor
    I'm not entirely sure what you mean other than I've taken the same exact war file and deployed it in all three places. The only difference being it's deployed on Windows 7 locally and Linux on our servers. All three are Tomcat 7.

    On a whim I created a new project and instead of using the localhost url to point to the wsdl, I used the actual wsdl file in the tomcat deployed webapps directory for my project. It imported just fine (no error). But got the same 404 error when trying to submit the request.
  • nmrao's avatar
    nmrao
    Champion Level 3
    Oh ok. I thought deployable archive was built separate on each box.

    404 is strange.
  • nmrao's avatar
    nmrao
    Champion Level 3
    is Java version and 32bit/64bit arch same?
  • atlsgnz's avatar
    atlsgnz
    Occasional Contributor
    I gave up and wrote a client to test on localhost. Thanks for your help though, it is appreciated!