Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread Lyallex
How about creating a SessionListener

class SomeSessionListener implements HttpSessionListener ...

Register it in web.xml

in the sessionCreated method of your listener get a reference to the
new session from the HttpSessionEvent you can now access the
getLastAccessedTime(), maybe store the refs in some singleton
accessible from the context and so some stuff in your TimerTask ...

Just an idea if you like messing about with stuff, nothing to do with
ManagerBase though so I bet there is a better way of doing it.

Rgds
Duncan

On 9/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 We have tomcat configured to allow users sessions to stay alive for 12
 hours. This is because this is how they like to work, login once at the
 start of the day and shutdown at the end of the day.

 I have a need to track their actual activity, like a concurrent license
 tool, and thought the best way of doing this would be to have a servlet
 start a timer at server startup, this servlet could then poll all the
 active sessions at a set interval and check the  getLastAccessedtime()
 method, building up a view of the actual activity.

 Am I going about this in the right way?

 If I am how do I access all the currently active sessions from a servlet?
 It looks like if I can gain access to the servers engine/context I could
 access all sessions via the ManagerBase class but I do not know how to do
 this.

 Thanks Gary
 _
 This e-mail transmission and any attachments to it are intended solely for
 the use of the individual or entity to whom it is addressed and may contain
 confidential and privileged information.  If you are not the intended
 recipient, your use, forwarding, printing, storing, disseminating,
 distribution, or copying of this communication is prohibited.  If you
 received this communication in error, please notify the sender immediately
 by replying to this message and delete it from your computer.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread gary . l . johnstone


We have tomcat configured to allow users sessions to stay alive for 12
hours. This is because this is how they like to work, login once at the
start of the day and shutdown at the end of the day.

I have a need to track their actual activity, like a concurrent license
tool, and thought the best way of doing this would be to have a servlet
start a timer at server startup, this servlet could then poll all the
active sessions at a set interval and check the  getLastAccessedtime()
method, building up a view of the actual activity.

Am I going about this in the right way?

If I am how do I access all the currently active sessions from a servlet?
It looks like if I can gain access to the servers engine/context I could
access all sessions via the ManagerBase class but I do not know how to do
this.

Thanks Gary
_
This e-mail transmission and any attachments to it are intended solely for
the use of the individual or entity to whom it is addressed and may contain
confidential and privileged information.  If you are not the intended
recipient, your use, forwarding, printing, storing, disseminating,
distribution, or copying of this communication is prohibited.  If you
received this communication in error, please notify the sender immediately
by replying to this message and delete it from your computer.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Changing ROOT context

2007-09-18 Thread Waseem Azhar
Just open your server.xml  add line Context path= docBase=your-app-name
debug=99 reloadable=true/ in the next line of your host configuration

example :

Host name=localhost appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Context path= docBase=your-app-name debug=99 reloadable=true/

Thats it! you would found your application the default app , you can access
it as http://your-host-name/

Cheers.
-Azhar



On 9/16/07, FastGorilla [EMAIL PROTECTED] wrote:


 Hi,

 I have a problem with changing the default ROOT context to something else
 (myroot).


  Specs 
 -Windows Vista
 -Tomcat 6.0.14 (latest)


  Problem 
 I want the following directory to be the ROOT context:
 $CATALINA_HOME/webapps/myroot

 So that http://localhost/test.txt is directly mapped to
 $CATALINA_HOME/webapps/myroot/test.txt

 And I do not want any other directory than myroot to exist in
 $CATALINA_HOME/webapps


  What I have tried 
 Modifing the host-tag in server.xml to:

 Host name=localhost  appBase=webapps
 Context docBase=myroot path=/Context
 /Host

 , solves the problem. But the Tomcat 6 docs[1] specify that it is NOT
 recommended to put context-tags in server.xml. So I want to put the
 context-tags elsewhere.

 I tried to put the context-tag (above) in the file
 $CATALINA_HOME/conf/catalina/localhost/ROOT.xml to make myroot the default
 web application (as is told in [1]). But then I get the error:

 16-sep-2007 15:31:34 org.apache.catalina.startup.HostConfigdeployDescriptor
 WARNING: A docBase D:\Apache Software
 Foundation\apache-tomcat-6.0.14\webapps\myroot inside the host appBase has
 been specified, and will be ignored
 16-sep-2007 15:31:34 org.apache.catalina.core.StandardContextresourcesStart
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base D:\Apache Software
 Foundation\apache-tomcat-6.0.14\webapps\ROOT does not exist or is not a
 readable directory

 In the webbrowser, http://localhost:8080/test.txt won't work, but
 http://localhost:8080/myroot/test.txt will...

 Somehow it keeps looking for the ROOT dir.

 How can I change ROOT to myroot, and let http://localhost:8080/test.txt be
 the url?



  Resources 
 [1] http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
 --
 View this message in context:
 http://www.nabble.com/Changing-ROOT-context-tf4461140.html#a12721557
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread gary . l . johnstone

Thanks Duncan after a quick read on session listeners that looks like it
will do the trick.

Gary

___

Gary Johnstone
Engineering IT
Cummins Turbo Technologies Ltd
+44 1484 440532




_
This e-mail transmission and any attachments to it are intended solely for
the use of the individual or entity to whom it is addressed and may contain
confidential and privileged information.  If you are not the intended
recipient, your use, forwarding, printing, storing, disseminating,
distribution, or copying of this communication is prohibited.  If you
received this communication in error, please notify the sender immediately
by replying to this message and delete it from your computer.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: grant codeBase not working for my jar

2007-09-18 Thread Sam Halliday

On 18 Sep 2007, at 03:08, Mark Thomas wrote:

I am not sure if my mail client is mangling the urls you are using but
it looks like you are using '/' characters after 'file:'


Must be your e-mail client... I've tried

jar and file (no slash after file:)
jar:file:${catalina.home}/webapps/scanner/WEB-INF/lib/scanner.jar!/-

file only (no slash after file:)
file:${catalina.home}/webapps/scanner/WEB-INF/lib/scanner.jar

and explicit path (slash after file)
file:/var/lib/tomcat5.5/webapps/scanner/WEB-INF/lib/scanner.jar

and confirmed that this is where the jar file is... but tomcat is  
still refusing to give the permissions on a per-jar basis! Maybe this  
is a bug with the Ubuntu release?


--
Sam

http://javablog.co.uk



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat configuration for customizing apps

2007-09-18 Thread Roman Agapkin

Hello people,

I would like to conifgure Tomcat for developing on Alfresco CMS 
(www.alfresco.com)


My problem is that i've got the application itself (alfresco.war)
in my tomcat webapps folder and my classes which extend the application
(for example some new modules)

I've got a 'dynamic web project' in eclipse configured with this tomcat
now if i start the server from eclipse i've got the option
to start the deployed alfresco app without my classes

or a new publish on the tomcat server, then he deletes
the alfresco folder in webapps and replaces it with the new alfresco
folder which contains just the classes from my eclipse project.
and of course there is no jsp pages (specially no index.jsp)

how should i configure tomcat that
- on startup he deploys the alfresco webapp
- he knows the path to my classes in eclipse project

thanx in advance.

best regards

Roman


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Security - implementing custom security

2007-09-18 Thread alee amin
Hi,

I was able to implement the form based tomcat security on my web app. It was
good. But because of some restriction from client i need to modify it.

The password is placed as in encryppted form in DB, so i can not rely on
tomcat authenticate method which simple select the username/password
from DB and match it. I have seen the implementation of (
org.apache.catalina.realm.JDBCRealm).

Now, what i did, i wrote a CustomRealm

package org.my.security;

import java.security.Principal;
import java.util.List;
import java.util.ArrayList;

import org.apache.catalina.realm.GenericPrincipal;
import org.apache.catalina.realm.RealmBase;



public class CustomRealm extends RealmBase{

@Override
protected String getName() {
return this.getClass().getSimpleName();
}

@Override
protected String getPassword(final String username) {
return retrieveEncryptedPassAndDecrypt(username);
}

@Override
protected Principal getPrincipal(final String username) {
final ListString roles = new ArrayListString();
roles.add(tomcat);
return new GenericPrincipal(this, username, getPassword(username),
roles);
}

@Override
public Principal authenticate(String username, String credentials) {
String serverCredentials = getPassword(username);

//credential encrypt

boolean validated;
if (serverCredentials == null)
validated = false;
else if (hasMessageDigest())
validated = serverCredentials.equalsIgnoreCase
(digest(credentials));
else
validated = serverCredentials.equals(credentials);
if (!validated) {
return null;
}
return getPrincipal(username);

}

public String retrieveEncryptedPassAndDecrypt(String username){
...
}
}


I put that file in server/lib and changed the server.xml with this entry

Realm className=org.my.security.CustomRealm debug=0 /


It works fine.

but now, when i am deploying it to application, i am wandering how would i
communicate with Database, since my DB layer is combination of Spring,
Hibernate and all daos, beans of application will not be available here in
my this class, since it's in server side - application independent.

If i put this class in application WAR file and change the server.xml file
to point that class, my server give exception at startup class not found
which is quite logical.

Now, actually what i want - is to use the Tomcat Security to match
user/password (password is encrypted form in DB - encryption done by my
application before saving). If i use my Custom Realm, then how can i access
my DB Connection classes populated by Spring/Hibernate?


cheers,
..alee
-- 
Muhammad Ali
http://techboard.wordpress.com
Software Engineer - E2ESP
muhammadaliamin(at)gmail(dot)com


Re: Tomcat Security - implementing custom security

2007-09-18 Thread Mikolaj Rydzewski

alee amin wrote:

The password is placed as in encryppted form in DB, so i can not rely on
tomcat authenticate method which simple select the username/password
from DB and match it. I have seen the implementation of (
org.apache.catalina.realm.JDBCRealm).
  
Have you tried using 'digest' attribute? It looks it could help: 
http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#JDBCRealm


--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Tomcat status

2007-09-18 Thread Andrew Hole
Is there a function to check the status of tomcat?
A simple JSP p.e., i make an http request to tomcat port, and if i
don't get response, I say that status is down. I want to create a
simple JSP resume of all tomcat instances status

  Thanks,

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat status

2007-09-18 Thread Bj
if you're using apache httpd and mod_jk in front of your tomcats, you have a
status page with a lot of information.
Also bundled with tomcat, you have the manager webapp which has a status
page.

-- 
Bj


On 9/18/07, Andrew Hole [EMAIL PROTECTED] wrote:

 Is there a function to check the status of tomcat?
 A simple JSP p.e., i make an http request to tomcat port, and if i
 don't get response, I say that status is down. I want to create a
 simple JSP resume of all tomcat instances status

   Thanks,

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




unknown protocol: httpg

2007-09-18 Thread DEMESY Nicolas

Hi,

I would like to contact httpg servers with a servlet host on a tomcat 
server and I have an error :


java.net.MalformedURLException: unknown protocol: httpg
 at java.net.URL.init(URL.java:395)
 at java.net.URL.init(URL.java:283)

when I do :
SimpleProvider p = new SimpleProvider();
p.deployTransport(httpg, new SimpleTargetedChain(new 
org.globus.axis.transport.GSIHTTPSender()));

org.globus.axis.util.Util.registerTransport();
new java.net.URL(httpg,srm-server, 1234, /srm);

It seems that the httpg registration is not done ...
I use a Tomcat 5 server,

ideas?

Thanks,
Nicolas


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Changing ROOT context

2007-09-18 Thread Caldarale, Charles R
 From: Waseem Azhar [mailto:[EMAIL PROTECTED] 
 Subject: Re: Changing ROOT context
 
 Just open your server.xml  add line Context path= 
 docBase=your-app-name debug=99 reloadable=true/

Please read the doc before responding.  Putting Context elements in
server.xml has been strongly discouraged for several years.

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problem with https and apache+httpd+tomcat

2007-09-18 Thread Christian Andersson
Hi there I have a problem with tomcat, but first version information for
some of the applications used.


Apache/2.2.3 (Mandriva Linux/PREFORK-1.1.20060mlcs4)

Apache Tomcat/6.0.13

java version 1.6.0_01
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_01-b06, mixed mode)

I have setup apache httpd to only answer on port 443 using https
and I have several virtual hosts.
one of them I have setup to use mod_jk to connect to tomcat using this
configuration
VirtualHost *:443
ServerName demo.mydomain
JkMount /* worker1
/VirtualHost

in tomcat I have only configured this single connector
Connector port=8009 protocol=AJP/1.3 secure=true scheme=https
redirectPort=443/

now, everything works allright, I can surf to the server using the
following url..

https://demo.mydomain/mywebapp/

and everything works.

HOWEVER, I have 2 problems with this setup and that is, IF I surf to the
same address but forgets to add that last /
(https://demo.mydomain/mywebapp) tomcat redirects the browser to surf to
the correct url (add the ending /) BUT the url it sends to the browser
is WRONG!!!  it is not sending https://demo.mydomain/mywebapp/ as one
could suppose, it is sending https://demo.mydomain:80/mywebapp/

(atleast that is what I suppose is happening.. sicne I cannot check what
is being sent on the Ethernet, since that is encrypted, however firefox
tries to connect to that url.)

I also got the same problem in my forms based login
when the browser is sending the login form, it gets a redirect from the
server with the port 80 instead of no port
if I remove the :80 in the url I get the real page, and I am logged in..

so somewhere (I think it is tomcat) the browser is told to go to port 80

can anyone help me with this?



-- 
Christian Andersson - [EMAIL PROTECTED]

Configuration and Collaboration for OpenOffice.org
Open Framework Systems AS http://www.ofs.no

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Tomcat status

2007-09-18 Thread Andrew Hole
Could you tell me wich page?

On 9/18/07, Bj [EMAIL PROTECTED] wrote:
 if you're using apache httpd and mod_jk in front of your tomcats, you have a
 status page with a lot of information.
 Also bundled with tomcat, you have the manager webapp which has a status
 page.

 --
 Bj


 On 9/18/07, Andrew Hole [EMAIL PROTECTED] wrote:
 
  Is there a function to check the status of tomcat?
  A simple JSP p.e., i make an http request to tomcat port, and if i
  don't get response, I say that status is down. I want to create a
  simple JSP resume of all tomcat instances status
 
Thanks,
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Servlet Redeployment in Production

2007-09-18 Thread lightbulb432



Christopher Schultz-2 wrote:
 
 What does Tomcat do when, in production, a new version of a WAR file
 that's
 currently being accessed is deployed? I've heard generally that you don't
 enable the auto-deployment feature in production, but assume you're
 aiming
 for a five-nines environment and the requirement is hot redeployment of
 the
 application.
 
 I would argue that autodeploy doesn't help much in this case, but we'll
 stick with that assumption for this discussion.

I realize it wouldn't help for things like database changes, but what about
changes to the structure of the HttpSession map, or the cookie structure, or
something that has to do at the web application?


I'd start with org.apache.catalina.StandardContext (and, specifically,
 the reload method), since that's the thing being reloaded.

Where could I find the code where Tomcat stores its definitive list of all
the current, active HttpSessions? (Where's the structure that Tomcat adds a
newly created HttpSession to, and from which it removes timed-out or
invalidated HttpSessions, and the code that manipulates it?)
-- 
View this message in context: 
http://www.nabble.com/Servlet-Redeployment-in-Production-tf4429878.html#a12758041
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how to obtain server ip address

2007-09-18 Thread Propes, Barry L
did you try getRemoteAddr()?



-Original Message-
From: Lilianne E. Blaze [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 18, 2007 12:08 AM
To: Tomcat Users List
Subject: Re: how to obtain server ip address


Check java.net.NetworkInterface, it lets you enumerate all interfaces
and addresses / interface. Discard loopback 127.0.0.1 and private
addresses (see rfc 1918), with any luck there should be one address
remaining. Of course, that is assuming your machine is directly exposed
to the internet.

http://java.sun.com/j2se/1.5.0/docs/api/java/net/NetworkInterface.html
http://www.ietf.org/rfc/rfc1918.txt

Or you could use ServletRequest.getLocalAddr(), it's simpler but
obviously unavailable until someone actually connects to your server, so
it's unusable with any kind of eager initialization.

Greetings, Lilianne E. Blaze

Waseem Azhar wrote:
 Hi,

 How do I obtain the IP address of the machine (where the tomcat tomcat
 server in running) ? My web app is deployed on tomcat server and I want to
 know the Ip address of the server in my application.

 Thanks in advance.

 -Azhar

   


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: unknown protocol: httpg

2007-09-18 Thread David Delbecq
Hello Nicolas,

java.net.URL is trying to instanciate a handler for protocol httpg and
fails. Looking at your code, i suppose
org.globus.axis.util.Util.registerTransport() is
supposed to add an handler. This works find in standalone application,
but in J2EE environment the URL class can not see classes inside your
webapp (see tomcat classloader documentation on website for
explanations) and as such can not instanciate them.

I recommend you try using the following URL form:
new URL(URL context, String spec, URLStreamHandler handler)
and you provide a URLStreamHandler for globus.

Another, but ugly, solution is to put globus classes inside system
classloader.

En l'instant précis du 18/09/07 14:42, DEMESY Nicolas s'exprimait en ces
termes:
 Hi,

 I would like to contact httpg servers with a servlet host on a tomcat
 server and I have an error :

 java.net.MalformedURLException: unknown protocol: httpg
  at java.net.URL.init(URL.java:395)
  at java.net.URL.init(URL.java:283)

 when I do :
 SimpleProvider p = new SimpleProvider();
 p.deployTransport(httpg, new SimpleTargetedChain(new
 org.globus.axis.transport.GSIHTTPSender()));
 org.globus.axis.util.Util.registerTransport();
 new java.net.URL(httpg,srm-server, 1234, /srm);

 It seems that the httpg registration is not done ...
 I use a Tomcat 5 server,

 ideas?

 Thanks,
 Nicolas


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-- 
http://www.noooxml.org/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk and Apache httpd 2.2 [UPDATE]

2007-09-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

All,

I changed my JkLogLevel to debug and here's the output I get when I
request a URL that should be mapped to a Tomcat instance:

[Tue Sep 18 10:52:36.989 2007] [4317:3080799920] [debug]
map_uri_to_worker::jk_uri_worker_map.c (597): Attempting to map URI
'/diagnosis/index.do' from 0 maps
[Tue Sep 18 10:52:36.989 2007] [4317:3080799920] [debug]
map_uri_to_worker::jk_uri_worker_map.c (597): Attempting to map URI
'/diagnosis/index.do' from 0 maps

The URI was, in fact, /diagnosis/index.do, and I have the following on
my virtual host config file (which I know is being loaded, since it
contains the LoadModule line required to load mod_jk, and if I comment
that LoadModule line out, a syntax check fails on that file):

VirtualHost *:80
ServerName [my server name]
DocumentRoot /home/[foo]/does-not-exist (which, in fact, does
not exist)
DirectoryIndex index.shtml
.
.
.

Alias /diagnosis [TOMCAT_HOME]/webapps/diagnosis
JkMount /diagnosis/*.do worker3
(among others)
/VirtualHost

worker3 is defined as follows (probably with unnecessary
configuration, but this is an old configuration that has always worked,
so I haven't changed anything in a long time):

worker.worker3.type=ajp13
worker.worker3.host=localhost
worker.worker3.port=8385
worker.worker3.lbfactor=50
worker.worker3.connection_pool_size=1
worker.worker3.connection_pool_timeout=60
worker.worker3.socket_keepalive=1
worker.worker3.socket_timeout=300

... and I'm sure that worker3 is enabled:

worker.list=worker1, worker2, worker3, worker4, worker5, worker6, worker7

I can find no errors in any of Apache's log files. Any ideas?

Thanks,
- -chris

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

iD8DBQFG7+de9CaO5/Lv0PARAqemAJ9OKqO79k6Rwje7Y73tpNkTu6HjSACgtZyU
yATEJXBA53gJaxG28sJtil4=
=GGZK
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: grant codeBase not working for my jar

2007-09-18 Thread Mark Thomas
Sam Halliday wrote:
 and confirmed that this is where the jar file is... but tomcat is still
 refusing to give the permissions on a per-jar basis. Maybe this is a bug
 with the Ubuntu release?

This is all standard JVM stuff. The only bit Tomcat adds is the odd
PrivilegedAction but that won't stop things working.

I would suggest a simple test case that you run with
-Djava.security.debug=all try and get that working.

You don't want to use that option with Tomcat, you'll have far too much
information to look at.

Mark

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Servlet Redeployment in Production

2007-09-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

lb,

lightbulb432 wrote:
 
 
 Christopher Schultz-2 wrote:
 I would argue that autodeploy doesn't help much in this case, but we'll
 stick with that assumption for this discussion.
 
 I realize it wouldn't help for things like database changes, but what about
 changes to the structure of the HttpSession map, or the cookie structure, or
 something that has to do at the web application?

I just meant that auto-deployment doesn't really help with uptime.

I'm not sure I understand your follow-up question.

 I'd start with org.apache.catalina.StandardContext (and, specifically,
 the reload method), since that's the thing being reloaded.
 
 Where could I find the code where Tomcat stores its definitive list of all
 the current, active HttpSessions? (Where's the structure that Tomcat adds a
 newly created HttpSession to, and from which it removes timed-out or
 invalidated HttpSessions, and the code that manipulates it?)

You should just download the code and start looking around. It's not
hard to follow the action starting from what happens when the request
has getSession() called.

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

iD8DBQFG7+v39CaO5/Lv0PARAjpaAJ9qSQj2cPj/8Fkq4x0m/jDVdwMNUQCfUCKX
zbmwNMNJxlZs3lNXwtXS7+M=
=K2AX
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Distributed web services: Tomcat or Jboss?

2007-09-18 Thread Matthias Klein
Unless EJB would provide a significant advantage in this type of project, I
was not planning on using EJB.
But would they offer advantages?
In case I can do without - do you have any recommendation as for container,
frameworks, tools?
Thanks
Matt
 

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
Sent: Dienstag, 18. September 2007 17:26
To: Tomcat Users List
Subject: Re: Distributed web services: Tomcat or Jboss?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthias,

Matthias Klein wrote:
 As I am starting a new project, I am unsure whether to use Tomcat/Axis 
 or the Jboss product line. Any idea?

Do you need EJBs? If you do, then you'll need JBoss.

If you don't need EJBs, I would recommend not using a full EJB server.

- -chris

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

iD8DBQFG7+4P9CaO5/Lv0PARAk4TAJ9L/pHXYLA+V3JQ2NIfL8dSHyJHSgCgjASN
kjupf2F0dGd8/vi4IlVNVAo=
=IEqE
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Distributed web services: Tomcat or Jboss?

2007-09-18 Thread Matthias Klein
Good points, thanks
 

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
Sent: Dienstag, 18. September 2007 17:39
To: Tomcat Users List
Subject: Re: Distributed web services: Tomcat or Jboss?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mattias,

Matthias Klein wrote:
 Unless EJB would provide a significant advantage in this type of 
 project, I was not planning on using EJB.
 But would they offer advantages?

I personally dislike EJBs, but my experience was a long time ago...
perhaps things have improved.

 In case I can do without - do you have any recommendation as for 
 container, frameworks, tools?

I believe JBoss uses Tomcat as the servlet container, so JBoss basically
builds on Tomcat to provide and EJB container, MQ-style messaging, and
(probably) SOAP services (possibly even using AXIS).

If I were doing it, I'd stick to Tomcat, but that's mostly because I know it
best. I can configure Tomcat to do exactly what I want and add services
(such as AXIS) as needed, rather than removing them which is what I imagine
you'd have to do with JBoss.

It just seems that JBoss offers many services you don't need, so why bother
with the added complexity?

- -chris

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

iD8DBQFG7/EI9CaO5/Lv0PARAsRyAJ90rJlx2VyJUxsat+m9ojLtH6gb8gCgoH/Y
TA17Yo4twOrBr5b+7+KDdz4=
=euh+
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Distributed web services: Tomcat or Jboss?

2007-09-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mattias,

Matthias Klein wrote:
 Unless EJB would provide a significant advantage in this type of project, I
 was not planning on using EJB.
 But would they offer advantages?

I personally dislike EJBs, but my experience was a long time ago...
perhaps things have improved.

 In case I can do without - do you have any recommendation as for container,
 frameworks, tools?

I believe JBoss uses Tomcat as the servlet container, so JBoss basically
builds on Tomcat to provide and EJB container, MQ-style messaging, and
(probably) SOAP services (possibly even using AXIS).

If I were doing it, I'd stick to Tomcat, but that's mostly because I
know it best. I can configure Tomcat to do exactly what I want and add
services (such as AXIS) as needed, rather than removing them which is
what I imagine you'd have to do with JBoss.

It just seems that JBoss offers many services you don't need, so why
bother with the added complexity?

- -chris

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

iD8DBQFG7/EI9CaO5/Lv0PARAsRyAJ90rJlx2VyJUxsat+m9ojLtH6gb8gCgoH/Y
TA17Yo4twOrBr5b+7+KDdz4=
=euh+
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: With JK 1.2.x using route causes problems with redirect?

2007-09-18 Thread Henk Fictorie


Brian.Horblit wrote:
 
  
 # Set w4 properties 
 worker.w4.socket_keepalive=1
 worker.w4.socket_timeout=20
 worker.w4.reply_timeout=2
 worker.w4.retries=2
 worker.w4.connection_pool_timeout=60
 worker.w4.type=ajp13
 worker.w4.host=localhost
 worker.w4.port=8034
 worker.w4.lbfactor=1
 worker.w4.route=tc4
 worker.w3.domain=d34
 
 

I guess this is a typo, it should be worker.w4.domain=d34

regards Henk
-- 
View this message in context: 
http://www.nabble.com/With-JK-1.2.x-using-route-causes-problems-with-redirect--tf4467606.html#a12759948
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: With JK 1.2.x using route causes problems with redirect?

2007-09-18 Thread Rainer Jung

Henk Fictorie wrote:


Brian.Horblit wrote:
 
# Set w4 properties 
worker.w4.socket_keepalive=1

worker.w4.socket_timeout=20
worker.w4.reply_timeout=2
worker.w4.retries=2
worker.w4.connection_pool_timeout=60
worker.w4.type=ajp13
worker.w4.host=localhost
worker.w4.port=8034
worker.w4.lbfactor=1
worker.w4.route=tc4
worker.w3.domain=d34




I guess this is a typo, it should be worker.w4.domain=d34

regards Henk


And I already wondered what the heck was wrong with domains. Thanks! So 
Brian: give it another try with the fixed typo. I don't see anything 
else wrong in this configuration.


Regards

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 6 Admin Application

2007-09-18 Thread Fredy Provoste
Hi there, i want to know if there's any admin application (like in Tomcat 5)
for Tomcat 6 available??, i've lookin in tomcat 6 source code with no luck

Thanks


Re: mod_jk and Apache httpd 2.2 [UPDATE]

2007-09-18 Thread Rainer Jung

Hi Chris,

Christopher Schultz wrote:

Strange... it looks like mod_jk is initializing itself more than once. I
even tried the binary available online for Apache httpd 2.2.4 (2.2.6
wasn't available), and it appears to be giving me the same results.


I would guess: the redundant log lines come from virtual servers. Most 
of mod_jk Apache httpd configuration is now well-behaved w.r.t. virtual 
servers, i.e. you can configure most items differently for each vhost. 
For example log file, JkOptions etc. Some exceptions exist, like 
JkWorkersFile or JkShmFile.


JkMount is not inherited automatically. I forgot, if they were for httpd 
1.3 and maybe around JK 1.2.15 for httpd 2.x. If you don't want to copy 
the JkMounts to each VHost and instead want to inherit them from a less 
special VHost to a more special vhost, you need to set JkMountCopy.


Page

http://tomcat.apache.org/connectors-doc/reference/apache.html

says about JkMountCopy:

===
If this directive is set to On in some virtual server, the mounts from 
the global server will be copied to the virtual server, more precisely 
all mounts defined by JkMount or JkUnMount. The Mounts defined by 
JkMountFile and JkAutoAlias will only be inherited, if the VirtualHost 
does not define it's own JkMountFile or JkAutoAlias.

This directive is only allowed inside VirtualHost.
The default is Off.
===

The fact, that mounts are VHost-specific also has another consequence 
(unfortunately): the requests to the status worker are run in the 
context of the VHost that handles the request. The status worker can 
then only see the mounts defined for this vhost and show them on the 
results page.


So if you have different vhosts and want to check, which mounts are 
active in which vhost, you can define a status worker and call the url 
of the status worker in each vhost.



Just to add more information, I'm running Apache httpd 2.2.6 with no
options set for the MPM that I know of, and I can see multiple httpd
processes when I run 'ps', so I'd imagine that I'm using the prefork MPM.


You can find out about your MPM via httpd -V. It contains the name of 
the MPM in one of the first lines of the output.


Concerning 2.0 vs. 2.2: yes, the binary build is different, but the 
module code is the same, because the2.0 and 2.2 APIs are very close. 
That's the reson, the build result is in the apache-2.0 directory and we 
don't have an apache-2.2 directory.


Concerning the workers config:

worker.worker3.connection_pool_size=1

Don't do that unless you are totally convinced you really want it :)

Concerning double log lines:

There are several aspects about double. First during Apache httpd 
startup in fact initialization is done twice. This is standard and has 
nothing to do with mod_jk. In your appended log file this relates to a 
block of log lines contained process and thread ids [4723:3081406128] 
and after that the same log lines for [4724:3081406128].


The unusual thing is, that during each of the two passes, again lines 
are logged multiple times. Some if this is OK, because of the assumed 
vhost situation. Some of those are a little strange:


For example

[Tue Sep 18 11:05:24.002 2007] [4723:3081406128] [debug]
open_jklog::mod_jk.c (2652): log time stamp format is '[%a %b %d 
%H:%M:%S.%Q %Y] '


should only appear once for each different jk log file (JkLogFile).

So all in all something might be strange about the vhosts and the JK 
configuration. Could you post all Jk relevant configuration directives 
an their surrounding vhost structure?


Another thing: there is a non-debug startup message

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [error]
init_jk::mod_jk.c (2732): Initializing
shm:/usr/lib/apache2/logs/jk-runtime-status.4723 errno=2. Load balancing
workers will not function properly.

I don't know what erno 2 is on your platform (btw: what's your 
platform), but most likely it's No such file or directory. Ommit the 
shm: prefix and make sure the directory exists and is writable.



Below is the complete mod_jk log file I get when I start up Apache httpd
and do nothing else. This is the log output I get with the first
(failed) request:

[Tue Sep 18 11:08:37.316 2007] [4727:3081406128] [debug]
map_uri_to_worker::jk_uri_worker_map.c (597): Attempting to map URI
'/diagnosis/index.do' from 0 maps
[Tue Sep 18 11:08:37.316 2007] [4727:3081406128] [debug]
map_uri_to_worker::jk_uri_worker_map.c (597): Attempting to map URI
'/diagnosis/index.do' from 0 maps


I'm a little nervous about this child initialization after the request 
handling (new process). Just to make sure: there are no erros in the 
apache error log and no signs of core dumps? After the above lines get 
logged, the process which handled the request (pid 4727) still exists?



[Tue Sep 18 11:08:38.017 2007] [4741:3081406128] [debug]
jk_child_init::mod_jk.c (2682): Attached
shm:/usr/lib/apache2/logs/jk-runtime-status.4724
[Tue Sep 18 11:08:38.017 2007] [4741:3081406128] [debug]
jk_child_init::mod_jk.c 

Re: mod_jk and Apache httpd 2.2 [UPDATE]

2007-09-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rainer,

Thanks for the reply.

Rainer Jung wrote:
 I would guess: the redundant log lines come from virtual servers.

Okay. I don't believe I have more than one virtual server, so I would
have expected maybe a maximum of two initialized messages.

 Most
 of mod_jk Apache httpd configuration is now well-behaved w.r.t. virtual
 servers, i.e. you can configure most items differently for each vhost.
 For example log file, JkOptions etc. Some exceptions exist, like
 JkWorkersFile or JkShmFile.
 
 JkMount is not inherited automatically.

All of my JkMounts are in a single VirtualHost, and they are intended to
be accessed only through that VirtualHost.

This is a configuration that has been working, literally, for years, and
stopped working all of the sudden. I tried to downgrade to 2.0.x (on my
gentoo system using packaged apache httpd, which has always been very
good to work with) and I had dependency problems that I didn't feel like
dealing with. I'd prefer to get Apache 2.2 working properly.

 Just to add more information, I'm running Apache httpd 2.2.6 with no
 options set for the MPM that I know of, and I can see multiple httpd
 processes when I run 'ps', so I'd imagine that I'm using the prefork MPM.
 
 You can find out about your MPM via httpd -V. It contains the name of
 the MPM in one of the first lines of the output.

Yep: I'm using the prefork MPM:

# /usr/sbin/apache2 -V
Server version: Apache/2.2.6 (Unix)
Server built:   Sep 18 2007 08:55:32
Server's Module Magic Number: 20051115:5
Server loaded:  APR 1.2.8, APR-Util 1.2.8
Compiled using: APR 1.2.8, APR-Util 1.2.8
Architecture:   32-bit
Server MPM: Prefork
  threaded: no
forked: yes (variable process count)
Server compiled with
 -D APACHE_MPM_DIR=server/mpm/prefork
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=/usr
 -D SUEXEC_BIN=/usr/sbin/suexec
 -D DEFAULT_PIDLOG=/var/run/httpd.pid
 -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
 -D DEFAULT_LOCKFILE=/var/run/accept.lock
 -D DEFAULT_ERRORLOG=logs/error_log
 -D AP_TYPES_CONFIG_FILE=/etc/apache2/mime.types
 -D SERVER_CONFIG_FILE=/etc/apache2/httpd.conf
#

 Concerning 2.0 vs. 2.2: yes, the binary build is different, but the
 module code is the same, because the2.0 and 2.2 APIs are very close.
 That's the reson, the build result is in the apache-2.0 directory and we
 don't have an apache-2.2 directory.

Okay, thanks for the info. I wasn't too worried, since Apache was happy
to load the module and it looked like it was initializing properly.

 Concerning the workers config:
 
 worker.worker3.connection_pool_size=1
 
 Don't do that unless you are totally convinced you really want it :)

Heh; I'm not... like I said, this is an old configuration that has
served us well for years.

 The unusual thing is, that during each of the two passes, again lines
 are logged multiple times. Some if this is OK, because of the assumed
 vhost situation.

Gentoo does virtual hosts by having files in /etc/apache2/vhosts.d that
get loaded from httpd.conf like this:

Include /etc/apache2/vhosts.d/*.conf

My own virtual host file is called foo.conf and looks like this:
#LoadModule  jk_module /usr/lib/apache2/extra-modules/mod_jk-1.2.25.so
LoadModule  jk_module
/usr/lib/apache2/extra-modules/mod_jk-1.2.25-httpd-2.2.4.so

JkWorkersFile /etc/apache2/jk_workers.properties
JkLogFile /var/log/apache2/mod_jk.log
#JkLogLevel info
JkLogLevel debug

ServerTokens Major

VirtualHost *:80
   ... [what I posted in previous messages, including JkMounts]
/VirtualHost

 Some of those are a little strange:
 
 For example
 
 [Tue Sep 18 11:05:24.002 2007] [4723:3081406128] [debug]
 open_jklog::mod_jk.c (2652): log time stamp format is '[%a %b %d
 %H:%M:%S.%Q %Y] '
 
 should only appear once for each different jk log file (JkLogFile).
 
 So all in all something might be strange about the vhosts and the JK
 configuration. Could you post all Jk relevant configuration directives
 an their surrounding vhost structure?

The gentoo install comes with a default virtual host that basically
just sets up a standard /var/www/localhost/htdocs virtual host. It turns
on NameVirtualHost but then doesn't specify a server name, so I think it
only gets used when nothing else matches.

This is a testing server, so I don't really care that there's a useless
VirtualHost floating around.

 Another thing: there is a non-debug startup message
 
 [Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [error]
 init_jk::mod_jk.c (2732): Initializing
 shm:/usr/lib/apache2/logs/jk-runtime-status.4723 errno=2. Load balancing
 workers will not function properly.
 
 I don't know what erno 2 is on your platform (btw: what's your
 platform), but most likely it's No such file or 

Re: Tomcat 6 Exception Language

2007-09-18 Thread David Delbecq

To pass parameter to tomcat service and configure it:

http://www.google.be/search?q=tomcat6+service+parameters


Fredy Provoste a écrit :

Thak you so much Christopher, see that your information is for a Linux
Enviromente, i'm working in windows, and i have tomcat installed as service,
so the scripts shutdown and startup aren't here, i've tried to set the
enviroment variable

JAVA_OPTS=-Duser.language=en -Duser.country=US

in windows, but still exceptions come in spanish language, thank you again

Fredy

2007/9/17, Christopher Schultz [EMAIL PROTECTED]:
  

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Fredy,

Fredy Provoste wrote:


the exceptions that server
throws is in Spanish language; I wish this exception were in English
  

You need to change the value of the system property 'user.language' to
'en'. You should be able to do it like this:

$ $CATALINA_HOME/bin/shutdown.sh
$ export JAVA_OPTS=-Duser.language=en -Duser.country=US
$ $CATALINA_HOME/bin/startup.sh

Note that I also set the country; I'm not sure what the JVM would do
with a Locale of en_ES, so it's better to use en_US (or even en_GB).

- -chris

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

iD8DBQFG7rh79CaO5/Lv0PARAk3VAJ43y/edZNjMotvZAkwPZgjsFcQUQQCeMmbo
G2bKfzYMtbteMVYiBIZgomk=
=CwHK
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6 Admin Application

2007-09-18 Thread Brantley Hobbs

JMX?

I'm intrigued by your idea and would like to subscribe to your newsletter.

Is there a canned application that can use JMX to provide similar 
information as the old admin app?


Thanks,
Brantley

Mark Thomas wrote:

Fredy Provoste wrote:
  

Hi there, i want to know if there's any admin application (like in Tomcat 5)
for Tomcat 6 available??, i've lookin in tomcat 6 source code with no luck



The short version is no.

The long version is that the one in 5.5 wasn't being maintained so it
wasn't keeping up with new attributes, features etc. The intention is to
use jmx instead. You should be able to do most things this way. Anything
you can't, patches are always appreciated ;)

Mark


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk and Apache httpd 2.2 [UPDATE]

2007-09-18 Thread Rainer Jung

Going to infinity+1:


I would guess: the redundant log lines come from virtual servers.


Okay. I don't believe I have more than one virtual server, so I would
have expected maybe a maximum of two initialized messages.


See below.


All of my JkMounts are in a single VirtualHost, and they are intended to
be accessed only through that VirtualHost.

This is a configuration that has been working, literally, for years, and
stopped working all of the sudden. I tried to downgrade to 2.0.x (on my
gentoo system using packaged apache httpd, which has always been very
good to work with) and I had dependency problems that I didn't feel like
dealing with. I'd prefer to get Apache 2.2 working properly.



The unusual thing is, that during each of the two passes, again lines
are logged multiple times. Some if this is OK, because of the assumed
vhost situation.


Gentoo does virtual hosts by having files in /etc/apache2/vhosts.d that
get loaded from httpd.conf like this:

Include /etc/apache2/vhosts.d/*.conf

My own virtual host file is called foo.conf and looks like this:
#LoadModule  jk_module /usr/lib/apache2/extra-modules/mod_jk-1.2.25.so
LoadModule  jk_module
/usr/lib/apache2/extra-modules/mod_jk-1.2.25-httpd-2.2.4.so

JkWorkersFile /etc/apache2/jk_workers.properties
JkLogFile /var/log/apache2/mod_jk.log
#JkLogLevel info
JkLogLevel debug

ServerTokens Major

VirtualHost *:80
   ... [what I posted in previous messages, including JkMounts]
/VirtualHost


Some of those are a little strange:

For example

[Tue Sep 18 11:05:24.002 2007] [4723:3081406128] [debug]
open_jklog::mod_jk.c (2652): log time stamp format is '[%a %b %d
%H:%M:%S.%Q %Y] '

should only appear once for each different jk log file (JkLogFile).

So all in all something might be strange about the vhosts and the JK
configuration. Could you post all Jk relevant configuration directives
an their surrounding vhost structure?


The gentoo install comes with a default virtual host that basically
just sets up a standard /var/www/localhost/htdocs virtual host. It turns
on NameVirtualHost but then doesn't specify a server name, so I think it
only gets used when nothing else matches.


OK, does it contain a VirtualHost tag? If so, the NameVirtualHost will 
then be resolved to the first VirtualHost found (and matching he IP/Port 
restrictions). The first one is the default. Combined with your 
difficulties to resolve static content, I expect this default vhost to 
be a real vhost, which also gets used as the default. Understanding a 
configuration combining vhosts with *, vhosts with _default, vhosts 
with defined IP and port and finally name based vhosts is non trivial. 
So if you don't intend to do name based virtual hosting, disable the 
NameVirtualHost and also this default vhost. Consider using a real IP 
instead of * in your vhost. Then only the global server and your vhost 
(port 80) should remain.


Also consider defining a separate JkLogFile for the (not used) global 
server. This way you can find out, what gets configured in the globl 
server, and what gets configured in the vhost. It might also be good, to 
add separate eror and access logs to the global server vs. the vhost, so 
that you can easily detect configuration errors (whoops, I'm uing the 
global server ...).



This is a testing server, so I don't really care that there's a useless
VirtualHost floating around.


Another thing: there is a non-debug startup message

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [error]
init_jk::mod_jk.c (2732): Initializing
shm:/usr/lib/apache2/logs/jk-runtime-status.4723 errno=2. Load balancing
workers will not function properly.

I don't know what erno 2 is on your platform (btw: what's your
platform), but most likely it's No such file or directory. Ommit the
shm: prefix and make sure the directory exists and is writable.


I'm using Gentoo Linux with a kernel version of 2.6.17. Errno 2 appears
to be:

# perror 2
OS error code   2:  No such file or directory

Not surprising.

I am not intending to use shared memory or load balancing or anything
like that. Therefore, I have no such configuration in my
jk_workers.properties file. Could this be the reason why there appear to
be no maps when trying to match JkMounts? Are the workers being
configured and then discarded because there's no place to put them in
memory? That would suck, but at least make sense.


Should not be related. Nevertheless even without load balancing, using a 
single member load balancer and shared memory can be interesting because 
of the advanced managment and information features provided by the stu 
worker (that uses the shared memory to comunicate with the lb).



I'm not sure which configuration directive to tweak in this case... any
ideas?

(Btw, I when building my own mod_jk.so, I didn't run 'make install'
since I don't want the installed messing with my config... I merely
copied the .so into the properly location and updated my configuration
accordingly. I hope that's not a 

RE: With JK 1.2.x using route causes problems with redirect?

2007-09-18 Thread Brian.Horblit

Henk and Rainer,

My sincerest apologies! I don't know how many times I checked that
config without noticing the error. Sorry to waste your time. Probably
too many edits/tests wore my eyes out. :-(

I fixed that domain up and yes indeed, it seems to be working. I did 6
combinations of server fails and restarts with the expected behavior
each time. 

Thanks once again,

Brian

---Original Message-
--From: Rainer Jung [mailto:[EMAIL PROTECTED] 
--Sent: Tuesday, September 18, 2007 10:13 AM
--To: Tomcat Users List
--Subject: Re: With JK 1.2.x using route causes problems with redirect?
--
--Henk Fictorie wrote:
-- 
-- Brian.Horblit wrote:
--  
-- # Set w4 properties
-- worker.w4.socket_keepalive=1
-- worker.w4.socket_timeout=20
-- worker.w4.reply_timeout=2
-- worker.w4.retries=2
-- worker.w4.connection_pool_timeout=60
-- worker.w4.type=ajp13
-- worker.w4.host=localhost
-- worker.w4.port=8034
-- worker.w4.lbfactor=1
-- worker.w4.route=tc4
-- worker.w3.domain=d34
--
--
-- 
-- I guess this is a typo, it should be worker.w4.domain=d34
-- 
-- regards Henk
--
--And I already wondered what the heck was wrong with domains. 
--Thanks! So
--Brian: give it another try with the fixed typo. I don't see 
--anything else wrong in this configuration.
--
--Regards
--
--Rainer
--
---
--To start a new topic, e-mail: users@tomcat.apache.org To 
--unsubscribe, e-mail: [EMAIL PROTECTED]
--For additional commands, e-mail: [EMAIL PROTECTED]
--
--

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: With JK 1.2.x using route causes problems with redirect?

2007-09-18 Thread Rainer Jung

[EMAIL PROTECTED] wrote:

Henk and Rainer,

My sincerest apologies! I don't know how many times I checked that
config without noticing the error. Sorry to waste your time. Probably
too many edits/tests wore my eyes out. :-(


No problem. I learned something too (redirect=route), and found another 
tester for the domain feature :)



I fixed that domain up and yes indeed, it seems to be working. I did 6
combinations of server fails and restarts with the expected behavior
each time. 


Thanks once again,

Brian


Have fun!

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk and Apache httpd 2.2 [RESOLVED ; still have questions]

2007-09-18 Thread Rainer Jung

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rainer,

So, I dumped my configuration entirely and tried to get something served
from somewhere other than the default virtual host.

It turns out that the default virtual host does not set a ServerName,
which apparently really confuses Apache httpd 2.2. Either this was not a
problem for Apache httpd 2.0, or I configured it so long ago that I
don't remember doing it.

Everything started working again when I simply set the ServerName in the
default virtual host to:

ServerName my.ip.address:80

What a PITA.


Good to know.


I still have a few questions, though:

1. I still get the JkShmFile error (didn't specify such a directive;
   should I? If I don't need it, can I disable the feature to avoid
   the error message?)


I'm afraid we didn't prepare for that case :(
See my other mai, why it might be interesting even without real load 
balancing to use the shared memory. If you don't like it, I'm afraid at 
the moment you will have to live with the sartup error.



2. Is is okay to have connection_pool_size=1 for my workers? The docs
   suggest to me that it /must be/ set to 1 if I'm using prefork MPM.


OK, I see, that our wording is still not clear. What we try to tell the 
users:


- this attribute is automatically configured for Apache httpd and all 
MPMs. The default is the number of threads per process, so that each 
request handling thread should be able to use a backend connection 
whenever it needs one.


- for other web servers the default is either 1 or 250 (IIS)

- You might choose non-default values. Using bigger values than the 
default for Apache httpd doesn't make sense, it will simply waste 
ressources. Especially it does not make sense to use a bigger value than 
the default 1 for httpd 1.3 and 2.x/prefork MPM.


If you find a better wording for the workers.properties docs page than 
the existing, please privide us with it :)



3. How much of this crap can I get rid of:



worker.worker3.type=ajp13


Default, but I would stick with it to make it more readable.


worker.worker3.host=localhost


Default, but again I would keep it, because it's not unlikely, that you 
will move the backend away one day.



worker.worker3.port=8385


Needed.


worker.worker3.lbfactor=50


Only needed if used in combination with an lb worker *and* you want to 
use different values for the members of the lb.



worker.worker3.connection_pool_size=1


Default and better to drop the explicit configuration. Once you switch 
to a multi-threaded MPM, this value (1) is most likely not what you 
want. The default gets automatically adapted to the value of threads per 
process.



worker.worker3.connection_pool_timeout=60


OK. Maybe a little short. 600 (10 minutes) should be OK as well. It 
would be good to adjust connectionTimeout in the Tomcat AJP connector to 
the same value (multiplied by 1000, because it's milliseconds there). We 
proudly present the new docs page 
http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html.



worker.worker3.socket_keepalive=1


OK, in case there is a firewall between your httpd and the backend. As 
long as the backend is localhost, it's unlikely you need it.



worker.worker3.socket_timeout=300


Difficult to judge. Socket timeouts help in some situations and make 
things more difficult to understand in oter situations. You could keep it.



Clearly, I can eliminate the lb_factor as I am not using load balancing
of any kind. The pool and socket config are just grandfathered-in, so
I'd appreciate any thoughts you have on that, Rainer.

Once again, thanks for taking the time to read through my posts. You
always seem to be willing to look at anyone's debugging output to help
prove that mod_jk isn't the problem ;) Vielen dank!


Gern geschehen.

Unfortunately somtimes still mod_jk is the problem. But it looks like 
such cases are few these days.



- -chris


Regards,

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk and Apache httpd 2.2 [RESOLVED ; still have questions]

2007-09-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rainer,

So, I dumped my configuration entirely and tried to get something served
from somewhere other than the default virtual host.

It turns out that the default virtual host does not set a ServerName,
which apparently really confuses Apache httpd 2.2. Either this was not a
problem for Apache httpd 2.0, or I configured it so long ago that I
don't remember doing it.

Everything started working again when I simply set the ServerName in the
default virtual host to:

ServerName my.ip.address:80

What a PITA.

I still have a few questions, though:

1. I still get the JkShmFile error (didn't specify such a directive;
   should I? If I don't need it, can I disable the feature to avoid
   the error message?)

2. Is is okay to have connection_pool_size=1 for my workers? The docs
   suggest to me that it /must be/ set to 1 if I'm using prefork MPM.

3. How much of this crap can I get rid of:

worker.worker3.type=ajp13
worker.worker3.host=localhost
worker.worker3.port=8385
worker.worker3.lbfactor=50
worker.worker3.connection_pool_size=1
worker.worker3.connection_pool_timeout=60
worker.worker3.socket_keepalive=1
worker.worker3.socket_timeout=300

Clearly, I can eliminate the lb_factor as I am not using load balancing
of any kind. The pool and socket config are just grandfathered-in, so
I'd appreciate any thoughts you have on that, Rainer.

Once again, thanks for taking the time to read through my posts. You
always seem to be willing to look at anyone's debugging output to help
prove that mod_jk isn't the problem ;) Vielen dank!

- -chris

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

iD8DBQFG8Ay59CaO5/Lv0PARAsPLAJ9GsWkgQIJ/dbw2lbDqkB9Qz6mjhgCfYKlY
6f1QFeYBa/DVKvRCUgMdXzo=
=mscb
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 6 Admin Application

2007-09-18 Thread Caldarale, Charles R
 From: Brantley Hobbs [mailto:[EMAIL PROTECTED] 
 Subject: Re: Tomcat 6 Admin Application

 Is there a canned application that can use JMX to provide similar 
 information as the old admin app?

Try the MBeans tab of the JConsole program that comes with Sun JDKs.
You'll need to start Tomcat with JAVA_OPTS set to
-Dcom.sun.management.jmxremote to enable JMX.

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: With JK 1.2.x using route causes problems with redirect?

2007-09-18 Thread Brian.Horblit

When I get multicast working in my Linux environment I'll put it under
load and do the same failover tests to see how it fares when it is
working harder! Maybe I'll do the same for the route/redirect method
too.

---Original Message-
--From: Rainer Jung [mailto:[EMAIL PROTECTED] 
--Sent: Tuesday, September 18, 2007 11:59 AM
--To: Tomcat Users List
--Subject: Re: With JK 1.2.x using route causes problems with redirect?
--
--[EMAIL PROTECTED] wrote:
-- Henk and Rainer,
-- 
-- My sincerest apologies! I don't know how many times I checked that 
-- config without noticing the error. Sorry to waste your 
--time. Probably 
-- too many edits/tests wore my eyes out. :-(
--
--No problem. I learned something too (redirect=route), and 
--found another tester for the domain feature :)
--
-- I fixed that domain up and yes indeed, it seems to be 
--working. I did 6 
-- combinations of server fails and restarts with the 
--expected behavior 
-- each time.
-- 
-- Thanks once again,
-- 
-- Brian
--
--Have fun!
--
--Rainer
--
---
--To start a new topic, e-mail: users@tomcat.apache.org To 
--unsubscribe, e-mail: [EMAIL PROTECTED]
--For additional commands, e-mail: [EMAIL PROTECTED]
--
--

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: With JK 1.2.x using route causes problems with redirect?

2007-09-18 Thread Brian.Horblit

Rainer,

I thought I should just note that part of the exotic config (using
route and the like) is driven by the fact that the workers.properties
file is not dynamically reloadable. 

We have had a modified version of the JK2 connector running for years
and we heavily use the capability to dynamically reload  the
workers2.properties file to update worker activation status during the
deploy of new app versions. I was mulling over how to get similar
functionality (without apachectl/graceful) via multiple load balancers
pointing to workers in different states and switching things out
dynamically at the url=lb mapping level. (I realize that I can change
states via the jkstatus page, but I want the changes to persistent.) 

I think I saw in the bug database discussion of making the
workers.properties dynamically reloadable, and I wanted to cast a vote
for that feature.

Thanks again for everything,

Brian Horblit

---Original Message-
--From: Rainer Jung [mailto:[EMAIL PROTECTED] 
--Sent: Tuesday, September 18, 2007 11:59 AM
--To: Tomcat Users List
--Subject: Re: With JK 1.2.x using route causes problems with redirect?
--
--[EMAIL PROTECTED] wrote:
-- Henk and Rainer,
-- 
-- My sincerest apologies! I don't know how many times I checked that 
-- config without noticing the error. Sorry to waste your 
--time. Probably 
-- too many edits/tests wore my eyes out. :-(
--
--No problem. I learned something too (redirect=route), and 
--found another tester for the domain feature :)
--
-- I fixed that domain up and yes indeed, it seems to be 
--working. I did 6 
-- combinations of server fails and restarts with the 
--expected behavior 
-- each time.
-- 
-- Thanks once again,
-- 
-- Brian
--
--Have fun!
--
--Rainer
--
---
--To start a new topic, e-mail: users@tomcat.apache.org To 
--unsubscribe, e-mail: [EMAIL PROTECTED]
--For additional commands, e-mail: [EMAIL PROTECTED]
--
--

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk and Apache httpd 2.2 [RESOLVED ; still have questions]

2007-09-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rainer,

Rainer Jung wrote:
 I still have a few questions, though:

 1. I still get the JkShmFile error (didn't specify such a directive;
should I? If I don't need it, can I disable the feature to avoid
the error message?)
 
 I'm afraid we didn't prepare for that case :(

No problem. I'll explicitly set this to a file that Apache actually has
access to.

 2. Is is okay to have connection_pool_size=1 for my workers? The docs
suggest to me that it /must be/ set to 1 if I'm using prefork MPM.
 
 OK, I see, that our wording is still not clear. What we try to tell the
 users:

I think I get it. Basically, the best practice is to leave this setting
to the default (when using Apache httpd) unless there's some kind of
problem. Is that about it?

 3. How much of this crap can I get rid of:
[snip]
 worker.worker3.lbfactor=50
 
 Only needed if used in combination with an lb worker *and* you want to
 use different values for the members of the lb.

Ok.

 worker.worker3.connection_pool_timeout=60
 
 OK. Maybe a little short. 600 (10 minutes) should be OK as well. It
 would be good to adjust connectionTimeout in the Tomcat AJP connector to
 the same value (multiplied by 1000, because it's milliseconds there). We
 proudly present the new docs page
 http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html.

60 seconds ought to be enough for a localhost connection to pick up the
phone, no? If a web user has to wait 60 seconds, they're going to hit
RELOAD anyway.

 worker.worker3.socket_keepalive=1
 
 OK, in case there is a firewall between your httpd and the backend. As
 long as the backend is localhost, it's unlikely you need it.

Ok.

Again, thanks so much for your continued patience nd help.

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

iD8DBQFG8Cpy9CaO5/Lv0PARAmMdAJ4o0QM1zrcNXgzyqqGH4JMIYjj7FgCcCsPK
sd7IhEw6YWQlM7l9JEzNUM8=
=Nt6F
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread Lilianne E. Blaze
Just be aware it will get messy if the webapp is distributed.

One suggestion - don't configure the sessions for 12h
maxInactiveInterval. Keep the default 30m (or was it 15m? whatever), and
change it to 12h only after login. Otherwise guest-sessions will expire
in 12h too, and that's just wasteful.

Greetings, Lilianne E. Blaze

[EMAIL PROTECTED] wrote:
 We have tomcat configured to allow users sessions to stay alive for 12
 hours. This is because this is how they like to work, login once at the
 start of the day and shutdown at the end of the day.

 I have a need to track their actual activity, like a concurrent license
 tool, and thought the best way of doing this would be to have a servlet
 start a timer at server startup, this servlet could then poll all the
 active sessions at a set interval and check the  getLastAccessedtime()
 method, building up a view of the actual activity.

 Am I going about this in the right way?

 If I am how do I access all the currently active sessions from a servlet?
 It looks like if I can gain access to the servers engine/context I could
 access all sessions via the ManagerBase class but I do not know how to do
 this.

 Thanks Gary
 _
 This e-mail transmission and any attachments to it are intended solely for
 the use of the individual or entity to whom it is addressed and may contain
 confidential and privileged information.  If you are not the intended
 recipient, your use, forwarding, printing, storing, disseminating,
 distribution, or copying of this communication is prohibited.  If you
 received this communication in error, please notify the sender immediately
 by replying to this message and delete it from your computer.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: AccessControlException with Embedded Tomcat 5.5.23

2007-09-18 Thread Caldarale, Charles R
 From: S D [mailto:[EMAIL PROTECTED] 
 Subject: AccessControlException with Embedded Tomcat 5.5.23
 
 1. How do I enforce the use of the catalina.policy file 
 with embedded Tomcat?

You need to set the following _two_ system properties:

-Djava.security.manager
-Djava.security.policy=$CATALINA_BASE/conf/catalina.policy

Sorry, can't answer your second question.

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Sticky servlet

2007-09-18 Thread Kamil Burzynski
Hello,

 I would like to create one of my servlets to be 'sticky': to be sure
that Tomcat will never try to remove this servlet from memory.
Is load-on-startup enough? I know that it will start my servlet as
soon as tomcat starts, but will tomcat ever try to remove such servlet?
E.g. if there will be 1 month of inactivity, or so much requests arrive
that out-of-memory will happen?
Maybe I should create some background thread or socket or whatever?

Any solutions appreciated, thanks in advance.

-- 
Best regards from
Kamil Burzynski


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Sticky servlet

2007-09-18 Thread David Delbecq
In j2ee specs, there is no provision for unloading an unused servlet. 
Once a servlet has been tarted (load-on-startup or triggered by user 
query), i never get unloaded, unless webapp gets unloaded, which occurs 
at shutdown or during a redeploy (administrative task)

Kamil Burzynski a écrit :

Hello,

 I would like to create one of my servlets to be 'sticky': to be sure
that Tomcat will never try to remove this servlet from memory.
Is load-on-startup enough? I know that it will start my servlet as
soon as tomcat starts, but will tomcat ever try to remove such servlet?
E.g. if there will be 1 month of inactivity, or so much requests arrive
that out-of-memory will happen?
Maybe I should create some background thread or socket or whatever?

Any solutions appreciated, thanks in advance.

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Need help in the compatibility for Windows Vista.

2007-09-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pavan,

PavanSingaraju wrote:
 I have an web application in Tomcat 5.0.18. I am running it on Windows XP
 operating system. I am planning to upgrade the OS to Windows Vista.

Just out of curiosity, why are you upgrading from XP to Vista? Is this a
production application? I'm not sure I'd trust Windows Vista as a
production operating system just yet. (Then again, I would never trust
any version of Microsoft Windows as a production operating system, but
that's just me).

 Are
 there any known compatibility issues for migrating the Tomcat to Vista??

Generally, Tomcat doesn't care what the underlying OS is. If you can
find a JVM that is stable on Windows Vista then you should be okay to go.

You will, of course, require tons of testing before you can trust any
new production environment. If you're committed to upgrading to Vista,
why not set up a test server and start testing?

[Just to continue to play the devil's advocate: if you're going to
switch server operating systems, why not consider some type of UNIX? You
can generally get them for a lot less than Microsoft Windows licenses,
and, IMO, they're a lot more stable, remotely accessible, etc.]

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

iD8DBQFG8DX09CaO5/Lv0PARAqN8AJwMa0Q4J2J6yp76P481nJ6hdkLL8QCcDYh4
AkaXv4PsE5nfDoySHW7LxD8=
=/jZF
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re[2]: Sticky servlet

2007-09-18 Thread Kamil Burzynski
Hello,

 In j2ee specs, there is no provision for unloading an unused servlet. 
 Once a servlet has been tarted (load-on-startup or triggered by user 
 query), i never get unloaded, unless webapp gets unloaded, which occurs
 at shutdown or during a redeploy (administrative task)

Thanks for quick reply. So, it seems, that I have guarantee, that my
servlet once started, will live as long as my webapp/tomcat will live..
this is exactly what I was looking for.

-- 
Best regards from
Kamil Burzynski


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6 Exception Language

2007-09-18 Thread Fredy Provoste
jojoo yes, the apache service manager has options to configure it, sorry,
and thanks

2007/9/18, David Delbecq [EMAIL PROTECTED]:

 To pass parameter to tomcat service and configure it:

 http://www.google.be/search?q=tomcat6+service+parameters


 Fredy Provoste a écrit :
  Thak you so much Christopher, see that your information is for a Linux
  Enviromente, i'm working in windows, and i have tomcat installed as
 service,
  so the scripts shutdown and startup aren't here, i've tried to set the
  enviroment variable
 
  JAVA_OPTS=-Duser.language=en -Duser.country=US
 
  in windows, but still exceptions come in spanish language, thank you
 again
 
  Fredy
 
  2007/9/17, Christopher Schultz [EMAIL PROTECTED]:
 
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Fredy,
 
  Fredy Provoste wrote:
 
  the exceptions that server
  throws is in Spanish language; I wish this exception were in English
 
  You need to change the value of the system property 'user.language' to
  'en'. You should be able to do it like this:
 
  $ $CATALINA_HOME/bin/shutdown.sh
  $ export JAVA_OPTS=-Duser.language=en -Duser.country=US
  $ $CATALINA_HOME/bin/startup.sh
 
  Note that I also set the country; I'm not sure what the JVM would do
  with a Locale of en_ES, so it's better to use en_US (or even en_GB).
 
  - -chris
 
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.7 (MingW32)
  Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
  iD8DBQFG7rh79CaO5/Lv0PARAk3VAJ43y/edZNjMotvZAkwPZgjsFcQUQQCeMmbo
  G2bKfzYMtbteMVYiBIZgomk=
  =CwHK
  -END PGP SIGNATURE-
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Static files Localization

2007-09-18 Thread Kakinari, Takashi
Hi,

When I investigate localization capaability on Tomcat, I foound following 
document.

  
http://www.jajakarta.org/tomcat/tomcat3.2-4.0/tomcat-3.2.3/doc/tomcat-localization-howto.html

However when I checked this functionality on Tomcat 4, 5, and 6, I can't find 
out StaticInerceptor class.
Is this feature obsoleted or replaced to alternetives?
I checked newer documents but I can't find similar feature.
Please let me know how latest tomcat handles static files localization.

Regards,
Takashi Kakinari.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problem with https and apache+httpd+tomcat [SOLVED]

2007-09-18 Thread Christian Andersson

Hi Rainer, and thanks for trying to help me.

I had been trying most of what you wrote, and it still looked like it 
was tomcat, but there was one thing that struck me while doing all 
these tests/changes


mod_jk transfers the knowledge of the hostname and port used in Apache 
htpd to the AJP connector, so that self referring URLs can be produced 
correctly.


Comparing my virtualhost definition
VirtualHost *:443
   ServerName demo.mydomain
   JkMount /* worker1
/VirtualHost

with one provided with the installation for squirrelmail (php based)
I did some changes to my virtualhost
IfModule mod_ssl.c
VirtualHost *:443
   ServerName demo.mydomain
   JkMount /* worker1
   SSLEngine on
   SSLProtocol all -SSLv2
   SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
   SSLCertificateFile /etc/pki/tls/certs/localhost.crt
   SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
/VirtualHost
/IfModule

and Voila, now it works...
apparently https WAS working without all of this SSL parameters, but 
mod_jk sent the wrong information to the server.


so even if your suggestions on what to check did not leave me to an 
answer, your message still helped :-)



Rainer Jung wrote:

Hi Christian,

with the combination of mod_jk and AJP connector, this should not 
happen. mod_jk transfers the knowledge of the hostname and port used 
in Apache htpd to the AJP connector, so that self referring URLs can 
be produced correctly. Even the attributes redirectPort and scheme 
should not be necessary. I would also remove the secure attribute. 
As far as I can remember, that one also gets set by mod_jk/AJP (true, 
if communication against apache httpd was encrypted). There is an 
attribute called proxyPort, but for the AJP connector this normally 
works automatically.


So I would expect, that if the redirect is really what comes back, 
this gets produced by some other component:


- proxy
- Apache httpd itself
- Some web framework used by your app

I would:

- check what is really coming back. You canuse a comandline client 
like e.g. curl, that exists in an ssl enabled version and is able to 
showyou the raw response


- check whether the requests was really handled by Tomcat, e.e. by 
adding an access log to Tomcat and checking if the request gets logged 
there


- check, whether the http to https redirect works for a simple hello 
world webapp.


HTH.

Regards,

Rainer

Christian Andersson wrote:

Hi there I have a problem with tomcat, but first version information for
some of the applications used.


Apache/2.2.3 (Mandriva Linux/PREFORK-1.1.20060mlcs4)

Apache Tomcat/6.0.13

java version 1.6.0_01
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_01-b06, mixed mode)

I have setup apache httpd to only answer on port 443 using https
and I have several virtual hosts.
one of them I have setup to use mod_jk to connect to tomcat using this
configuration
VirtualHost *:443
ServerName demo.mydomain
JkMount /* worker1
/VirtualHost

in tomcat I have only configured this single connector
Connector port=8009 protocol=AJP/1.3 secure=true scheme=https
redirectPort=443/

now, everything works allright, I can surf to the server using the
following url..

https://demo.mydomain/mywebapp/

and everything works.

HOWEVER, I have 2 problems with this setup and that is, IF I surf to the
same address but forgets to add that last /
(https://demo.mydomain/mywebapp) tomcat redirects the browser to surf to
the correct url (add the ending /) BUT the url it sends to the browser
is WRONG!!!  it is not sending https://demo.mydomain/mywebapp/ as one
could suppose, it is sending https://demo.mydomain:80/mywebapp/

(atleast that is what I suppose is happening.. sicne I cannot check what
is being sent on the Ethernet, since that is encrypted, however firefox
tries to connect to that url.)

I also got the same problem in my forms based login
when the browser is sending the login form, it gets a redirect from the
server with the port 80 instead of no port
if I remove the :80 in the url I get the real page, and I am logged in..

so somewhere (I think it is tomcat) the browser is told to go to port 80

can anyone help me with this?


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Static files Localization

2007-09-18 Thread Caldarale, Charles R
 From: Kakinari, Takashi [mailto:[EMAIL PROTECTED] 
 Subject: Static files Localization
 
 Is this feature obsoleted or replaced to alternetives?

Modern versions of Tomcat use standard Java internationalization:
http://java.sun.com/javase/technologies/core/basic/intl/

You can find localized Tomcat messages for Spanish, French, and Japanese
in the following jars that are part of the standard Tomcat
distributions:
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Sticky servlet

2007-09-18 Thread David Smith
However if you read servlet spec 2.4, SRV.2.3.4 you'll find the 
following direct quote:


The servlet container is not required to keep a servlet loaded for any 
particular
period of time. A servlet instance may be kept active in a servlet 
container for a
period of milliseconds, for the lifetime of the servlet container (which 
could be a

number of days, months, or years), or any amount of time in between.

I think you should give up on the whole idea of trying to keep a servlet 
operating for the life of tomcat.  Look at the reasons why you want this 
and look at other solutions to those problems.


--David

David Delbecq wrote:
In j2ee specs, there is no provision for unloading an unused servlet. 
Once a servlet has been tarted (load-on-startup or triggered by user 
query), i never get unloaded, unless webapp gets unloaded, which 
occurs at shutdown or during a redeploy (administrative task)

Kamil Burzynski a écrit :

Hello,

 I would like to create one of my servlets to be 'sticky': to be sure
that Tomcat will never try to remove this servlet from memory.
Is load-on-startup enough? I know that it will start my servlet as
soon as tomcat starts, but will tomcat ever try to remove such servlet?
E.g. if there will be 1 month of inactivity, or so much requests arrive
that out-of-memory will happen?
Maybe I should create some background thread or socket or whatever?

Any solutions appreciated, thanks in advance.

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Distributed web services: Tomcat or Jboss?

2007-09-18 Thread Nicholas Sushkin
Also check out Glassfish/OpenESB/Netbeans. Sun just released Netbeans 6 beta 
1 and Glassfish v2.

http://open-esb.dev.java.net/

On Tuesday 18 September 2007, Christopher Schultz wrote: 

 Matthias,

 Matthias Klein wrote:
  As I am starting a new project, I am unsure whether to use Tomcat/Axis
  or the Jboss product line. Any idea?

 Do you need EJBs? If you do, then you'll need JBoss.

 If you don't need EJBs, I would recommend not using a full EJB server.

 -chris

-- 
Nicholas Sushkin, Senior Software Engineer
http://www.openfinance.com http://www.wealthinformationexchange.com


smime.p7s
Description: S/MIME cryptographic signature


Re: Need help in the compatibility for Windows Vista.

2007-09-18 Thread PavanSingaraju
Chris,
   Thank you for the information. I did proposed for moving it to linux,
and am waiting for management's response. The new machine had Vista, and to
host it on that machine, i wanted to check if there are some issues with it.
This mail did answered my question. Thanks once again.
--
Pavan S. Kumar


On 9/18/07, Christopher Schultz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Pavan,

 PavanSingaraju wrote:
  I have an web application in Tomcat 5.0.18. I am running it on Windows
 XP
  operating system. I am planning to upgrade the OS to Windows Vista.

 Just out of curiosity, why are you upgrading from XP to Vista? Is this a
 production application? I'm not sure I'd trust Windows Vista as a
 production operating system just yet. (Then again, I would never trust
 any version of Microsoft Windows as a production operating system, but
 that's just me).

  Are
  there any known compatibility issues for migrating the Tomcat to Vista??

 Generally, Tomcat doesn't care what the underlying OS is. If you can
 find a JVM that is stable on Windows Vista then you should be okay to go.

 You will, of course, require tons of testing before you can trust any
 new production environment. If you're committed to upgrading to Vista,
 why not set up a test server and start testing?

 [Just to continue to play the devil's advocate: if you're going to
 switch server operating systems, why not consider some type of UNIX? You
 can generally get them for a lot less than Microsoft Windows licenses,
 and, IMO, they're a lot more stable, remotely accessible, etc.]

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

 iD8DBQFG8DX09CaO5/Lv0PARAqN8AJwMa0Q4J2J6yp76P481nJ6hdkLL8QCcDYh4
 AkaXv4PsE5nfDoySHW7LxD8=
 =/jZF
 -END PGP SIGNATURE-

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Static files Localization

2007-09-18 Thread Bill Barker
Chuck's comments refer to localization of Tomcat error messages.  The page 
the OP refers to is something more like Apache httpd's mod_negotiation, 
which isn't supported in any supported version of Tomcat (i.e. 3.3.x+).  The 
main reason is that it is pretty easy to implement this as a Filter in TC 
4.0.x+ (and 3.3.x is now three spec versions behind), so there is no reason 
to have it the Tomcat core code.

Of course, if someone wanted to develop this Filter and contribute it back 
to Tomcat, there is a reasonably good chance that it might be accepted as an 
optional component (like CGI and SSI).  After all, patches are always 
welcome :).

Caldarale, Charles R [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 From: Kakinari, Takashi [mailto:[EMAIL PROTECTED]
 Subject: Static files Localization

 Is this feature obsoleted or replaced to alternetives?

Modern versions of Tomcat use standard Java internationalization:
http://java.sun.com/javase/technologies/core/basic/intl/

You can find localized Tomcat messages for Spanish, French, and Japanese
in the following jars that are part of the standard Tomcat
distributions:
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Sticky servlet

2007-09-18 Thread Bill Barker

Kamil Burzynski [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hello,

 I would like to create one of my servlets to be 'sticky': to be sure
 that Tomcat will never try to remove this servlet from memory.
 Is load-on-startup enough? I know that it will start my servlet as
 soon as tomcat starts, but will tomcat ever try to remove such servlet?
 E.g. if there will be 1 month of inactivity, or so much requests arrive
 that out-of-memory will happen?
 Maybe I should create some background thread or socket or whatever?


Please read the other responses to this thread, since they are correct that 
there is no guarantee.  However, the current implementation of TC (3.3-6.0) 
will not unload a Servlet unless the entire context is reloaded (with a 
slight exception for JSP pages).  But then you are programming against 
Tomcat itself, in an area where there is no guarantee that it won't change 
in the future, and it may not work if you try to move to another Servlet 
container.

 Any solutions appreciated, thanks in advance.

 -- 
 Best regards from
 Kamil Burzynski


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread Lyallex
On 9/18/07, Lyallex [EMAIL PROTECTED] wrote:
 How about creating a SessionListener

 class SomeSessionListener implements HttpSessionListener ...

 Register it in web.xml

 in the sessionCreated method of your listener get a reference to the
 new session from the HttpSessionEvent you can now access the
 getLastAccessedTime(), maybe store the refs in some singleton ...

...er, actually I think this could be a REALLY STUPID idea as I hadn't
thought about what happens if you maintain an external reference to a
session and the session expires...

Investigating now

Duncan

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Question about JNDI + Connection Pool + Mysql (Tomcat 6)

2007-09-18 Thread Fredy Provoste
Hi again, i've been deployed a webapp called libreria in Tomcat 6, i tried
to configure a mysql connection pool, so in the path

libreria
.
.  META-INF/context.xml

put the lines

Context path=/libreria docBase=libreria  debug=5 privileged=true
reloadable=true

Resource name=jdbc/basededatos auth=Container type=
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
factory=com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory
driverClassName=com.mysql.jdbc.Driver  username=usuarioweb
password=usuarioweb
url=jdbc:mysql://localhost:3306/prueba1?autoReconnect=true/

/Context



in  the path

libreria
.
WEB-INF/web.xml

the lines to use the JNDI resource


resource-ref
  description
Pool a la Base de Datos
  /description
  res-ref-name
jdbc/basededatos
  /res-ref-name
  res-type
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
  /res-type
  res-auth
Container
  /res-auth
  /resource-ref


so trying using JSTL, and pure JSP to access the pool, i get the next
message

ERROR java.sql.SQLException: Access denied for user ''@'localhost' (using
password: YES)
seems like tomcat ignores my user i've created in mysql server (I verify the
connection through dreamweaver conection feature and it works)

thanks for any help

Fredy


Re: Question about JNDI + Connection Pool + Mysql (Tomcat 6)

2007-09-18 Thread Titi Wangsa
try changing
username=usuarioweb
to
user=usuarioweb

from
http://www.docjar.com/docs/api/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.html#setUser(java.lang.String)


On 9/19/07, Fredy Provoste [EMAIL PROTECTED] wrote:
 Hi again, i've been deployed a webapp called libreria in Tomcat 6, i tried
 to configure a mysql connection pool, so in the path

 libreria
 .
 .  META-INF/context.xml

 put the lines

 Context path=/libreria docBase=libreria  debug=5 privileged=true
 reloadable=true

 Resource name=jdbc/basededatos auth=Container type=
 com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
 factory=com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory
 driverClassName=com.mysql.jdbc.Driver  username=usuarioweb
 password=usuarioweb
 url=jdbc:mysql://localhost:3306/prueba1?autoReconnect=true/

 /Context



 in  the path

 libreria
 .
 WEB-INF/web.xml

 the lines to use the JNDI resource


 resource-ref
   description
 Pool a la Base de Datos
   /description
   res-ref-name
 jdbc/basededatos
   /res-ref-name
   res-type
 com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
   /res-type
   res-auth
 Container
   /res-auth
   /resource-ref


 so trying using JSTL, and pure JSP to access the pool, i get the next
 message

 ERROR java.sql.SQLException: Access denied for user ''@'localhost' (using
 password: YES)
 seems like tomcat ignores my user i've created in mysql server (I verify the
 connection through dreamweaver conection feature and it works)

 thanks for any help

 Fredy


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re[2]: Sticky servlet

2007-09-18 Thread Kamil Burzynski
Hello,

 Please read the other responses to this thread, since they are correct that
 there is no guarantee.  However, the current implementation of TC (3.3-6.0)
 will not unload a Servlet unless the entire context is reloaded (with a
 slight exception for JSP pages).  But then you are programming against
 Tomcat itself, in an area where there is no guarantee that it won't change
 in the future, and it may not work if you try to move to another Servlet
 container.

Yeah, I was afraid of getting such answer, actually ;) In my project it
would be enough to code against current version of Tomcat, though I
would like a clean solution. So, it seems, that I'll do standalone
server and then webapp will connect to it via some protocol (I am not
familiar with java world enough to know if any good rpc is there - most
probably it is).

Thanks for all answers.

-- 
Best regards from
Kamil Burzynski


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]