RE: My small, simple problem continued... (null container for my valve)
All right, I think I figured it out, and it seems a little strange. I was checking to see what the container for my valve was, in the _constructor_...the constructor is getting called before any of the heirarchy tree is built, it seems. Does Catalina load up components and run constructors in-order, rather than pre-order? One odd question, though...when IS the invoke method of a valve called? -KSH -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 5:57 PM To: [EMAIL PROTECTED] Subject: Re: My small, simple problem continued... (null container for my valve) Oh, WOW. It did work, and I didn't even have to modify Catalina's startup classpath. I had tried putting the class under common\lib and server\lib, but I didn't know that common\classes would work. But now I've got another problem... In the lib folders, you can only put jars. Un-jarred classes should be in the classes folders. That's mentioned in the CL docs. The best place to put your valve here is in server/classes/ Again, I have this barebones valve class I wrote, and I've gotten it to load up without exception in Catalina. Now, oddly enough, I find that my valve has a null container, even though its nested in a context in my server.xml: Context className=org.apache.catalina.core.StandardContext path=/ debug=0 docBase=/ reloadable=true Logger className=org.apache.catalina.logger.FileLogger verbosity=1 directory=/logs/kedlog prefix=valvetest timestamp=true / Valve className=org.apache.catalina.valvetest.KedValve / /Context Is there some initialization I need to do, or am I forgetting some tags in my server.xml? Does your valve extend ValveBase or implement Contained ? Remy
RE: My small, simple problem continued... (null container for my valve)
Forget the last question. I'm finding that I'm rising to new levels of stupidity. :)
RE: My small, simple problem continued... (null container for my valve)
On Tue, 10 Jul 2001, Kedar Hirve wrote: All right, I think I figured it out, and it seems a little strange. I was checking to see what the container for my valve was, in the _constructor_...the constructor is getting called before any of the heirarchy tree is built, it seems. Does Catalina load up components and run constructors in-order, rather than pre-order? For the record, Catalina assumes that all components can be instantiated dynamically with newInstance(); then initialized by having the appropriate setXxxx methods called; and finally (if it implements Lifecycle) then start() will be called. Therefore, testing for stuff in the constructor is not going to work. One odd question, though...when IS the invoke method of a valve called? It is called once per request. If you nest it inside a Context, as your example indicates, then every request for that webapp will flow through your Valve, but no request for any other webapp. -KSH Craig -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 5:57 PM To: [EMAIL PROTECTED] Subject: Re: My small, simple problem continued... (null container for my valve) Oh, WOW. It did work, and I didn't even have to modify Catalina's startup classpath. I had tried putting the class under common\lib and server\lib, but I didn't know that common\classes would work. But now I've got another problem... In the lib folders, you can only put jars. Un-jarred classes should be in the classes folders. That's mentioned in the CL docs. The best place to put your valve here is in server/classes/ Again, I have this barebones valve class I wrote, and I've gotten it to load up without exception in Catalina. Now, oddly enough, I find that my valve has a null container, even though its nested in a context in my server.xml: Context className=org.apache.catalina.core.StandardContext path=/ debug=0 docBase=/ reloadable=true Logger className=org.apache.catalina.logger.FileLogger verbosity=1 directory=/logs/kedlog prefix=valvetest timestamp=true / Valve className=org.apache.catalina.valvetest.KedValve / /Context Is there some initialization I need to do, or am I forgetting some tags in my server.xml? Does your valve extend ValveBase or implement Contained ? Remy
Re: My small, simple problem continued... (null container for my valve)
Oh, WOW. It did work, and I didn't even have to modify Catalina's startup classpath. I had tried putting the class under common\lib and server\lib, but I didn't know that common\classes would work. But now I've got another problem... In the lib folders, you can only put jars. Un-jarred classes should be in the classes folders. That's mentioned in the CL docs. The best place to put your valve here is in server/classes/ Again, I have this barebones valve class I wrote, and I've gotten it to load up without exception in Catalina. Now, oddly enough, I find that my valve has a null container, even though its nested in a context in my server.xml: Context className=org.apache.catalina.core.StandardContext path=/ debug=0 docBase=/ reloadable=true Logger className=org.apache.catalina.logger.FileLogger verbosity=1 directory=/logs/kedlog prefix=valvetest timestamp=true / Valve className=org.apache.catalina.valvetest.KedValve / /Context Is there some initialization I need to do, or am I forgetting some tags in my server.xml? Does your valve extend ValveBase or implement Contained ? Remy
RE: My small, simple problem continued... (null container for my valve)
It extends ValveBase, which should implicitly make it implement Contained, I think? I just tried explicitly Contained as well, but it didn't make any difference. It still has a null container. I'm on Win 2000, running Tomcat standalone, by the way. -KSH -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 5:57 PM To: [EMAIL PROTECTED] Subject: Re: My small, simple problem continued... (null container for my valve) Does your valve extend ValveBase or implement Contained ? Remy