Problem with session

2004-01-12 Thread pad
Hi!

We use Tomcat 4.1.
We developed an application with session support.
It works fine on a local machine, but after we had moved it at the server,
it started to generate new session after any link hit.
Whad did we do wrong?

Thanks, Paul


cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp ReplicationValve.java SimpleTcpCluster.java

2004-01-12 Thread fhanik
fhanik  2004/01/11 23:50:07

  Modified:modules/cluster/src/share/org/apache/catalina/cluster
ClusterManager.java
   modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaManager.java DeltaRequest.java
DeltaSession.java SimpleTcpReplicationManager.java
   modules/cluster/src/share/org/apache/catalina/cluster/tcp
ReplicationValve.java SimpleTcpCluster.java
  Log:
  skeleton of delta replication is complete.
  
  Revision  ChangesPath
  1.2   +18 -2 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java
  
  Index: ClusterManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClusterManager.java   15 Nov 2003 00:58:20 -  1.1
  +++ ClusterManager.java   12 Jan 2004 07:50:06 -  1.2
  @@ -73,6 +73,8 @@
*/
   
   import org.apache.catalina.Manager;
  +import org.apache.catalina.cluster.tcp.SimpleTcpCluster;
  +
   
   public interface ClusterManager extends Manager {
   
  @@ -103,5 +105,19 @@
   * @return
   */
  public String[] getInvalidatedSessions();
  +   
  +   /**
  +* Return the name of the manager, typically the context name such as /replicator
  +* @return String
  +*/
  +   public String getName();
  +   
  +   public void setName(String name);
  +   
  +   public void setExpireSessionsOnShutdown(boolean expireSessionsOnShutdown);
  +   
  +   public void setUseDirtyFlag(boolean useDirtyFlag);
  +   
  +   public void setCluster(SimpleTcpCluster cluster);
   
   }
  
  
  
  1.3   +107 -54   
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeltaManager.java 12 Jan 2004 05:23:10 -  1.2
  +++ DeltaManager.java 12 Jan 2004 07:50:06 -  1.3
  @@ -174,10 +174,12 @@
   
   private SimpleTcpCluster cluster = null;
   private boolean stateTransferred;
  +private boolean useDirtyFlag;
  +private boolean expireSessionsOnShutdown;
  +private boolean printToScreen;
   // - Constructor
  -public DeltaManager(SimpleTcpCluster cluster) {
  +public DeltaManager() {
   super();
  -this.cluster = cluster;
   }
   
   // - Properties
  @@ -350,13 +352,7 @@
   }
   
 // Recycle or create a Session instance
  -  Session session = getNewDeltaSession();
  -
  -  // Initialize the properties of the new session and return it
  -  session.setNew(true);
  -  session.setValid(true);
  -  session.setCreationTime(System.currentTimeMillis());
  -  session.setMaxInactiveInterval(this.maxInactiveInterval);
  +  DeltaSession session = getNewDeltaSession();
 String sessionId = generateSessionId();
   
 String jvmRoute = getJvmRoute();
  @@ -376,7 +372,16 @@
 }
   
 session.setId(sessionId);
  +  session.resetDeltaRequest();
  +  // Initialize the properties of the new session and return it
  +  session.setNew(true);
  +  session.setValid(true);
  +  session.setCreationTime(System.currentTimeMillis());
  +  session.setMaxInactiveInterval(this.maxInactiveInterval);
  +
 sessionCounter++;
  +  
  +  
 if ( distribute ) {
 SessionMessage msg = new SessionMessage(
 getName(),
  @@ -384,8 +389,9 @@
 null,
 sessionId);
 cluster.send(msg);
  +  session.resetDeltaRequest();
 }
  -
  +  
 return (session);
   
   }
  @@ -400,7 +406,28 @@
   }
   
   
  -
  +private DeltaRequest loadDeltaRequest(byte[] data) throws
  +ClassNotFoundException, IOException {
  +ByteArrayInputStream fis = null;
  +ReplicationStream ois = null;
  +Loader loader = null;
  +ClassLoader classLoader = null;
  +fis = new ByteArrayInputStream(data);
  +BufferedInputStream bis = new BufferedInputStream(fis);
  +ois = new ReplicationStream(fis,container.getLoader().getClassLoader());
  +DeltaRequest dreq = (DeltaRequest)ois.readObject();
  +ois.close();
  +return dreq;
  +}
  +
  +private byte[] 

Re: Problem with session

2004-01-12 Thread Kyle VanderBeek
On Mon, Jan 12, 2004 at 10:43:46AM +0300, [EMAIL PROTECTED] wrote:
 We use Tomcat 4.1.
 We developed an application with session support.
 It works fine on a local machine, but after we had moved it at the server,
 it started to generate new session after any link hit.
 Whad did we do wrong?

You should ask such questions on tomcat-users.  This is a list for those 
developing Tomcat, tomcat-users is for those developing *with* Tomcat.  
You'll probably get quick help there.

That said, you should start by doing a little big of Cookie debugging 
via telnet to your HTTP port.  This sort of thing often happens when you 
webserver sets a Cookie incorrectly.  Make sure the Host you're 
requesting jives with the host mentioned in the cookie.

-- 
[EMAIL PROTECTED]
  Some people have a way with words, while others... erm... thingy.


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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardManager.java

2004-01-12 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:
fhanik  2004/01/11 21:21:48

  Modified:catalina/src/share/org/apache/catalina Manager.java
   catalina/src/share/org/apache/catalina/core
StandardContext.java
   catalina/src/share/org/apache/catalina/session
StandardManager.java
  Log:
  Refactoring parts of the code. In order for custom managers (such as the clustering 
managers) to take advantage of the background threads that are already implemented, it 
is better to have the Manager interface to expose the backgroundProcess method. That 
way the context can invoke any other manager in a similar way.
  I opted for this way instead of using reflection. Yell if you don't like it, and I 
will change it back.
-1.
You have to discuss this at least a little bit before making the 
changes. It is unacceptable to make a change to the core interfaces without.

BTW, use a different editor, tweaks yours, or do tabs replacement (or 
similar) in a separate commit: the diffs are unreadable.

Rémy

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


Found and fixed 2 bugs in mod_jk2 using REX in uri

2004-01-12 Thread Max Masetti
hi,

as I asked for help to this list to configure and use regular expressions
into uri in mod_jk2, I found and resolved some bugs in the code. I think its
nice to send you (I don't know exactly who can evalauate and accept my
suggestions).

The bugs are 2.

1. Cant't use metacharacter ']' in rex because this char is used to
terminate the [uri:...] declaration.

2. Can't use rex in uri without prepending a host, it cause a segmentation
fault.


The solution I found:

1.
Change the file jk2-src/jk/native2/common/jk_config_file.c

