tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Robert.Jen...@surecomp.com>
Subject RE: deploying a war file and starting the application
Date Mon, 31 Jan 2011 14:09:16 GMT
Hello everyone, hope all is well with you this Monday...


I am trying to figure out why my web services do not work in Tomcat. I have not found useful
information on the web as most searches bring back information from much older versions of
Tomcat.

The following shows my web service code in eclipse

package com.surecomp.allMATCH.client.webservices;

import javax.jws.*;

import com.surecomp.allMATCH.client.IReasonCode;
import com.surecomp.allMATCH.client.businesslogic.ReasonCode;

@WebService(serviceName="ReasonCodeService")
public class ReasonCodeService implements IReasonCode {
        @WebMethod
        public String getReasonCodeData(String sSession, int iSiteId) {
                IReasonCode obj = (IReasonCode)ReasonCode.newInstance("");
                return obj.getReasonCodeData(sSession,iSiteId);
        }
        @WebMethod
        public String saveReasonCode(String sSession, int iSiteId, String sCode, String sDescription,
String sUser) {
                IReasonCode obj = (IReasonCode)ReasonCode.newInstance("");
                return obj.saveReasonCode(sSession, iSiteId, sCode, sDescription, sUser);
        }
        @WebMethod
        public String deleteReasonCode(String sSession, int iSiteId, int iExceptionId, String
sCode, String sDesc, String sUser) {
                IReasonCode obj = (IReasonCode)ReasonCode.newInstance("");
                return obj.deleteReasonCode(sSession, iSiteId, iExceptionId, sCode, sDesc,
sUser);
        }
        @WebMethod
        public String approveReasonCode(String sSession, int iSiteId, int iExceptionId, String
sCode, String sDesc, String sUser) {
                IReasonCode obj = (IReasonCode)ReasonCode.newInstance("");
                return obj.approveReasonCode(sSession, iSiteId, iExceptionId, sCode, sDesc,
sUser);
        }
}


Eclipse makes the war file I am using. The first item is found by help via this group is that
url-pattern must start with a slash. Not sure why Eclipse would not include the Slash as its
required. So I added them and the system initially appears to be working until I call a web
service. The following is my web xml.

<?xml version='1.0' encoding='UTF-8'?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.5" id="web-app_1">
  <display-name>allMATCHWeb</display-name>
  <servlet>
    <servlet-name>InitServlet</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.InitServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>dataextract.csv</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.InitServlet</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>LearnedExceptionServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.LearnedExceptionService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>DataExtractServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.DataExtractService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>ReportServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.ReportService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>BranchesServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.BranchesService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>ContactServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.ContactService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>ArchiveServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.ArchiveService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>CLSStatusServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.CLSStatusService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>LanguageServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.LanguageService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>TradeLocksServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.TradeLocksService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>PasswordSettingsServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.PasswordSettingsService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>BICServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.BICService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>LoginServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.LoginService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>MonitorServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.MonitorService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>BrokerServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.BrokerService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>QueueServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.QueueService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>HolidayServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.HolidayService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>CurrencyServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.CurrencyService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>OverviewServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.OverviewService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>PauseServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.PauseService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>CustomerServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.CustomerService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>MatchingLogicServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.MatchingLogicService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>MessageServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.MessageService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>LicenseUsageServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.LicenseUsageService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>UsersServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.UsersService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>HelpServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.HelpService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>LogServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.LogService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>ReasonCodeServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.ReasonCodeService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>SupportEmailServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.SupportEmailService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>NewPasswordServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.NewPasswordService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>LearnedServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.LearnedService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>CommentsServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.CommentsService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>LogoutServiceServlethttp</servlet-name>
    <servlet-class>com.surecomp.allMATCH.client.webservices.LogoutService</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>InitServlet</servlet-name>
    <url-pattern>/InitServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>dataextract.csv</servlet-name>
    <url-pattern>/dataextract.csv</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>LearnedExceptionServiceServlethttp</servlet-name>
    <url-pattern>/LearnedExceptionService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>DataExtractServiceServlethttp</servlet-name>
    <url-pattern>/DataExtractService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>ReportServiceServlethttp</servlet-name>
    <url-pattern>/ReportService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>BranchesServiceServlethttp</servlet-name>
    <url-pattern>/BranchesService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>ContactServiceServlethttp</servlet-name>
    <url-pattern>/ContactService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>ArchiveServiceServlethttp</servlet-name>
    <url-pattern>/ArchiveService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>CLSStatusServiceServlethttp</servlet-name>
    <url-pattern>/CLSStatusService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>LanguageServiceServlethttp</servlet-name>
    <url-pattern>/LanguageService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>TradeLocksServiceServlethttp</servlet-name>
    <url-pattern>/TradeLocksService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>PasswordSettingsServiceServlethttp</servlet-name>
    <url-pattern>/PasswordSettingsService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>BICServiceServlethttp</servlet-name>
    <url-pattern>/BICService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>LoginServiceServlethttp</servlet-name>
    <url-pattern>/LoginService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>MonitorServiceServlethttp</servlet-name>
    <url-pattern>/MonitorService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>BrokerServiceServlethttp</servlet-name>
    <url-pattern>/BrokerService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>QueueServiceServlethttp</servlet-name>
    <url-pattern>/QueueService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>HolidayServiceServlethttp</servlet-name>
    <url-pattern>/HolidayService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>CurrencyServiceServlethttp</servlet-name>
    <url-pattern>/CurrencyService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>OverviewServiceServlethttp</servlet-name>
    <url-pattern>/OverviewService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>PauseServiceServlethttp</servlet-name>
    <url-pattern>/PauseService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>CustomerServiceServlethttp</servlet-name>
    <url-pattern>/CustomerService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>MatchingLogicServiceServlethttp</servlet-name>
    <url-pattern>/MatchingLogicService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>MessageServiceServlethttp</servlet-name>
    <url-pattern>/MessageService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>LicenseUsageServiceServlethttp</servlet-name>
    <url-pattern>/LicenseUsageService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>UsersServiceServlethttp</servlet-name>
    <url-pattern>/UsersService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>HelpServiceServlethttp</servlet-name>
    <url-pattern>/HelpService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>LogServiceServlethttp</servlet-name>
    <url-pattern>/LogService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>ReasonCodeServiceServlethttp</servlet-name>
    <url-pattern>/ReasonCodeService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>SupportEmailServiceServlethttp</servlet-name>
    <url-pattern>/SupportEmailService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>NewPasswordServiceServlethttp</servlet-name>
    <url-pattern>/NewPasswordService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>LearnedServiceServlethttp</servlet-name>
    <url-pattern>/LearnedService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>CommentsServiceServlethttp</servlet-name>
    <url-pattern>/CommentsService</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>LogoutServiceServlethttp</servlet-name>
    <url-pattern>/LogoutService</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>login.html</welcome-file>
  </welcome-file-list>
