[Rabbit-dev] ad blocking

Robert Olofsson robert.olofsson at khelekore.org
Mon Dec 27 20:29:47 CET 2010


On Mon, 27 Dec 2010 02:56:01 -0500
Luis Soltero <lsoltero at globalmarinenet.com> wrote:

> mysql> select 1 from banedhosts where hostname='www.winaproduct.com';

Ok. 

> when i try to start rabbit I get the following error...
> Exception in thread "main" java.lang.RuntimeException: javax.naming.NotContextException: java:comp does not name a
> context, bindings: {} 
> ...
> Obviously there is some issue connecting to the database. Here are my settings from rabbit.conf
> [data_sources]
> resources=user_database,host_blocker
> 
> [rabbit.filter.SQLBlockFilter]
> resource=host_blocker

This is the first error, the resource should be:
jdbc/host_blocker

> user=xauth
> password=xxxxx
> select=select 1 from banedhosts where hostname=?
> 
> [rabbit.filter.ProxyAuth]
> cachetime=5
> allow_without_auth=(^http://(www.)?globalmarinenet.com/|^http://webmail([0-9])?.gmn-usa.com)
> authenticator=sql
> userfile=conf/allowed
> resource=user_database

Same error here, try 
resource=jdbc/user_database

> [user_database]
> class=com.mysql.jdbc.Driver
> url=jdbc:mysql://localhost:3306/xauth
> setUser=xauth
> setPassword=xxxxxxx

You do need to set the bind_name here:
bind_name=java:comp/env/jdbc/user_database

And if you set the user and password here you should not need
to set them in the SQLBlockFilter.

> [host_blocker]
> class=com.mysql.jdbc.Driver
> url=jdbc:mysql://localhost:3306/xauth
> setUser=xauth
> setPassword=xxxxx

Same problem here, you do need to specify the bind_name

> I have tried many different iterations of the above but always get the same error.  I have tried using bind_name in
> several permutations but still get the java:comp does not name a context binding error.

Odd, that should be the problem.

> I am sure I am making a simple mistake... Any pointers are greatly appreciated. I look forward to hearing back from you.

Well, now I know that the documentation needs some more explanations, thank you :-)

Good luck.
/robo



More information about the Rabbit-dev mailing list