187 /* Support windows-style 'sections' - for cleaner config
188  */
189 if( (prp[0] == '[') ) {
190 #ifdef HAS_PCRE
191 v=strrchr(prp, ']' );
192 #else
193 v=strchr(prp, ']' );
194 #endif
195 *v='\0';
196 jk2_trim( v );
197 prp++;


2.
Change file jk2-src/jk/native2/common/jk_uriEnv.c near line 91 adding

if (*name == '$') {
++name;
uriEnv-match_type = MATCH_TYPE_REGEXP;
#ifdef HAS_PCRE
uriEnv-uri = uriEnv-pool-pstrdup(env, uriEnv-pool, name);
env-l-jkLog(env, env-l, JK_LOG_INFO,
  uriEnv.parseName() parsing %s regexp\n, name);
{
int errcode;
regex_t *preg = (regex_t *)uriEnv-pool-calloc( env,
  uriEnv-pool, sizeof(regex_t));
if( errcode = regcomp(preg, uriEnv-name, REG_EXTENDED) ) {
char errbuf[1024];
env-l-jkLog(env, env-l, JK_LOG_DEBUG,
  uriEnv.parseName() error #%d compiling regexp
%s\n,
  errcode, name);
return JK_ERR;
}
uriEnv-regexp = preg;
uriEnv-virtual = *;
}
#else
env-l-jkLog(env, env-l, JK_LOG_INFO,
   uriEnv.parseName() parsing regexp %s not supported\n, name);
#endif
return JK_OK;
}
--


Hope this could help someone. For any more info feel free to contact me.

by

max



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



DO NOT REPLY [Bug 26053] New: - org.apache.jasper.JasperException: Unknown attribute type ...

2004-01-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26053.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26053

org.apache.jasper.JasperException: Unknown attribute type ...

   Summary: org.apache.jasper.JasperException: Unknown attribute
type ...
   Product: Tomcat 5
   Version: 5.0.16
  Platform: Other
OS/Version: Windows XP
Status: NEW
  Severity: Major
  Priority: Other
 Component: Jasper
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


This error occurs if the rtexprvalue tag is used for a tag in a taglib.

See Example of the Struts.Html html:form tag.

attribute
  nameaction/name
  requiredtrue/required
  rtexprvaluetrue/rtexprvalue
  typeString/type
/attribute

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



DO NOT REPLY [Bug 26053] - org.apache.jasper.JasperException: Unknown attribute type ...

2004-01-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26053.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26053

org.apache.jasper.JasperException: Unknown attribute type ...

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID



--- Additional Comments From [EMAIL PROTECTED]  2004-01-12 10:08 ---
The proper type is java.lang.String.

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



DO NOT REPLY [Bug 20376] - Internet Explorer 6.0 Duplicate Requests IE PLEASE HELP

2004-01-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20376.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20376

Internet Explorer 6.0 Duplicate Requests IE PLEASE HELP





--- Additional Comments From [EMAIL PROTECTED]  2004-01-12 13:01 ---
As anyone tried a different browser

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



RE: About Book How Tomcat Works

2004-01-12 Thread Shapira, Yoav

Howdy,
FYI, the site works fine for me.  Good luck with the book, I hope it
sells well ;)

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Chris Wahl [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 10, 2004 2:15 PM
To: Tomcat Developers List
Subject: About Book How Tomcat Works

I found the following message in tomcat  mail-archive , but we can't
access
the
book's link for several months, anyone one know what happened  to
the great book?  or are there any article or book similar to this one,
I need some material to help me to start reading Tomcat's code.

Any infomation is highly appreciated.
TIA

As you know , here is the book's link.
www.brainysoftware.com


-mail begin
Remy Maucherat Tomcat Developers List [EMAIL PROTECTED]
Wed Jun 11 12:52:00 2003

budi wrote:
 Dear Tomcat Developers,
 I've been using Tomcat for years. It interested me so much that last
year
I spent three months reading the source code. I learned a lot, not
only
about how the servlet container works but also how to design Java
applications in general. I particularly liked the idea of valves and
pipelines, as well as the hierarchical containers. Knowing how Tomcat
works enables one to write better servlets too, IMO.

 I decided to share what I have learned in a book titled How Tomcat
Works.

Sounds great :)

I'll obviously add a link to your book on the resources page, and I'll
look at it when I have some time.

Remy
-mail end



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


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



Re: [PATCH]Virtual Host Choice on HTML Manager

2004-01-12 Thread TANAKA Yoshihiro
on Tue, 6 Jan 2004 16:48:47 -0600
Glenn Nielsen [EMAIL PROTECTED] wrote:

 I'll try to modify as follows:
 
 1)Make new classes extend HTMLManagerServlet  ManagerServlet.
 2)These servlets are optional. (commented out in web.xml)
 3)Only admin role can access them. (by web.xml)
 
 Do you think I've it figured out?

That sounds right. :-)

I've done and put them on
http://www.ytp.ne.jp/tech/tomcat/manager/index.html

I modified existing classes to allow them to be extended,
but did not change their functions.
Also I create a new build file for Deployer named 'build-muti.xml'
cause of security.

I hope committers evaluate and commit them.

Regards.
TANAKA Yoshihiro


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



Re: [PATCH]Virtual Host Choice on HTML Manager

2004-01-12 Thread Remy Maucherat
TANAKA Yoshihiro wrote:
on Tue, 6 Jan 2004 16:48:47 -0600
Glenn Nielsen [EMAIL PROTECTED] wrote:
I'll try to modify as follows:

1)Make new classes extend HTMLManagerServlet  ManagerServlet.
2)These servlets are optional. (commented out in web.xml)
3)Only admin role can access them. (by web.xml)
Do you think I've it figured out?
That sounds right. :-)
I've done and put them on
http://www.ytp.ne.jp/tech/tomcat/manager/index.html
I modified existing classes to allow them to be extended,
but did not change their functions.
Also I create a new build file for Deployer named 'build-muti.xml'
cause of security.
I hope committers evaluate and commit them.
While I appreciate the effort, I don't like your patch right now, sorry :-(

Why add complexity when it is so simple to deploy the manager webapp on 
a new host ? Note: A webapp doesn't use any noticeable amount of 
resources in TC 5 (no background thread, no nothing).
I suppose if there weren't all the changes to the default manager, I 
would have nothing against the patch (although I do hate the changes to 
the Ant tasks; it's really counter productive, and proves this is a bad 
design: the place of the vhost is in the URL).

Soon, there will be requests to add host management in the manager 
webapp, and it will become a big mess. If there's interest in improving 
the management tools, fine, but there should be a thinking process 
before the hacking starts.

Fixes were added a few days ago to the admin webapp to support dynamic 
host creation. This is a first step. It should then be possible to add a 
manager to a newly created host using the admin webapp (and then you're 
done, no hacks required). The biggest problem is probably that the admin 
webapp is not scriptable at all.

Rémy



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


Re: SECURITY BUG: No place to disable HTTP TRACE vulnerability

2004-01-12 Thread Remy Maucherat
Bill Barker wrote:
Bill Barker wrote:

Ok, this isn't right.  Tomcat defaults to NonLoginAuthenticator if there
is