</web-app>

When Tomcat starts each web service throws the following error. I understand that loadonstart
value of zero is default and not needed. Again, the war/web.xml is generated by eclipse.

INFO: Marking servlet ReasonCodeServiceServlethttp as unavailable
Jan 31, 2011 8:53:13 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /allMATCHWeb threw load() exception
java.lang.ClassCastException: com.surecomp.allMATCH.client.webservices.ReasonCodeService cannot
be cast to javax.servlet.Servlet
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:996)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4741)
        at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5062)
        at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5057)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

Is it a requirement for tomcat that a web service implements Servlet?

Can someone point me to a tomcat web service document or a working example. Have found several
on line that do not work (at least with tomcat 7)...

Sincerely,

Robert Jenkin
Surecomp Services, Inc.
2 Hudson Place, 4th Floor
Hoboken, NJ 07030
Skype: robert.jenkin
Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537
http://www.Surecomp.com


-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net]
Sent: Friday, January 28, 2011 2:54 PM
To: Tomcat Users List
Subject: Re: deploying a war file and starting the application

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert,

On 1/28/2011 1:09 PM, Robert.Jenkin@surecomp.com wrote:
> I have downloaded and configured Tomcat 7. All appears to be working.

Glad to hear it!

> I have deployed a war file that currently works with WebSphere 7 and
> WebLogic 11g.
>
> The first issue I had was with url-pattern. It appears that Tomcat
> requires they start with a slash (/). I made the change and I no longer
> receive any errors while starting Tomcat.

This is a spec requirement, not a Tomcat requirement. Other containers
may be more lenient.

> The following image shows the startup window and that my war is being
> deployed. Within the webapps directory a directory containing my webapp
> is created.

Images are stripped from posts to the list. Can you post it somewhere
online and give us a link? Or, just copy/paste any relevant content from
your screen?

> My initial servlet is called InitServlet and it is marked as
> load-on-startup (please see following image) .

Ditto.

> I have two questions
>
> 1)      If I type http://localhost:7080/allMATCHWeb in to a browser
> shouldn’t see this login.html page? I don’t… however I can access it by
>  http://localhost:7080/allMATCHWeb/login.html

You'll have to provide your web.xml for us to know when you need
authentication challenges. Are you using container-managed authentication?

> 2)      The load-on-start InitServlet class is not being executed as I
> have no logs generated or any other startup items handled, any ideas?

Again, including web.xml should help. Note that using an "InitServlet"
hasn't been recommended since the addition of the ServletContextListener
interface a long time ago.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1DHsYACgkQ9CaO5/Lv0PBhSQCeNtR93FGfQecpwJ/n02ioUhpP
x2MAn2WmpQ0vzJ3YAbrMQrE9SnMmOq++
=WYyb
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


This mail was sent via Mail-SeCure System.
Mime
View raw message