tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Coward" <ken.cow...@blastradius.com>
Subject RE: Overriding the default servlet
Date Tue, 29 Jun 2004 16:31:21 GMT
Thanks for the response.

I can certainly do that but then I don't get access to the
implementation provided by the DefaultServlet.
I'll check into the filters.

Cheers
Ken



-----Original Message-----
From: Bill Barker [mailto:wbarker@wilshire.com]
Sent: Monday, June 28, 2004 10:14 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Overriding the default servlet


Now that is one sick puppy :(.

You don't have to touch $CATALINA_HOME/conf/web.xml to override the
default
servlet.  If you have any servlet in your apps web.xml file with a
mapping
to <url-pattern>/</url-pattern>, the Tomcat will replace it's default
servlet with yours.

You should also strongly consider using a Filter to do what you want, if
all
you want is to set some headers.

"Ken Coward" <ken.coward@blastradius.com> wrote in message
news:CACC1DF66D42D511A734009027DE2B01084A2D9C@yoda.radius.ad...
I would like to replace the defaultServlet for image files within my web
application.
I want to set the "Expires" header to some date in the future to take
advantage of the
client cache.

I modified the server web.xml (jakarta-tomcat-4.1.24\conf) by commenting
out
the existing declaration and then added
a declaration in my application's web.xml to a derived class. However,
Tomcat throws exceptions on startup (shown below).

Is there some otherway I'm supposed to override the DefaultServlet ?

Cheers
Ken


SEVERE: Caught exception executing
org.apache.tomcat.util.net.TcpWorkerThread@c0
c8b5, terminating thread
java.lang.ExceptionInInitializerError
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.init(
Http11Protocol.java:355)
        at
org.apache.tomcat.util.net.TcpWorkerThread.getInitData(PoolTcpEndpoin
t.java:517)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:614)
        at java.lang.Thread.run(Thread.java:536)
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.Class
CastException
        at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)

        at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:345)

        at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
        at
org.apache.coyote.http11.Http11Processor.<clinit>(Http11Processor.jav
a:207)
        ... 4 more
Caused by: java.lang.ClassCastException
        at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:554)

        ... 7 more
Jun 28, 2004 3:33:25 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8443
Jun 28, 2004 3:33:25 PM org.apache.jk.server.JkMain newHandler
SEVERE: Can't create request
java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
        at org.apache.jk.server.JkMain.start(JkMain.java:341)
        at
org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
        at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1141)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.Class
CastException
        at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)

        at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:345)

        at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
        at
org.apache.jk.common.HandlerRequest.<clinit>(HandlerRequest.java:97)
        ... 16 more
Caused by: java.lang.ClassCastException
        at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:554)

        ... 19 more
Jun 28, 2004 3:33:25 PM org.apache.jk.server.JkMain newHandler
SEVERE: Can't create channelSocket
java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
        at org.apache.jk.server.JkMain.start(JkMain.java:341)
        at
org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
        at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1141)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.Class
CastException
        at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)

        at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:345)

        at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
        at
org.apache.jk.common.ChannelSocket.<clinit>(ChannelSocket.java:100)
        ... 16 more
Caused by: java.lang.ClassCastException
        at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:554)

        ... 19 more
Jun 28, 2004 3:33:25 PM org.apache.jk.server.JkMain newHandler
SEVERE: Can't create channelSocket
java.lang.NoClassDefFoundError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
        at org.apache.jk.server.JkMain.processProperty(JkMain.java:537)
        at
org.apache.jk.server.JkMain.processProperties(JkMain.java:505)
        at org.apache.jk.server.JkMain.start(JkMain.java:346)
        at
org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
        at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1141)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Jun 28, 2004 3:33:25 PM org.apache.jk.server.JkMain newHandler
SEVERE: Can't create channelSocket
java.lang.NoClassDefFoundError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
        at org.apache.jk.server.JkMain.processProperty(JkMain.java:537)
        at
org.apache.jk.server.JkMain.processProperties(JkMain.java:505)
        at org.apache.jk.server.JkMain.start(JkMain.java:346)
        at
org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
        at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1141)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Jun 28, 2004 3:33:25 PM org.apache.jk.server.JkMain newHandler
SEVERE: Can't create channelSocket
java.lang.NoClassDefFoundError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
        at org.apache.jk.server.JkMain.processProperty(JkMain.java:537)
        at
org.apache.jk.server.JkMain.processProperties(JkMain.java:505)
        at org.apache.jk.server.JkMain.start(JkMain.java:346)
        at
org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
        at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1141)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Jun 28, 2004 3:33:25 PM org.apache.jk.server.JkMain newHandler
SEVERE: Can't create channelSocket
java.lang.NoClassDefFoundError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
        at org.apache.jk.server.JkMain.processProperty(JkMain.java:537)
        at
org.apache.jk.server.JkMain.processProperties(JkMain.java:505)
        at org.apache.jk.server.JkMain.start(JkMain.java:346)
        at
org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
        at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1141)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Jun 28, 2004 3:33:25 PM org.apache.jk.server.JkMain newHandler
SEVERE: Can't create channelSocket
java.lang.NoClassDefFoundError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
        at org.apache.jk.server.JkMain.processProperty(JkMain.java:537)
        at
org.apache.jk.server.JkMain.processProperties(JkMain.java:505)
        at org.apache.jk.server.JkMain.start(JkMain.java:346)
        at
org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
        at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1141)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Jun 28, 2004 3:33:25 PM org.apache.jk.server.JkMain newHandler
SEVERE: Can't create channelSocket
java.lang.NoClassDefFoundError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at org.apache.jk.server.JkMain.newHandler(JkMain.java:556)
        at org.apache.jk.server.JkMain.processProperty(JkMain.java:537)
        at
org.apache.jk.server.JkMain.processProperties(JkMain.java:505)
        at org.apache.jk.server.JkMain.start(JkMain.java:346)
        at
org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:169)
        at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1141)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Jun 28, 2004 3:33:26 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/161
config=C:\jakarta-tomcat-4.1.24\bin\..\conf\jk
2.properties
Jun 28, 2004 3:33:26 PM
org.apache.tomcat.util.threads.ThreadPool$ControlRunnabl
e run
SEVERE: Caught exception executing
org.apache.tomcat.util.net.TcpWorkerThread@13
fba1, terminating thread
java.lang.NoClassDefFoundError
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.init(
Http11Protocol.java:355)
        at
org.apache.tomcat.util.net.TcpWorkerThread.getInitData(PoolTcpEndpoin
t.java:517)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:614)
        at java.lang.Thread.run(Thread.java:536)




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

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


Mime
View raw message