no login-config.  This one just approves everybody for everything.
Ok. This isn't absolutely critical, but needs to be fixed.
I just tested this with a fresh build of everything, and it seems that
Tomcat is working fine.  I set allowTrace=true on the connector, and put
in a security-constraint to forbid TRACE in ROOT/WEB-INF/web.xml but no
login-config.  The result is a perfectly good 403 response to 'TRACE /
HTTP/1.0', and a perfectly good TRACE response to 'TRACE /jsp-examples/
HTTP/1.0'.
I'm afraid that you will have to provide a test case if you want to re-open
this issue ;-).  I'm resolving it as WORKSFORME.
Cool. That's the impression I had, but it wasn't a proper test, so I'm 
not too sure.

I was surprised to notice it wasn't possible to add the constraint to 
the default web.xml and be done.

Rémy



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


RE: Jk2 object model

2004-01-12 Thread Mike Anderson
I'm definitely interested in helping with this but feel I'm out of the loop a little.  
What areas would be best for me to research (JMX, jchannels, current mod_jk/mod_jk2 
architecture, etc.) to be the most help?  I'm somewhat familiar with the mod_jk stuff 
from supporting it on NetWare, and have started looking at mod_jk2 (it now mostly 
works on NetWare with Apache 2) but I know I'm behind in some of the other areas that 
have been mentioned.  Where can I help?

Mike Anderson

 [EMAIL PROTECTED] 1/11/2004 2:17:12 AM 
 

 From: Costin Manolache
 Sent: 11. sije*anj 2004 2:36
 To: Tomcat Developers List
 Subject: Re: Jk2 object model
 
  
  But this time I'd like to spend a month or so doing 'real' design 
  without the single line of code. If we manage to put and 
 describe our 
  needs on the paper, the coding itself will took 
 insignificant amount 
  of time. If this plan shows that 90% of the existing 
 codebase can be reused; even better.
 
  
 The first thing ( IMO ) is to decide on what improvements we 
 need on the lower layer so it can satisfy any additional 
 needs you may have - configuration, performance, integration 
 with a wider set of applications, etc.
 

We can do that for sure.
Depends on how we approach to the 'evolution'. We can either try to find out
how to 'adapt' the existing codebase or 'use' from the existing codebase.
I would like to see a design or plan, or what ever you name it, that
wouldn't limit itself from the start with the choose of JK, JK2 or webapp as
a starting point, but rather use all of them as a knowledge-base foundation.

Again, the major question is are there any developer needs and willing for
that.
I'll try to make some diagrams and some docs that will show what I have on
my mind. This may even show that I've completely 'miss the subject' :-).

MT.




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



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



RE: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardManager.java

2004-01-12 Thread Filip Hanik
I'll roll back, fix my editor, I just noticed that

Filip

-Original Message-
From: Remy Maucherat [mailto:[EMAIL PROTECTED]
Sent: Monday, January 12, 2004 12:16 AM
To: Tomcat Developers List
Subject: Re: cvs commit:
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session
StandardManager.java


[EMAIL PROTECTED] wrote:
 fhanik  2004/01/11 21:21:48

   Modified:catalina/src/share/org/apache/catalina Manager.java
catalina/src/share/org/apache/catalina/core
 StandardContext.java
catalina/src/share/org/apache/catalina/session
 StandardManager.java
   Log:
   Refactoring parts of the code. In order for custom managers
(such as the clustering managers) to take advantage of the
background threads that are already implemented, it is better to
have the Manager interface to expose the backgroundProcess method.
That way the context can invoke any other manager in a similar way.
   I opted for this way instead of using reflection. Yell if you
don't like it, and I will change it back.

-1.
You have to discuss this at least a little bit before making the
changes. It is unacceptable to make a change to the core interfaces without.

BTW, use a different editor, tweaks yours, or do tabs replacement (or
similar) in a separate commit: the diffs are unreadable.

Rémy


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


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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardManager.java

2004-01-12 Thread Remy Maucherat
Filip Hanik wrote:
I'll roll back, fix my editor, I just noticed that
Cool. Did you do anything more other than adding the new method ?
Anyway, roll back the changes as a whole, so that diffs work. I think 
cosmetic changes to the source code should be separate commits.

Rémy



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


RE: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardManager.java

2004-01-12 Thread Filip Hanik
nope that is it.
The method I added, and would still like to get buy in, is to add
backgroundProcess() as a method to the manager interface.
That way, any manager can take advantage of the background thread from the
context calling that method.
If we don't want to change the interface, we can either add in reflection
which I'm not a big fan of since I think managers should know what is going
on, or skip the backgroundProcess for custom managers, I'll just implement a
thread in the cluster instead.

what do you think?
Filip

-Original Message-
From: Remy Maucherat [mailto:[EMAIL PROTECTED]
Sent: Monday, January 12, 2004 10:32 AM
To: Tomcat Developers List
Subject: Re: cvs commit:
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session
StandardManager.java


Filip Hanik wrote:
 I'll roll back, fix my editor, I just noticed that

Cool. Did you do anything more other than adding the new method ?
Anyway, roll back the changes as a whole, so that diffs work. I think
cosmetic changes to the source code should be separate commits.

Rémy



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


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



RE: [PATCH]Virtual Host Choice on HTML Manager

2004-01-12 Thread George Sexton
Here is my thinking. Of course, I am a lowly user and not a developer
but I think it pretty much covers the issues. The major issues from my
perspective are:

1)  Admin cannot deploy privileged applications. This requires
deploying manager by hand.
2)  Admin cannot stop or restart applications. This requires using
manager. 
3)  Manager already displays the status for all virtual hosts. This
kind of breaks the virtual host purity that Remy and others want in this
application.
4)  Deployment of application using manager is difficult at best. I
have never been able to do it. Even if you can do it, there are no
configuration points. IOW, you cannot configure logging.
5)  As Remy points out, people will next be asking for manager to
manage virtual hosts.

The biggest issue for me is that if you want to use a UI to manage
tomcat, 3 different tools (Admin, Hand Edit, and Manager) must be used
to create a virtual host that can be stopped and restarted. Doesn't
anyone else see a problem with this?

If I had my way, what I would do is:

1)  Add capability for admin application to stop/start/re-start
contexts. This really shouldn't be that big a deal. I cannot see any
rationale for not putting it in. Additionally, I would put the status
reports in the Admin app. If you do this, then I don't really care about
the manager application and wouldn't even deploy it all.

2)  Strip every feature except list, status, stop, and re-start from
manager. IOW, remove the deployment capability and the complete server
status feature (or limit it to the virtual host). How many people REALLY
need to script deployment of a web application? Particularly in the
limited fashion allowed by the current Manager?

George Sexton
MH Software, Inc.
Home of Connect Daily Web Calendar Software
http://www.mhsoftware.com/connectdaily.htm
Voice: 303 438 9585



