简体   繁体   中英

Tomcat web application not working

I am experiencing some difficulty getting a companies web service test-suite environment up and running on my local server.I received 2 war files from them which I already deployed on my tomcat server.

The test suite compromises of 2 components.

  1. xmlvend-server.war
  2. xmlvend-client.war

I can access the server

http://localhost:8080/xmlvend-server

and client web application

http://localhost:8080/xmlvend-client

On the server webpage I am greeted by the following message :

Protocol Testing Server

This is the protocol testing server for xmlvend Scenario file(s) are stored / read in the following location:
C:\\Documents and Settings\\LocalService/xmlvend/test-server/ Message invocation may be based on the standard XMLVend 2.1 WSDL, by sending POST requests to the following endpoint address: http://127.0.0.1:8080/xmlvend-server/service

Everything seems fine, but when I click on endpoint address (above) I get the following error/exception message :

exception : javax.servlet.ServletException: Failed to get reference to SOAP Engine xmlhttp.framework.MessageReceiverServlet.init(MessageReceiverServlet.java:50)

root cause : java.lang.Exception: No SOAPProcessor in context xmlhttp.framework.MessageReceiverServlet.init(MessageReceiverServlet.java:45)

If I try to access the wsdl file (xmlvend-full-2.1.wsdl) of the web service I receive the same exception as above.

I also received the wsdl from the company but where should I place it? Should it be placed inside the webapps/test-server folder of tomcat?

Can anybody tell me how I can get the web application to work? Any help much appreciated, I have even configured the server for easy VNC/RDP remote access please contact me if you can help me out.

Thank You

My setup :

  • Tomcat server 7.0.20
  • Java SDK/SE 7
  • java version 1.4.2_03
  • Windows XP SP3

Additional Information :

