RE: modifying shutdown behaviour?

2003-11-13 Thread Patrick Herrera
Hi all,

I would like to implement a ServletContextListener, but I can't find an
example of the tags I need to add to my web.xml file to register a class as
a listener.

Can anyone point me in the direction of an example?

Thanks,

Patrick

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 28 October 2003 1:16 AM
To: Tomcat Users List
Subject: RE: modifying shutdown behaviour?


Howdy,

 When the $CATALINA_HOME/bin/shutdown.sh script is called I would like
a
 particular web application to release its resources cleanly and
perform
tidy
 
  You could implement a ServletContextListener. The
contextDestroyed()
method
  will be called when your application is about to be removed.

If you have a servlet which initializes resource for your context (like
an InitServlet), you can simply implemnent the destroy method to
release your resources.

This may be easier than writing a ServletContextListener, and has fewer
moving parts.

I would strongly disagree ;)  The container is free to destroy and
reload any servlet, including load-on-startup servlets, at any time it
deems such action necessary.

If you need something done on shutdown or startup or both, it's much
cleaner to write a listener for that purpose than a servlet, for
multiple reasons: 
- The footprint of a servlet in memory is bigger
- Another servlet adds to request mapping overhead, reducing performance
- Servlets are not supposed to be written only for init/destroy
functionality, ServletContextListeners are expressly designed for this
purpose
- It's a lot easier to mess up thread-safety in a servlet (which of
course may have multiple instances in memory) than in a listener

The moving parts claim you make -- I'm not sure I understand that.  Mind
elaborating? ;)

Yoav Shapira



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Mapping Apache virtual hosts to Tomcat web applications

2003-10-29 Thread Patrick Herrera
Hi,

I am using mod_jk to connect Apache 1.3 to Tomcat 4.1.  I have the two
working together fine, but I want to know if I can map a specific virtual
host to a specific web application? In other words can I access 2 Tomcat
applications:

http://example.com:8080/greensite/index.jsp
http://example.com:8080/goldsite/index.jsp

as www.geensite.com/index.jsp and www.goldsite.com/index.jsp respectively?.
It appears that you can only map to the root of the Tomcat application
directory, meaning I will have to access them as
www.greensite.com/greensite/index.jsp for example.

I have looked through the HOWTO
(http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html),
but I am beginning to suspect that this is only possible using JK2, and no
facility exists in JK for this level of control.

Is any of this possible using mod_jk?  Otherwise I may just look at
installing Apache 2 and mod_jk2 instead.

Thanks,

Patrick

Little Devil Media
Level 2 - 83 Salamanca Place,
Hobart, Tasmania
Australia 7004

Phone (+61 3) 6224 3535
Facsimile (+61 3) 6224 3545

Internet:  http://www.littledevil.com.au 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problem with workers.properties and Apache 1.3.28

2003-10-29 Thread Patrick Herrera
I had a similar problem today.  My workers file definitely existed but I kept 
getting 'no such file' errors.
It turned out I had the JkWorkersFile directive defined inside a VirtualHost 
container.  Moving it outside solved the problem.

Patrick


On Wed, 29 Oct 2003 09:01 pm, Alexander Prohorenko wrote:
 Hello,

 I can't get it run guys.

 That's what I have there:

 [Wed Oct 29 02:36:35 2003] [error] Error while opening the workers, jk will
 not work

 [Wed Oct 29 02:36:36 2003] [info] mod_unique_id: using ip addr
 192.168.185.115 [Wed Oct 29 02:36:37 2003] [info] (2)No such file or
 directory: make_sock: for port 443, setsockopt: (SO_ACCEPTFILTER) [Wed Oct
 29 02:36:37 2003] [info] (2)No such file or directory: make_sock: for port
 80, setsockopt: (SO_ACCEPTFILTER) [Wed Oct 29 02:36:37 2003] [error] (2)No
 such file or directory: Error while opening the workers, jk will not work

 [Wed Oct 29 02:36:37 2003] [info] mod_unique_id: using ip addr
 192.168.185.115 [Wed Oct 29 02:36:38 2003] [notice] Apache/1.3.28 (Unix)
 PHP/4.1.2 mod_ssl/2.8.15 OpenSSL/0.9.7a configured -- resuming normal
 operations [Wed Oct 29 02:36:38 2003] [info] Server built: Aug  4 2003
 00:42:33 [Wed Oct 29 02:36:38 2003] [notice] Accept mutex: flock (Default:
 flock)


 However, everything exists.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]