tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Tomcat can't find my Filter
Date Sun, 04 Feb 2007 15:24:52 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Allen,

(Note that I've moved some things around in here)

aladdin wrote:
> <IfModule !mod_jk.c>
>   LoadModule jk_module "libexec/mod_jk.so"
>
>   JkWorkersFile "/etc/tomcat5.5/workers.properties"
>   JkLogFile "/usr/share/tomcat5.5/logs/mod_jk.log"
>
>   JkLogLevel emerg
> </IfModule>

This configuration should probably come before all of your <VirtualHost>
directives, though it might not matter. Note that I've moved all generic
mod_jk configuration inside the <IfModule> section. You will get fewer
errors in your log file when mod_jk is not available this way.

Let's consider this:

> <VirtualHost localhost>
>     ServerName localhost
>
>     JkMount /infoisland ajp13
>     JkMount /infoisland/* ajp13
> </VirtualHost>

For these URLs, only requests to http://localhost/infoisland will be
forwarded to Tomcat. So, if you use
http://www.infoisland.com/infoisland, you won't get what you want.

These directives should probably be inside of your <VirtualHost> for
"infoisland", along with the rest of them.

Consider modifying your configuration fort infoisland's <VirtualHost>
like this:

> <VirtualHost *:80>
> 	ServerName www.infoisland.net
> 	DocumentRoot /var/www/infoisland
> 	<Directory />
> 		Options FollowSymLinks
> 		AllowOverride None
> 	</Directory>
> 
> 	<Directory /var/www/infoisland>
> 		Options Indexes FollowSymLinks MultiViews
> 		AllowOverride None
> 		Order allow,deny
> 		allow from all
> 		# Uncomment this directive is you want to see apache2's
> 		# default start page (in /apache2-default) when you go to /
> 		#RedirectMatch ^/$ /apache2-default/
> 	</Directory>
> 
> 	ServerAdmin webmaster@localhost
> 	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> 	<Directory "/usr/lib/cgi-bin">
> 		AllowOverride None
> 		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
> 		Order allow,deny
> 		Allow from all
> 	</Directory>
> 
> 	ErrorLog /var/log/apache2/error.log
> 
> 	# Possible values include: debug, info, notice, warn, error, crit,
> 	# alert, emerg.
> 	LogLevel debug
> 
> 	CustomLog /var/log/apache2/access.log combined
> 	ServerSignature On
> 
>     Alias /doc/ "/usr/share/doc/"
>     <Directory "/usr/share/doc/">
>         Options Indexes MultiViews FollowSymLinks
>         AllowOverride None
>         Order deny,allow
>         Deny from all
>         Allow from 127.0.0.0/255.0.0.0 ::1/128
>     </Directory>
> 
>     Alias /forums "/var/www/pubhtm/forums"
>     <Directory "/var/www/pubhtm/forums">
>         Options Indexes MultiViews FollowSymLinks
>         AllowOverride None
>         Allow from all
>     </Directory>

#====================================
# Put your mod_jk configuration here:
#====================================

[pasted]

> # Java Server Pages
> JkMount /*.jsp ajp13_worker
> # JkMount /infoisland/*.jsp ajp13_worker
>
> # Servlets
> # JkMount /infoisland/login ajp13_worker
> # JkMount /infoisland/register ajp13_worker
> # JkMount /infoisland/topicsAdmin ajp13_worker
> JkMount /infoisland/* ajp13_worker
> JkMount /servlet/* ajp13_worker
> JkMount /members/* ajp13_worker
> JkMount /members/servlet/* ajp13_worker
> JkMount /*/servlet/* ajp13_worker

#====================================
# End of mod_jk configuration
#====================================

> </VirtualHost>
> And, on the app side, here's the web.xml entry for the filter:
> 
> [CODE]
>   <!-- Filters Here -->
>   <filter>
>     <filter-name>CheckUser</filter-name>
>     <filter-class>infoIsland.CheckUser</filter-class>
>     <init-param>
>       <param-name>loginPage</param-name>
>       <param-value>/login.jsp</param-value>
>     </init-param>
>   </filter>
> 
>   <filter-mapping>
>     <filter-name>CheckUser</filter-name>
>     <url-pattern>/members/*</url-pattern>
>   </filter-mapping>

It looks like this filter should only be active for URLs pointing to
/members/[anything], and not other URLs. What URL are you trying, and
what is the result?

Another quick question: It looks like you are implementing your own
authentication mechanism, and using <filter-mapping> as a crude
authorization configuration. Why not use the built-in container-managed
authentication and authorization provided by Tomcat?

Finally, it looks like your problem is a stray uppercase character in
your configuration. This:

>     <filter-class>infoIsland.CheckUser</filter-class>

Does not match this:
> and here is the WEB-INF/classes/infoisland listing, showing the CheckUser
> class:
[BOLD]-rwxr-xr-x 1 anw anw 3899 2007-02-02 18:10 CheckUser.class*[/BOLD]

You should have used "infoisland.CheckUser".

Your directory listings are inconsistent (in one place, you /do/ have
infoIsland, and in the other, you have "infoisland"). Which is it?

> SEVERE: Exception starting filter CheckUser
> java.lang.ClassNotFoundException: infoIsland.CheckUser

> I have also tried putting a infoisland.jar file in the WEB-INF/lib directory,
> with exactly the same results.

This is where your JAR file /should/ be.

What does the "package" directive say in your CheckUser.java file?

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

iD8DBQFFxfrE9CaO5/Lv0PARAmVWAJ9TF43c/1LH7UY2PugYDBWfNjmZVQCfW8En
q1+LSSD6q3uL9V5FsXcqTlE=
=3705
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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


Mime
View raw message