Server - web.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 file:/Users/dawidl/Projects/solms/solmsRoot/externalResources/sun/xml/schemas/j2ee/web-app_2_4.xsd" 
    version="2.4">

    <display-name>XMLVend Server (Web Services Testing Framework)</display-name>
    <description>
        A zero-business-logic web services server to perform protocol testing. All requests
        with a URI of /service/* (and POST method) indicate web services (SOAP/HTTP) requests, the rest 
        are normal XHTML,etc/HTTP
    </description>


    <!-- Decodes any HTTP Requests sent using GZIP compression. Does so transparently,
     so all components in the chain after it are unaware of the compressed request. This
     is why the stupid Osmotic filter that follows prints out the annoying message
     'request not compressed' even though it was originally (and we can't turn off
     the printouts, because osmotic do not make their source available. -->
    <filter>
        <filter-name>HttpRequestCompressionFilter</filter-name>
        <filter-class>xmlhttp.framework.io.HttpCompressionFilter</filter-class>
    </filter>
    <!-- Use off-the-shelf (Osmotic Web) Response Compression Filter (Supposed
    to do two-way, but it's broken, which is why we wrote our own filter.-->
    <filter>
        <filter-name>HttpResponseCompressionFilter</filter-name>
        <filter-class>com.osmoticweb.gzipfilter.GZIP2WayFilter</filter-class>
    </filter>
    <!-- Filter to cater for non-conforming user agents (read: MS Internet Explorer) 
    that do not understand the XHTML MIME type -->
    <filter>
        <filter-name>XHTMLMIMEFilter</filter-name>
        <filter-class>za.co.solms.web.xhtml.MIMEFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>HttpRequestCompressionFilter</filter-name>
        <url-pattern>/service/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>HttpResponseCompressionFilter</filter-name>
        <url-pattern>/service/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>XHTMLMIMEFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <servlet>
        <servlet-name>MessageReceiver</servlet-name>
        <servlet-class>xmlhttp.framework.MessageReceiverServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>MessageReceiver</servlet-name>
        <url-pattern>/service/*</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.jspx</welcome-file>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>

    <!-- Sets up the SOAP Engine and Processor(s) -->
    <listener>
        <listener-class>xmlhttp.framework.config.FrameworkSetupListener</listener-class>
    </listener>

</web-app>

Client - web.xml

<?xml version="1.0" encoding="UTF-8"?>
<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>XMLVend Client (Web Services Testing Framework)</display-name>
    <description>
        A basic web services client to perform protocol testing.
    </description>


    <!-- Global web Service Parameters (Use-Case Centric) -->
    <context-param>
        <!-- Contract (each 'operation' name maps to a 'UseCase') -->
        <param-name>service.wsdl</param-name>
        <param-value>/contract/xmlvend-full-2.1.wsdl</param-value>
    </context-param>
    <context-param>
        <!-- Views (contains files with naming convention: MyUseCase-[in|out].jspx) -->
        <param-name>service.operations.views</param-name>
        <param-value>/useCaseViews</param-value>
    </context-param>

    <!-- FIRST INSTALLATION DEFAULTS (overridden by the config file created in §xmlvend/test-client/configuration.properties) -->
    <!-- TODO: Move this to a separate XML file in the format expected by the ConfigurationServlet -->
    <context-param>
        <param-name>init.xmlvend.transport.service.url</param-name>
        <param-value>http://localhost:8080/xmlvend-server/service/</param-value>
    </context-param>
    <context-param>
        <!-- Compress all requests? -->
        <param-name>init.xmlvend.transport.compression.request</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <!-- Explicitly support compressed responses? -->
        <param-name>init.xmlvend.transport.compression.response</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>init.xmlvend.client.clientID</param-name>
        <param-value>6004708001981</param-value>
    </context-param>
    <context-param>
        <param-name>init.xmlvend.client.clientIDType</param-name>
        <!-- NOTE: The namespace prefix presented here *must* match with the prefix
         defined in the message templates -->
        <param-value>b0:EANDeviceID</param-value>
    </context-param>
    <context-param>
        <param-name>init.xmlvend.client.terminalID</param-name>
        <param-value>0000000000001</param-value>
    </context-param>
    <context-param>
        <param-name>init.xmlvend.client.terminalIDType</param-name>
        <!-- NOTE: The namespace prefix presented here *must* match with the prefix
         defined in the message templates -->
        <param-value>b0:EANDeviceID</param-value>
    </context-param>
    <context-param>
        <!-- Automatically perform advice confirmation after each request? -->
        <param-name>init.xmlvend.advice.autoConfirm</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <!-- Automatically perform advice reversal in the case of errors? -->
        <param-name>init.xmlvend.advice.autoReversal</param-name>
        <param-value>false</param-value>
    </context-param>


    <!-- Use-case handler (controller) servlet -->
    <servlet>
        <servlet-name>UseCaseServlet</servlet-name>
        <servlet-class>za.co.eskom.nrs.xmlvend.client.UseCaseServlet</servlet-class>
    </servlet>
    <!-- Configuration view/update servlet -->
    <servlet>
        <servlet-name>ConfigurationServlet</servlet-name>
        <servlet-class>za.co.eskom.nrs.xmlvend.client.setup.ConfigurationServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>UseCaseServlet</servlet-name>
        <url-pattern>/useCase/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>ConfigurationServlet</servlet-name>
        <url-pattern>/admin/configuration</url-pattern>
    </servlet-mapping>


    <!-- Filter to make the global configuration keys available to every
    request as string attributes -->
    <filter>
        <filter-name>ConfigurationProvider</filter-name>
        <filter-class>za.co.eskom.nrs.xmlvend.client.setup.ConfigurationProviderFilter</filter-class>
    </filter>
    <!-- Filter to cater for non-conforming user agents (read: MS Internet Explorer) 
    that do not understand XHTML -->
    <filter>
        <filter-name>XHTMLMIMEFilter</filter-name>
        <filter-class>za.co.solms.web.xhtml.MIMEFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>ConfigurationProvider</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>XHTMLMIMEFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>


    <welcome-file-list>
        <welcome-file>index.jspx</welcome-file>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>


    <!-- Sets up the client at start-up (configuration, etc) -->
    <listener>
        <listener-class>za.co.eskom.nrs.xmlvend.client.setup.ClientSetupListener</listener-class>
    </listener>


    <!-- SOAP Fault Error Page -->
    <error-page>
        <exception-type>za.co.eskom.nrs.xmlvend.client.SOAPFault</exception-type>
        <location>/useCaseViews/_error-SOAPFault.jspx</location>
    </error-page>
    <!-- Any other (general) server errors -->
    <!-- error-page>
        <error-code>500</error-code>
        <location>/useCaseViews/_error-generic.jspx</location>
    </error-page-->

</web-app>

The context listener declared in the server application's web.xml seems to be expected to set up the framework on which the servlet giving you errors relies:

<!-- Sets up the SOAP Engine and Processor(s) -->
<listener>
    <listener-class>xmlhttp.framework.config.FrameworkSetupListener</listener-class>
</listener>

Having taken a look at the source code, the MessageReceiverServlet can't find a SoapEngine in the servlet context via attribute "soap.engine". This should have been put there by the FrameworkSetupListener.

There should be other exceptions showing why this failed in the application server's log (check the tomcat install directory/logs for a file called catalina.out).

Speculating, I believe this is most likely related to your question about where the WSDLs should be placed. From reading the source code the app expects (and creates if it isn't there) a folder under your home directory, so have a look in your home directory for a folder called "xmlvend" and place all the .xsd/.wsdl files in a sub folder of that "/test-server/schemas".

After doing this, restarting Tomcat should give you different results. If that doesn't work, please add some extracts (the exception stacktraces are most useful) from the tomcat logs mentioned above, they should give more clues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM