You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ian H <su...@gmail.com> on 2006/12/05 18:09:38 UTC
compiled header filter on tomcat 5.5
Hi all,
I've taken the jspbook.jar found on page two of this article:
http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html and
implement the ResponseHeaderFilter on a test server successfully using
the following in web.xml:
<filter>
<filter-name>ResponseHeaderFilter</filter-name>
<filter-class>com.jspbook.ResponseHeaderFilter</filter-class>
<init-param>
<param-name>Testingtesting</param-name>
<param-value>123</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ResponseHeaderFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
When I create a ResponseHeaderFilter.java file containing the source
from that article, omitting the package information, it compiles
without error, but does not work, with only
SEVERE: Error filterStart
5/12/2006 09:03:50 org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
that I can see that indicates a problem, in the stdout.log [I wind up
with the same problem if I put the package info back in, recompile it,
and incorporate it into jspbook.jar...I notice that the length of the
*.class files are rather different]
What should I try in order to make my own ResponseHeaderFilter.class work?
[Once that's sorted out, it should be trivial to substitute setHeader
for addHeader, allowing me to have setHeaderFilter.class and
addHeaderFilter.class]
Thank you in advance,
Ian
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: compiled header filter on tomcat 5.5
Posted by Ian H <su...@gmail.com>.
Charles, David, thank you both very much!
Bingo, compiled, and working :)
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: compiled header filter on tomcat 5.5
Posted by Ian H <su...@gmail.com>.
On 12/5/06, David Smith <dn...@cornell.edu> wrote:
> I see the prob here -- your code was compiled for java version 1.5 and
> you are using an older jvm to run tomcat. Match up and build your code
> on the same java version your server is using.
Thanks again for such quick responses!
I had thought that I'd tried compiling with the older version as well
-- obviously this didn't work as planned ;)
I'll take another run at it, trying to ensure similar versions, and
will let you know how it goes.
- Ian
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: compiled header filter on tomcat 5.5
Posted by David Smith <dn...@cornell.edu>.
I see the prob here -- your code was compiled for java version 1.5 and
you are using an older jvm to run tomcat. Match up and build your code
on the same java version your server is using. I typically have
Netbeans build to 1.4 just to stay on the safe side (plus I'm not using
any of the 1.5 new features).
--David
Ian H wrote:
> On 12/5/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
>>> SEVERE: Error filterStart
>>
>> What else is in the log? (The underlying cause usually appears _after_
>> the above somewhat misleading message.)
>
> Hi Chuck,
>
> Thank you for your quick reply!
>
> The whole stdout.log follows...(I see that for _this_ dev box, it's
> actually tomcat 5.0).:
>
> 5/12/2006 09:30:11 org.apache.coyote.http11.Http11Protocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8754
> 5/12/2006 09:30:11 org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 1000 ms
> 5/12/2006 09:30:11 org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> 5/12/2006 09:30:11 org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/5.0.27
> 5/12/2006 09:30:11 org.apache.catalina.core.StandardHost start
> INFO: XML validation disabled
> 5/12/2006 09:30:12 org.apache.catalina.startup.ContextConfig
> applicationConfig
> INFO: Missing application web.xml, using defaults only
> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/voice]
> 5/12/2006 09:30:12 org.apache.catalina.startup.ContextConfig
> applicationConfig
> INFO: Missing application web.xml, using defaults only
> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/interpimages]
>
> log4j:WARN No such property [maxBackupIndex] in
> org.apache.log4j.DailyRollingFileAppender.
> 5/12/2006 09:30:12 org.apache.catalina.core.StandardContext start
> SEVERE: Error filterStart
> 5/12/2006 09:30:12 org.apache.catalina.core.StandardContext start
> SEVERE: Context startup failed due to previous errors
> 5/12/2006 09:30:12 org.apache.catalina.core.StandardHost getDeployer
> INFO: Create Host deployer for direct deployment ( non-jmx )
> 5/12/2006 09:30:12 org.apache.catalina.core.StandardHostDeployer install
> INFO: Processing Context configuration file URL
> file:D:\web\tomcat\conf\Catalina\localhost\admin.xml
> 5/12/2006 09:30:12 org.apache.struts.util.PropertyMessageResources <init>
> INFO: Initializing, config='org.apache.struts.util.LocalStrings',
> returnNull=true
> 5/12/2006 09:30:12 org.apache.struts.util.PropertyMessageResources <init>
> INFO: Initializing, config='org.apache.struts.action.ActionResources',
> returnNull=true
> 5/12/2006 09:30:13 org.apache.struts.util.PropertyMessageResources <init>
> INFO: Initializing,
> config='org.apache.webapp.admin.ApplicationResources', returnNull=true
> 5/12/2006 09:30:14 org.apache.catalina.core.StandardHostDeployer install
> INFO: Processing Context configuration file URL
> file:D:\web\tomcat\conf\Catalina\localhost\manager.xml
> 5/12/2006 09:30:14 org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on http-8754
> 5/12/2006 09:30:14 org.apache.jk.common.ChannelSocket init
> INFO: JK2: ajp13 listening on /0.0.0.0:8009
> 5/12/2006 09:30:14 org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/31 config=d:\web\tomcat\conf\jk2.properties
> 5/12/2006 09:30:14 org.apache.catalina.startup.Catalina start
> INFO: Server startup in 2813 ms
>
>
> Seemingly of much greater value, I've found this in the localhost log:
>
> 2006-12-05 08:11:29 StandardContext[]Exception starting filter
> ResponseHeaderFilter
> java.lang.UnsupportedClassVersionError: ResponseHeaderFilter
> (Unsupported major.minor version 49.0)
> at java.lang.ClassLoader.defineClass0(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at java.security.SecureClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.access$100(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at
> org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:485)
>
> at
> org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:820)
>
> at
> org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
>
> at
> org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:803)
>
> at
> org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
>
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1327)
>
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
>
> at
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:211)
>
> at
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
>
> at
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
>
> at
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698)
>
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4349)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
> at
> org.apache.catalina.core.StandardService.start(StandardService.java:480)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)
>
>
>
> This seems to say simply that there's a version incompatibility (with
> the class version/libraries used to build it) -- is this correct?
>
> I've compiled the class using javac separately with versions 1.4
> (1_4_03) and 1.5 (1_5_10), with the same result...do you have any
> suggestions?
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: compiled header filter on tomcat 5.5
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ian H [mailto:sum.of.primes@gmail.com]
> Subject: Re: compiled header filter on tomcat 5.5
>
> This seems to say simply that there's a version incompatibility (with
> the class version/libraries used to build it) -- is this correct?
Correct - your ResponseHeaderFilter class was compiled with a 1.5 javac,
but you're trying to run it under a 1.4 JVM. If you think you
recompiled it with 1.4, check around - there's still a 1.5 class file in
the deployment directory tree.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: compiled header filter on tomcat 5.5
Posted by Ian H <su...@gmail.com>.
On 12/5/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
>> SEVERE: Error filterStart
>
> What else is in the log? (The underlying cause usually appears _after_
> the above somewhat misleading message.)
Hi Chuck,
Thank you for your quick reply!
The whole stdout.log follows...(I see that for _this_ dev box, it's
actually tomcat 5.0).:
5/12/2006 09:30:11 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8754
5/12/2006 09:30:11 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1000 ms
5/12/2006 09:30:11 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
5/12/2006 09:30:11 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.27
5/12/2006 09:30:11 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
5/12/2006 09:30:12 org.apache.catalina.startup.ContextConfig applicationConfig
INFO: Missing application web.xml, using defaults only
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/voice]
5/12/2006 09:30:12 org.apache.catalina.startup.ContextConfig applicationConfig
INFO: Missing application web.xml, using defaults only
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/interpimages]
log4j:WARN No such property [maxBackupIndex] in
org.apache.log4j.DailyRollingFileAppender.
5/12/2006 09:30:12 org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
5/12/2006 09:30:12 org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
5/12/2006 09:30:12 org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
5/12/2006 09:30:12 org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL
file:D:\web\tomcat\conf\Catalina\localhost\admin.xml
5/12/2006 09:30:12 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
5/12/2006 09:30:12 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
5/12/2006 09:30:13 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing,
config='org.apache.webapp.admin.ApplicationResources', returnNull=true
5/12/2006 09:30:14 org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL
file:D:\web\tomcat\conf\Catalina\localhost\manager.xml
5/12/2006 09:30:14 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8754
5/12/2006 09:30:14 org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
5/12/2006 09:30:14 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=d:\web\tomcat\conf\jk2.properties
5/12/2006 09:30:14 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2813 ms
Seemingly of much greater value, I've found this in the localhost log:
2006-12-05 08:11:29 StandardContext[]Exception starting filter
ResponseHeaderFilter
java.lang.UnsupportedClassVersionError: ResponseHeaderFilter
(Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:485)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:820)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:803)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1327)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:211)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4349)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)
This seems to say simply that there's a version incompatibility (with
the class version/libraries used to build it) -- is this correct?
I've compiled the class using javac separately with versions 1.4
(1_4_03) and 1.5 (1_5_10), with the same result...do you have any
suggestions?
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: compiled header filter on tomcat 5.5
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ian H [mailto:sum.of.primes@gmail.com]
> Subject: compiled header filter on tomcat 5.5
>
> SEVERE: Error filterStart
> 5/12/2006 09:03:50 org.apache.catalina.core.StandardContext start
> SEVERE: Context startup failed due to previous errors
What else is in the log? (The underlying cause usually appears _after_
the above somewhat misleading message.)
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org