-Original Message-
From: Remy Maucherat [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 12, 2004 9:04 AM
To: Tomcat Developers List
Subject: Re: [PATCH]Virtual Host Choice on HTML Manager


TANAKA Yoshihiro wrote:
 on Tue, 6 Jan 2004 16:48:47 -0600
 Glenn Nielsen [EMAIL PROTECTED] wrote:
I'll try to modify as follows:

1)Make new classes extend HTMLManagerServlet  ManagerServlet.
2)These servlets are optional. (commented out in web.xml)
3)Only admin role can access them. (by web.xml)

Do you think I've it figured out?

That sounds right. :-)
 
 I've done and put them on
 http://www.ytp.ne.jp/tech/tomcat/manager/index.html
 
 I modified existing classes to allow them to be extended,
 but did not change their functions.
 Also I create a new build file for Deployer named 'build-muti.xml'
 cause of security.
 
 I hope committers evaluate and commit them.

While I appreciate the effort, I don't like your patch right now, sorry
:-(

Why add complexity when it is so simple to deploy the manager webapp on 
a new host ? Note: A webapp doesn't use any noticeable amount of 
resources in TC 5 (no background thread, no nothing).
I suppose if there weren't all the changes to the default manager, I 
would have nothing against the patch (although I do hate the changes to 
the Ant tasks; it's really counter productive, and proves this is a bad 
design: the place of the vhost is in the URL).

Soon, there will be requests to add host management in the manager 
webapp, and it will become a big mess. If there's interest in improving 
the management tools, fine, but there should be a thinking process 
before the hacking starts.

Fixes were added a few days ago to the admin webapp to support dynamic 
host creation. This is a first step. It should then be possible to add a

manager to a newly created host using the admin webapp (and then you're 
done, no hacks required). The biggest problem is probably that the admin

webapp is not scriptable at all.

Rémy



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


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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java

2004-01-12 Thread fhanik
fhanik  2004/01/12 10:44:05

  Modified:catalina/src/share/org/apache/catalina Manager.java
   catalina/src/share/org/apache/catalina/core
StandardContext.java
  Log:
  Rolled back changes to backgroundProcess
  
  Revision  ChangesPath
  1.5   +1 -7  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Manager.java
  
  Index: Manager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Manager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Manager.java  12 Jan 2004 05:21:48 -  1.4
  +++ Manager.java  12 Jan 2004 18:44:04 -  1.5
  @@ -186,7 +186,7 @@
* Get a session from the recycled ones or create a new empty one.
* The PersistentManager manager does not need to create session data
* because it reads it from the Store.
  - */
  + */ 
   public Session createEmptySession();
   
   /**
  @@ -260,11 +260,5 @@
*/
   public void unload() throws IOException;
   
  -/**
  - * This method will be invoked by the context/container on a periodic
  - * basis and allows the manager to implement
  - * a method that executes periodic tasks, such as expiring sessions etc.
  - */
  -public void backgroundProcess();
   
   }
  
  
  
  1.106 +124 -123  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- StandardContext.java  12 Jan 2004 05:21:48 -  1.105
  +++ StandardContext.java  12 Jan 2004 18:44:04 -  1.106
  @@ -71,7 +71,6 @@
   import java.io.InputStreamReader;
   import java.io.ObjectOutputStream;
   import java.io.Serializable;
  -import java.lang.reflect.Method;
   import java.net.URLDecoder;
   import java.util.ArrayList;
   import java.util.HashMap;
  @@ -207,14 +206,14 @@
   /**
* The set of instantiated application event listener objects/code.
*/
  -private transient Object applicationEventListenersObjects[] =
  +private transient Object applicationEventListenersObjects[] = 
   new Object[0];
   
   
   /**
* The set of instantiated application lifecycle listener objects/code.
*/
  -private transient Object applicationLifecycleListenersObjects[] =
  +private transient Object applicationLifecycleListenersObjects[] = 
   new Object[0];
   
   
  @@ -229,12 +228,12 @@
* The application available flag for this Context.
*/
   private boolean available = false;
  -
  +
   /**
  - * The broadcaster that sends j2ee notifications.
  + * The broadcaster that sends j2ee notifications. 
*/
   private NotificationBroadcasterSupport broadcaster = null;
  -
  +
   /**
* The Locale to character set mapper for this application.
*/
  @@ -304,7 +303,7 @@
   private String displayName = null;
   
   
  -/**
  +/** 
* Override the default web xml location. ContextConfig is not configurable
* so the setter is not used.
*/
  @@ -374,7 +373,7 @@
   /**
* The mapper associated with this context.
*/
  -private org.apache.tomcat.util.http.mapper.Mapper mapper =
  +private org.apache.tomcat.util.http.mapper.Mapper mapper = 
   new org.apache.tomcat.util.http.mapper.Mapper();
   
   
  @@ -492,7 +491,7 @@
