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 Fri, 28 Jan 2011 23:05:45 GMT
Well after playing with web.xml I got my app up and partly working in Tomcat 7.

When I go to http://localhost:7080/allMATCHWeb the default page is loaded. My properties file
is loaded and language based webpages generated, etc.

Now my issue seems to be with web services. Again the web.xml contains the following for each
webservice.

  <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-mapping>
    <servlet-name>MessageServiceServlethttp</servlet-name>
    <url-pattern>MessageService</url-pattern>
  </servlet-mapping>

Now, these work for webshpere and weblogic, so I am assuming (bad thing I know) that the same
would work for Tomcat.

The log file is producing the following when deploying the services.

INFO: Marking servlet MessageServiceServlethttp as unavailable
Jan 28, 2011 5:59:40 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /allMATCHWeb threw load() exception
java.lang.ClassCastException: com.surecomp.allMATCH.client.webservices.MessageService 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)
Jan 28, 2011 5:59:40 PM org.apache.catalina.core.ApplicationContext log

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