* The notification sequence number.
*/
   private long sequenceNumber = 0;
  -
  +
   /**
* The status code error pages for this web application, keyed by
* HTTP status code (as an Integer).
  @@ -623,7 +622,7 @@
   private long tldScanTime;
   
   /** Name of the engine. If null, the domain is used.
  - */
  + */ 
   private String engineName = null;
   private String j2EEApplication=none;
   private String j2EEServer=none;
  @@ -1308,7 +1307,7 @@
   
   }
   
  -
  +
   /**
* Set the context path for this Context.
* p
  @@ -1646,9 +1645,9 @@
   
   /** Get the absolute path to the work dir.
*  To avoid duplication.
  - *
  + * 
* @return
  - */
  + */ 
   public String getWorkPath() {
   File workDir = new File(getWorkDir());
   if (!workDir.isAbsolute()) {
  @@ -1663,7 +1662,7 @@
   }
   return workDir.getAbsolutePath();
   }
  -
  +
   /**
* Return the work directory for this Context.

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves LocalStrings_es.properties

2004-01-12 Thread remm
remm2004/01/12 11:59:05

  Modified:catalina/src/share/org/apache/catalina/authenticator
LocalStrings_es.properties
   catalina/src/share/org/apache/catalina/realm
LocalStrings_es.properties
   catalina/src/share/org/apache/catalina/util
LocalStrings_es.properties
   catalina/src/share/org/apache/catalina/valves
LocalStrings_es.properties
  Added:   catalina/src/share/org/apache/catalina/startup
LocalStrings_es.properties
   catalina/src/share/org/apache/catalina/users
LocalStrings_es.properties
  Log:
  - Update spanish translation.
  - Submitted by Jesus Marin.
  
  Revision  ChangesPath
  1.2   +11 -9 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/LocalStrings_es.properties
  
  Index: LocalStrings_es.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/LocalStrings_es.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocalStrings_es.properties18 Jul 2002 16:48:02 -  1.1
  +++ LocalStrings_es.properties12 Jan 2004 19:59:05 -  1.2
  @@ -4,12 +4,14 @@
   
   
   authenticator.alreadyStarted=El interceptor de seguridad ya ha sido iniciado
  -authenticator.certificates=No hay cadena de certificados del cliente en esta 
peticion
  +authenticator.certificates=No hay cadena de certificados del cliente en esta 
petición
   authenticator.forbidden=El acceso al recurso pedido ha sido denegado
  -authenticator.invalid=No es valida la cadena de certificados del cliente en esta 
peticion
  -authenticator.keystore=Excepcion cargando el almacen de claves
  -authenticator.manager=Excepcion inicializando administradores de confianza
  -authenticator.notAuthenticated=Error de Configuracion: No se puede realizar 
funciones de control de acceso sin un principal autentificado
  -authenticator.notContext=Error de Configuracion: Debe estar unido a un Contexto
  -authenticator.notStarted=El Interceptor de seguridad no sido aun iniciado
  -authenticator.userDataConstraint=Esta peticion viola una Restricion de usuarion 
para esta aplicacion
  +authenticator.formlogin=Referencia directa al formulario de conexión (página de 
formulario de login) inválida
  +authenticator.invalid=No es válida la cadena de certificados del cliente en esta 
petición
  +authenticator.keystore=Excepción cargando el almacén de claves
  +authenticator.manager=Excepción inicializando administradores de confianza
  +authenticator.notAuthenticated=Error de Configuración: No se pueden realizar 
funciones de control de acceso sin un principal autenticado
  +authenticator.notContext=Error de Configuración: Debe de estar unido a un Contexto
  +authenticator.notStarted=El Interceptor de seguridad no sido aún iniciado
  +authenticator.unauthorized=Imposible autenticar mediante las credenciales 
suministradas
  +authenticator.userDataConstraint=Esta petición viola una Restrición de usuario para 
esta aplicación
  
  
  
  1.4   +1 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/LocalStrings_es.properties
  
  Index: LocalStrings_es.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/LocalStrings_es.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LocalStrings_es.properties12 Dec 2003 22:37:58 -  1.3
  +++ LocalStrings_es.properties12 Jan 2004 19:59:05 -  1.4
  @@ -6,7 +6,7 @@
   
   
   jaasRealm.accountExpired=El usuario {0} NO ha sido autentificado porque ha expirado 
su cuenta
  -jaasRealm.authenticateSuccess=El usuario {0} ha sido autentificado con éxito
  +jaasRealm.authenticatedSuccess=El usuario {0} ha sido autentificado con éxito
   jaasRealm.credentialExpired=El usuario {0} NO ha sido autentificado porque ha 
expirado su credencial
   jaasRealm.failedLogin=El usuario {0} NO ha sido autentificado porque ha fallado el 
login
   jaasRealm.loginException=Login exception authenticating username {0}
  
  
  
  1.1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/LocalStrings_es.properties
  
  Index: LocalStrings_es.properties
  ===
  contextConfig.applicationClose=Error durante el cierre del archivo web.xml de la 
aplicación
  contextConfig.applicationConfig=Errror de configuración en el archivo web.xml de la 
aplicación
  contextConfig.applicationListener=Excepción durante la creación de la clase de 
escucha (listener) {0}
  contextConfig.applicationMissing=Falta el archivo web.xml de 

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/res LocalStrings_es.properties

2004-01-12 Thread remm
remm2004/01/12 11:59:18

  Modified:util/java/org/apache/tomcat/util/buf/res
LocalStrings_es.properties
   util/java/org/apache/tomcat/util/http/res
LocalStrings_es.properties
  Log:
  - Update spanish translation.
  - Submitted by Jesus Marin.
  
  Revision  ChangesPath
  1.2   +2 -2  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/res/LocalStrings_es.properties
  
  Index: LocalStrings_es.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/res/LocalStrings_es.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocalStrings_es.properties9 Jun 2001 00:12:52 -   1.1
  +++ LocalStrings_es.properties12 Jan 2004 19:59:18 -  1.2
  @@ -1,4 +1,4 @@
   hexUtil.bad=Dígito hexadecimal incorrecto
  -hexUtil.odd=Numero de dígitos hexadecimales incorrecto
  -httpDate.pe=formato de fecha no valido: {0}
  +hexUtil.odd=Número de dígitos hexadecimales incorrecto
  +httpDate.pe=formato de fecha no válido: {0}
   
  
  
  
  1.2   +6 -6  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/res/LocalStrings_es.properties
  
  Index: LocalStrings_es.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/res/LocalStrings_es.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocalStrings_es.properties9 Jun 2001 00:12:55 -   1.1
  +++ LocalStrings_es.properties12 Jan 2004 19:59:18 -  1.2
  @@ -7,13 +7,13 @@
   sc.204=Sin Contenido
   sc.205=Reset Contenido
   sc.206=Contenido Parcial
  -sc.300=Multiples Elecciones
  +sc.300=Múltiples Elecciones
   sc.301=Movido permanentemente
  -sc.302=Movido temporalmente
  +sc.302=Movido temporálmente
   sc.303=Mirar Otro
   sc.304=No Modificado
   sc.305=Usar Proxy
  -sc.307=Redireccion Temporal
  +sc.307=Redirección Temporal
   sc.400=Petición incorrecta
   sc.401=No Autorizado
   sc.402=Pago requerido
  @@ -24,7 +24,7 @@
   sc.407=Autentificación Proxy Requerida
   sc.408=Request Caducada
   sc.409=Conflicto
  -sc.410=Gone
  +sc.410=Ido
   sc.411=Longitud Requerida
   sc.412=Precondición Fallada
   sc.413=Entidad de Request Demasiado Grande
  @@ -34,7 +34,7 @@
   sc.417=Expectativa Fallada
   sc.500=Error Interno del Servidor
   sc.501=No Implementado
  -sc.502=Gateway Incorrecto
  +sc.502=Pasarela Incorrecta
   sc.503=Servicio no Disponible
  -sc.504=Gateway Caducada
  +sc.504=Pasarela Caducada
   sc.505=Versión de HTTP No Soportada
  
  
  

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



DO NOT REPLY [Bug 26039] - spanish translations

2004-01-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26039.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26039

spanish translations

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED



--- Additional Comments From [EMAIL PROTECTED]  2004-01-12 20:01 ---
Fixed. Thanks. Indeed, submitting a diff is a lot better.

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



DO NOT REPLY [Bug 25363] - request.getAttributeNames() not working properly

2004-01-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25363.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25363

request.getAttributeNames() not working properly

[EMAIL PROTECTED] changed:

   What|Removed |Added

  Component|Connector:AJP   |Catalina

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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardManager.java

2004-01-12 Thread Remy Maucherat
Filip Hanik wrote:
nope that is it.
The method I added, and would still like to get buy in, is to add
backgroundProcess() as a method to the manager interface.
That way, any manager can take advantage of the background thread from the
context calling that method.
If we don't want to change the interface, we can either add in reflection
which I'm not a big fan of since I think managers should know what is going
on, or skip the backgroundProcess for custom managers, I'll just implement a
thread in the cluster instead.
what do you think?
I think I'm +0 on adding this.

Rémy

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


cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp AsyncSocketSender.java SimpleTcpCluster.java SocketSender.java ThreadPool.java

2004-01-12 Thread fhanik
fhanik  2004/01/12 16:07:18

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/mcast
McastServiceImpl.java
   modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaManager.java DeltaRequest.java
ReplicationStream.java
   modules/cluster/src/share/org/apache/catalina/cluster/tcp
AsyncSocketSender.java SimpleTcpCluster.java
SocketSender.java ThreadPool.java
  Log:
  Performance optimization:
  1. When you know what class loader to use, use it, huge performance improvement
  2. Use the Externalizable interface to control what gets serialized
  Name the threads so that we can differentiate them better when profiling
  
  Revision  ChangesPath
  1.6   +10 -4 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/mcast/McastServiceImpl.java
  
  Index: McastServiceImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/mcast/McastServiceImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- McastServiceImpl.java 18 Dec 2003 04:20:14 -  1.5
  +++ McastServiceImpl.java 13 Jan 2004 00:07:18 -  1.6
  @@ -246,6 +246,10 @@
   
   
   public class ReceiverThread extends Thread {
  +public ReceiverThread() {
  +super();
  +setName(Cluster-MembershipReceiver);
  +}
   public void run() {
   while ( doRun ) {
   try {
  @@ -261,6 +265,8 @@
   long time;
   public SenderThread(long time) {
   this.time = time;
  +setName(Cluster-MembershipSender);
  +
   }
   public void run() {
   while ( doRun ) {
  
  
  
  1.4   +4 -5  
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DeltaManager.java 12 Jan 2004 07:50:06 -  1.3
  +++ DeltaManager.java 13 Jan 2004 00:07:18 -  1.4
  @@ -441,7 +441,6 @@
   
   // Initialize our internal data structures
   //sessions.clear(); //should not do this
  -
   // Open an input stream to the specified pathname, if any
   ByteArrayInputStream fis = null;
   ObjectInputStream ois = null;
  
  
  
  1.3   +74 -10
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaRequest.java
  
  Index: DeltaRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaRequest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeltaRequest.java 12 Jan 2004 07:50:06 -  1.2
  +++ DeltaRequest.java 13 Jan 2004 00:07:18 -  1.3
  @@ -71,15 +71,15 @@
* @version 1.0
*/
   
  -import java.util.Vector;
  +import java.util.LinkedList;
   import javax.servlet.http.HttpSession;
  -import java.io.Serializable;
  +import java.io.Externalizable;
   import java.security.Principal;
   import org.apache.catalina.realm.GenericPrincipal;
   import org.apache.catalina.cluster.ClusterSession;
   
   
  -public class DeltaRequest implements Serializable {
  +public class DeltaRequest implements Externalizable {
   
   public static final int TYPE_ATTRIBUTE = 0;
   public static final int TYPE_PRINCIPAL = 1;
  @@ -94,9 +94,13 @@
   public static final String NAME_ISNEW = __SET__ISNEW__;
   
   private String sessionId;
  -private Vector actions = new Vector();
  +private LinkedList actions = new LinkedList();
   private boolean recordAllActions = false;
   
  +public DeltaRequest() {
  +
  +}
  +
   public DeltaRequest(String sessionId, boolean recordAllActions) {
   this.recordAllActions=recordAllActions;
   setSessionId(sessionId);
  @@ -141,7 +145,7 @@
   //we don't send multiple actions across the wire
   if ( !recordAllActions) actions.remove(info);
   //add the action
  -actions.addElement(info);
  +actions.addLast(info);
   }
   
   public void execute(ClusterSession session) {
  @@ -194,13 +198,48 @@
   public int getSize() {
   return actions.size();
   }
  +
  +public void readExternal(java.io.ObjectInput in ) throws java.io.IOException,
  +java.lang.ClassNotFoundException {
  +

Help, please! :)

2004-01-12 Thread Yakov Belov
Dear All,

it is me again.

The full story is, that I get the stacktrace only if I uncomment the /ROOT
context tag in the server.xml file.

But if I leave everything as it was, I don't get any exceptions, but also
none of my aspplications get installed, which sux. However if I try to
manually install them using manager application, which runs, thank god, I
get get the same error:

FAIL - Encountered exception java.lang.NoClassDefFoundError:
org/apache/naming/JndiPermission

This is why I attempted to uncomment the /ROOT context tag. But it didn't
work.

So, why are my applications not able to be installed ?

Regards,
Yakov

- Original Message - 
From: Yakov Belov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 12, 2004 6:01 PM
Subject: All of a sudden Catalina can not start.


Dear All,

I have Tomcat 4.1.29 and untill today I had no problems with it.

Today I decided to restart it (silly me) and Tomcat won't start, but shows
the following stack trace:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Caused by: java.lang.NoClassDefFoundError: org/apache/naming/JndiPermission

so, I think what is happening, is that server.xml is being processed and for
some reason JndiPermission.class, which is in bootstrap.jar, is not seen.
How can I tell Tomcat where to look? I have created a CLASSPATH variable,
but I am not sure if it is used.

I looked on the web and noticed other people having the same problem, but
not too many answers to it.

Can someone help?

Regards,
Yakov


RE: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardManager.java

2004-01-12 Thread Filip Hanik
ok, if no one else objects, I'll add this in.

Filip

-Original Message-
From: [mailto:[EMAIL PROTECTED]
Sent: Monday, January 12, 2004 12:12 PM
To: Tomcat Developers List
Subject: Re: cvs commit:
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session
StandardManager.java


Filip Hanik wrote:
 nope that is it.
 The method I added, and would still like to get buy in, is to add
 backgroundProcess() as a method to the manager interface.
 That way, any manager can take advantage of the background thread from the
 context calling that method.
 If we don't want to change the interface, we can either add in reflection
 which I'm not a big fan of since I think managers should know
what is going
 on, or skip the backgroundProcess for custom managers, I'll just
implement a
 thread in the cluster instead.

 what do you think?

I think I'm +0 on adding this.

Rémy


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


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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java

2004-01-12 Thread fhanik
fhanik  2004/01/12 17:39:36

  Modified:catalina/src/share/org/apache/catalina Manager.java
   catalina/src/share/org/apache/catalina/core
StandardContext.java
  Log:
  Added in the method backgroundProcess() to the manager interface.
  This allows any context to invoke the method on any custom manager
  and allow the manager to have a thread less back ground process, for example for 
expiring sessions.
  The CVS diffs should be cleaner now, had to fix my IDE.
  
  Revision  ChangesPath
  1.6   +12 -4 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Manager.java
  
  Index: Manager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Manager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Manager.java  12 Jan 2004 18:44:04 -  1.5
  +++ Manager.java  13 Jan 2004 01:39:36 -  1.6
  @@ -259,6 +259,14 @@
* @exception IOException if an input/output error occurs
*/
   public void unload() throws IOException;
  +
  + /**
  +  * This method will be invoked by the context/container on a periodic
  +  * basis and allows the manager to implement
  +  * a method that executes periodic tasks, such as expiring sessions etc.
  +  */
  + public void backgroundProcess();
  +
   
   
   }
  
  
  
  1.107 +5 -7  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- StandardContext.java  12 Jan 2004 18:44:04 -  1.106
  +++ StandardContext.java  13 Jan 2004 01:39:36 -  1.107
  @@ -4571,12 +4571,10 @@
   count = (count + 1) % managerChecksFrequency;
   
   if ((getManager() != null)  (count == 0)) {
  -if (getManager() instanceof StandardManager) {
  -((StandardManager) getManager()).processExpires();
  -} else if (getManager() instanceof PersistentManagerBase) {
  -PersistentManagerBase pManager = 
  -(PersistentManagerBase) getManager();
  -pManager.backgroundProcess();
  +try {
  +getManager().backgroundProcess();
  +} catch ( Exception x ) {
  +log.warn(Unable to perform background process on manager,x);
   }
   }
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp PooledSocketSender.java ReplicationTransmitter.java SimpleTcpCluster.java

2004-01-12 Thread fhanik
fhanik  2004/01/12 20:22:28

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaManager.java DeltaRequest.java
DeltaSession.java
   modules/cluster/src/share/org/apache/catalina/cluster/tcp
PooledSocketSender.java ReplicationTransmitter.java
SimpleTcpCluster.java
  Log:
  Fixed a bug in a dead lock with the pooled socket sender when a member crashes
  Recycling the delta request objects to avoid object instantiation, although I 
actually think this is slower
  Fixed the call back with the session and the delta request execution
  
  Revision  ChangesPath
  1.5   +9 -10 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeltaManager.java 13 Jan 2004 00:07:18 -  1.4
  +++ DeltaManager.java 13 Jan 2004 04:22:28 -  1.5
  @@ -406,24 +406,23 @@
   }
   
   
  -private DeltaRequest loadDeltaRequest(byte[] data) throws
  +private DeltaRequest loadDeltaRequest(DeltaSession session, byte[] data) throws
   ClassNotFoundException, IOException {
   ByteArrayInputStream fis = null;
   ReplicationStream ois = null;
   Loader loader = null;
   ClassLoader classLoader = null;
   fis = new ByteArrayInputStream(data);
  -BufferedInputStream bis = new BufferedInputStream(fis);
   ois = new ReplicationStream(fis,container.getLoader().getClassLoader());
  -DeltaRequest dreq = (DeltaRequest)ois.readObject();
  +session.getDeltaRequest().readExternal(ois);
   ois.close();
  -return dreq;
  +return session.getDeltaRequest();
   }
   
   private byte[] unloadDeltaRequest(DeltaRequest deltaRequest) throws IOException 
{
   ByteArrayOutputStream bos = new ByteArrayOutputStream();
   ObjectOutputStream oos = new ObjectOutputStream(bos);
  -oos.writeObject(deltaRequest);
  +deltaRequest.writeExternal(oos);
   oos.flush();
   oos.close();
   return bos.toByteArray();
  @@ -874,8 +873,8 @@
  }
  case SessionMessage.EVT_SESSION_DELTA : {
  byte[] delta = msg.getSession();
  -   DeltaRequest dreq = loadDeltaRequest(delta);
  DeltaSession session = 
(DeltaSession)findSession(msg.getSessionID());
  +   DeltaRequest dreq = loadDeltaRequest(session,delta);
  dreq.execute(session);
  session.setPrimarySession(false);
  
  
  
  
  1.4   +71 -23
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaRequest.java
  
  Index: DeltaRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaRequest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DeltaRequest.java 13 Jan 2004 00:07:18 -  1.3
  +++ DeltaRequest.java 13 Jan 2004 04:22:28 -  1.4
  @@ -66,7 +66,9 @@
   
   /**
* This class is used to track the series of actions that happens when
  - * a request is executed. These actions will then
  + * a request is executed. These actions will then translate into invokations of 
methods 
  + * on the actual session.
  + * This class is NOT thread safe. One DeltaRequest per session
* @author a href=mailto:[EMAIL PROTECTED]Filip Hanik/a
* @version 1.0
*/
  @@ -95,6 +97,8 @@
   
   private String sessionId;
   private LinkedList actions = new LinkedList();
  +private LinkedList actionPool = new LinkedList();
  +
   private boolean recordAllActions = false;
   
   public DeltaRequest() {
  @@ -140,7 +144,13 @@
int action,
String name,
Object value) {
  -AttributeInfo info = new AttributeInfo(type,action,name,value);
  +AttributeInfo info = null;
  +if ( this.actionPool.size()  0 ) {
  +info = (AttributeInfo)actionPool.removeFirst();
  +info.init(type,action,name,value);
  +} else {
  +info = new AttributeInfo(type, action, name, value);
  +}
   //if we have already done something to this attribute, make sure
   //we don't send multiple actions across the wire
   if ( !recordAllActions) 

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java

2004-01-12 Thread billbarker
billbarker2004/01/12 20:58:35

  Modified:util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  Move the call to setSocketOptions to prevent a potential DoS condition when using 
SSL.
  
  Reported By: Alex Chan [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.29  +4 -5  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- PoolTcpEndpoint.java  24 Nov 2003 23:01:21 -  1.28
  +++ PoolTcpEndpoint.java  13 Jan 2004 04:58:34 -  1.29
  @@ -574,7 +574,7 @@
   }
   }
if (null != s) {
  - 
  +endpoint.setSocketOptions( s );
try {
if(endpoint.getServerSocketFactory()!=null) {
   endpoint.getServerSocketFactory().handshake(s);
  @@ -601,7 +601,6 @@

con.setEndpoint(endpoint);
con.setSocket(s);
  - endpoint.setSocketOptions( s );
endpoint.getConnectionHandler().processConnection(con, perThrData);
   } catch (SocketException se) {
   endpoint.log.error(
  
  
  

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



Re: SSL Socket does not timeout when no handshake occurs

2004-01-12 Thread Bill Barker
Your patch has been applied, and will be available in TC 5.0.17  4.1.30.

- Original Message - 
From: Alex Chan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 11, 2004 9:40 PM
Subject: SSL Socket does not timeout when no handshake occurs


 I have found that if a connection is initiated on the SSL port but the
 client does not participate in the SSL handshake, the socket seems to hang
 around indefinitely. The test I used was to telnet to the secure port
 without typing/sending any further data.

 When doing the same to the non-secure port, the socket will timeout
 according to the connectionTimeout parameter.

 I noticed in the code PoolTcpEndPoint.java, in the TcpWorkerThread.runIt()
 method, that
 endpoint.setSocketOptions(s) is called after
 endpoint.getServerSocketFactory().handshake(s).
 I tried moving the call to setSocketOptions() before handshake() and the
SSL
 socket times out according to the connectionTimeout.

 As I am a relatively new Tomcat user, I'm not sure what are the
 impact/implications of this change.
 Any feedback, particularly as to whether you agree this is a problem,
would
 be most appreciated.

 Thanks in advance,
 - Alex



This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

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

cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp ReplicationValve.java SimpleTcpCluster.java

2004-01-12 Thread fhanik
fhanik  2004/01/12 21:26:59

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaManager.java DeltaSession.java
   modules/cluster/src/share/org/apache/catalina/cluster/tcp
ReplicationValve.java SimpleTcpCluster.java
  Log:
  Implemented distributed expiration of sessions.
  
  Revision  ChangesPath
  1.6   +14 -7 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DeltaManager.java 13 Jan 2004 04:22:28 -  1.5
  +++ DeltaManager.java 13 Jan 2004 05:26:59 -  1.6
  @@ -808,6 +808,14 @@
  }
  
  }
  +   
  +   protected void sessionExpired(String id) {
  +   SessionMessage msg = new SessionMessage(getName(), 
  +   
SessionMessage.EVT_SESSION_EXPIRED,
  +   null,
  +   id);
  +   cluster.send(msg);
  +   }
  
  /**
   * When the manager expires session not tied to a request.
  @@ -856,10 +864,9 @@
  break;
  }
  case SessionMessage.EVT_SESSION_EXPIRED: {
  -   Session session = findSession(msg.getSessionID());
  +   DeltaSession session = 
(DeltaSession)findSession(msg.getSessionID());
  if (session != null) {
  -   session.expire();
  -   this.remove(session);
  +   session.expire(true,false);
  } //end if
  break;
  }
  
  
  
  1.8   +29 -11
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java
  
  Index: DeltaSession.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DeltaSession.java 13 Jan 2004 04:22:28 -  1.7
  +++ DeltaSession.java 13 Jan 2004 05:26:59 -  1.8
  @@ -347,7 +347,7 @@
* @param primarySession
*/
   public void setPrimarySession(boolean primarySession) {
  -   this.isPrimarySession=primarySession;
  +this.isPrimarySession=primarySession;
   }
   
   /**
  @@ -543,7 +543,7 @@
   if (isValid  interval == 0) {
   expire();
   } else {
  -if ( addDeltaRequest ) deltaRequest.setMaxInactiveInterval(interval);
  +if ( addDeltaRequest  (deltaRequest!=null) ) 
deltaRequest.setMaxInactiveInterval(interval);
   }
   
   }
  @@ -559,7 +559,7 @@
   }
   public void setNew(boolean isNew, boolean addDeltaRequest) {
   this.isNew = isNew;
  -if (addDeltaRequest) deltaRequest.setNew(isNew);
  +if (addDeltaRequest  (deltaRequest!=null)) deltaRequest.setNew(isNew);
   }
   
   
  @@ -592,7 +592,7 @@
   Principal oldPrincipal = this.principal;
   this.principal = principal;
   support.firePropertyChange(principal, oldPrincipal, this.principal);
  -if (addDeltaRequest) deltaRequest.setPrincipal(principal);
  +if (addDeltaRequest  (deltaRequest!=null)) 
deltaRequest.setPrincipal(principal);
   }
   
   
  @@ -624,6 +624,8 @@
*/
   public boolean isValid() {
   
  +
  +
   if (this.expiring){
   return true;
   }
  @@ -631,12 +633,16 @@
   if (!this.isValid ) {
   return false;
   }
  -
  +
   if (maxInactiveInterval = 0) {
   long timeNow = System.currentTimeMillis();
   int timeIdle = (int) ((timeNow - lastAccessedTime) / 1000L);
   if ( (timeIdle = maxInactiveInterval)  (isPrimarySession()) ) {
   expire(true);
  +} else if ( timeIdle = (2*maxInactiveInterval) ) {
  +//if the session has been idle twice as long as allowed,
  +//the primary session has probably crashed
  +expire(true);
   }
   }
   
  @@ -704,10 +710,16 @@
*  this session?
*/
   public void expire(boolean notify) {
  +expire(notify,true);
  +}
  +
  +public void expire(boolean notify, boolean notifyCluster) {
   
   // Mark this 

cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp PooledSocketSender.java

2004-01-12 Thread fhanik
fhanik  2004/01/12 21:46:21

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/tcp
PooledSocketSender.java
  Log:
  print out a warning if no socket is returned from the pool and we are still connected
  
  Revision  ChangesPath
  1.3   +11 -5 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/PooledSocketSender.java
  
  Index: PooledSocketSender.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/PooledSocketSender.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PooledSocketSender.java   13 Jan 2004 04:22:28 -  1.2
  +++ PooledSocketSender.java   13 Jan 2004 05:46:21 -  1.3
  @@ -86,9 +86,9 @@
   private InetAddress address;
   private int port;
   private Socket sc = null;
  -private boolean isSocketConnected = false;
  +private boolean isSocketConnected = true;
   private boolean suspect;
  -private long ackTimeout = 150*1000;  //15 seconds socket read timeout (for 
acknowledgement)
  +private long ackTimeout = 15*1000;  //15 seconds socket read timeout (for 
acknowledgement)
   private long keepAliveTimeout = 60*1000; //keep socket open for no more than 
one min
   private int keepAliveMaxRequestCount = 100; //max 100 requests before 
reconnecting
   private long keepAliveConnectTime = 0;
  @@ -118,11 +118,13 @@
   {
   //do nothing, happens in the socket sender itself
   senderQueue.open();
  +isSocketConnected = true;
   }
   
   public void disconnect()
   {
   senderQueue.close();
  +isSocketConnected = false;
   }
   
   public boolean isConnected()
  @@ -156,6 +158,10 @@
   {
   //get a socket sender from the pool
   SocketSender sender = senderQueue.getSender(0);
  +if ( sender == null  isConnected() ) {
  +log.warn(No socket sender available for 
client=+this.getAddress()+:+this.getPort());
  +return;
  +}//end if
   //send the message
   sender.sendMessage(sessionId,data);
   //return the connection to the pool
  
  
  

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



cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp SimpleTcpCluster.java

2004-01-12 Thread fhanik
fhanik  2004/01/12 21:58:25

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/tcp
SimpleTcpCluster.java
  Log:
  Changing the default manager to be DeltaManager.
  
  Revision  ChangesPath
  1.28  +5 -5  
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
  
  Index: SimpleTcpCluster.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- SimpleTcpCluster.java 13 Jan 2004 05:26:59 -  1.27
  +++ SimpleTcpCluster.java 13 Jan 2004 05:58:25 -  1.28
  @@ -272,7 +272,7 @@
   private long msgSendTime = 0;
   private long lastChecked = System.currentTimeMillis();
   private boolean isJdk13 = false;
  -private String managerClassName = 
org.apache.catalina.cluster.session.SimpleTcpReplicationManager;
  +private String managerClassName = 
org.apache.catalina.cluster.session.DeltaManager;
   
   // - Properties
   
  
  
  

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