Re: [VOTE] Release build 6.0.30

2011-01-13 Thread jean-frederic clere

According to the results 6.0.30 is going to be released as STABLE.

Cheers

Jean-Frederic

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1058510 - /tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java

2011-01-13 Thread markt
Author: markt
Date: Thu Jan 13 11:14:11 2011
New Revision: 1058510

URL: http://svn.apache.org/viewvc?rev=1058510view=rev
Log:
Remove unused code

Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java?rev=1058510r1=1058509r2=1058510view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java Thu Jan 13 
11:14:11 2011
@@ -64,16 +64,6 @@ public final class Mapper {
 
 
 /**
- * Get default host.
- *
- * @return Default host name
- */
-public String getDefaultHostName() {
-return defaultHostName;
-}
-
-
-/**
  * Set default host.
  *
  * @param defaultHostName Default host name
@@ -1509,7 +1499,6 @@ public final class Mapper {
 protected static class Wrapper
 extends MapElement {
 
-public String path = null;
 public boolean jspWildCard = false;
 public boolean resourceOnly = false;
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Deploying new Applications

2011-01-13 Thread Jamie

Greetings!

I have a custom Tomcat Manager app that I am using for managing various 
web app instances. I am using the method:


/**
 * Invoke the addServiced method on the deployer.
 */
protected void addServiced(String name)
throws Exception {
String[] params = { name };
String[] signature = { java.lang.String };
mBeanServer.invoke(oname, addServiced, params, signature);
}


borrowed from the Manager app to create a new web application. I'd like 
to set the display name on the Context as follows:


 Context context = (Context) host.findChild(name);
if (context != null  context.getConfigured()) {
logger.debug(Application deployed);
System.out.println(Application deployed);
context.setDisplayName(application.getDisplayName());
}

This works, but is not persistent. i.e. when tomcat is restarted the 
display name is taken from the context.xml file.

Is there any way for Tomcat to set a persistent display name?

Thanks in advance

Jamie


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1058551 - /tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java

2011-01-13 Thread markt
Author: markt
Date: Thu Jan 13 13:43:18 2011
New Revision: 1058551

URL: http://svn.apache.org/viewvc?rev=1058551view=rev
Log:
Refactor to simplify code and avoid a Findbugs warning

Modified:
tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java

Modified: 
tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java?rev=1058551r1=1058550r2=1058551view=diff
==
--- tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java 
Thu Jan 13 13:43:18 2011
@@ -45,17 +45,13 @@ public class ChannelCoordinator extends 
 private ChannelSender clusterSender = new ReplicationTransmitter();
 private MembershipService membershipService = new McastService();
 
-//override optionflag
-protected int optionFlag = 
Channel.SEND_OPTIONS_BYTE_MESSAGE|Channel.SEND_OPTIONS_USE_ACK|Channel.SEND_OPTIONS_SYNCHRONIZED_ACK;
-@Override
-public int getOptionFlag() {return optionFlag;}
-@Override
-public void setOptionFlag(int flag) {optionFlag=flag;}
-
 private int startLevel = 0;
 
 public ChannelCoordinator() {
-
+// Override default
+this.optionFlag = Channel.SEND_OPTIONS_BYTE_MESSAGE |
+Channel.SEND_OPTIONS_USE_ACK |
+Channel.SEND_OPTIONS_SYNCHRONIZED_ACK;
 }
 
 public ChannelCoordinator(ChannelReceiver receiver,



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1058556 - /tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java

2011-01-13 Thread markt
Author: markt
Date: Thu Jan 13 13:54:08 2011
New Revision: 1058556

URL: http://svn.apache.org/viewvc?rev=1058556view=rev
Log:
Fix FindBugs warning
Remove unnecessary code
Better error handling

Modified:
tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java

Modified: tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java?rev=1058556r1=1058555r2=1058556view=diff
==
--- tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java Thu 
Jan 13 13:54:08 2011
@@ -31,7 +31,6 @@ import org.apache.catalina.Engine;
 import org.apache.catalina.Globals;
 import org.apache.catalina.Host;
 import org.apache.catalina.LifecycleException;
-import org.apache.catalina.ha.CatalinaCluster;
 import org.apache.catalina.ha.ClusterDeployer;
 import org.apache.catalina.ha.ClusterListener;
 import org.apache.catalina.ha.ClusterMessage;
@@ -69,8 +68,6 @@ public class FarmWarDeployer extends Clu
 private static final String info = FarmWarDeployer/1.2;
 
 /*--Instance Variables--*/
-protected CatalinaCluster cluster = null;
-
 protected boolean started = false; //default 5 seconds
 
 protected HashMapString, FileMessageFactory fileFactories =
@@ -244,7 +241,11 @@ public class FarmWarDeployer extends Clu
 addServiced(path);
 try {
 remove(path);
-factory.getFile().renameTo(deployable);
+if (!factory.getFile().renameTo(deployable)) {
+log.error(Failed to rename [ +
+factory.getFile() + ] to [ +
+deployable + ]);
+}
 check(path);
 } finally {
 removeServiced(path);
@@ -541,11 +542,15 @@ public class FarmWarDeployer extends Clu
 File dir = new File(getAppBase(), baseName);
 File xml = new File(configBase, baseName + .xml);
 if (war.exists()) {
-war.delete();
+if (!war.delete()) {
+log.error(Failed to delete [ + war + ]);
+}
 } else if (dir.exists()) {
 undeployDir(dir);
 } else {
-xml.delete();
+if (!xml.delete()) {
+log.error(Failed to delete [ + xml + ]);
+}
 }
 // Perform new deployment and remove internal HostConfig state
 check(path);
@@ -571,11 +576,14 @@ public class FarmWarDeployer extends Clu
 if (file.isDirectory()) {
 undeployDir(file);
 } else {
-file.delete();
+if (!file.delete()) {
+log.error(Failed to delete [ + file + ]);
+}
 }
 }
-dir.delete();
-
+if (!dir.delete()) {
+log.error(Failed to delete [ + dir + ]);
+}
 }
 
 /*
@@ -636,16 +644,6 @@ public class FarmWarDeployer extends Clu
 
 /*--Instance Getters/Setters*/
 @Override
-public CatalinaCluster getCluster() {
-return cluster;
-}
-
-@Override
-public void setCluster(CatalinaCluster cluster) {
-this.cluster = cluster;
-}
-
-@Override
 public boolean equals(Object listener) {
 return super.equals(listener);
 }
@@ -722,8 +720,12 @@ public class FarmWarDeployer extends Clu
  */
 protected boolean copy(File from, File to) {
 try {
-if (!to.exists())
-to.createNewFile();
+if (!to.exists()) {
+if (!to.createNewFile()) {
+log.error(Unable to create [ + to + ]);
+return false;
+}
+}
 java.io.FileInputStream is = new java.io.FileInputStream(from);
 java.io.FileOutputStream os = new java.io.FileOutputStream(to,
 false);



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1058562 - /tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java

2011-01-13 Thread markt
Author: markt
Date: Thu Jan 13 14:01:58 2011
New Revision: 1058562

URL: http://svn.apache.org/viewvc?rev=1058562view=rev
Log:
Remove unused/unnecessary code

Modified:
tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java?rev=1058562r1=1058561r2=1058562view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java Thu 
Jan 13 14:01:58 2011
@@ -84,7 +84,6 @@ public class InternalNioInputBuffer exte
  * Parsing state - used for non blocking parsing so that
  * when more data arrives, we can pick up where we left off.
  */
-protected boolean parsingHeader;
 protected boolean parsingRequestLine;
 protected int parsingRequestLinePhase = 0;
 protected boolean parsingRequestLineEol = false;
@@ -131,15 +130,6 @@ public class InternalNioInputBuffer exte
 
 // - Public Methods
 /**
- * Returns true if there are bytes available from the socket layer
- * @return boolean
- * @throws IOException
- */
-public boolean isReadable() throws IOException {
-return (pos  lastValid) || (nbRead()0);
-}
-
-/**
  * Issues a non blocking read
  * @return int
  * @throws IOException
@@ -179,7 +169,6 @@ public class InternalNioInputBuffer exte
 @Override
 public void nextRequest() {
 super.nextRequest();
-parsingHeader = true;
 headerParsePos = HeaderParsePosition.HEADER_START;
 parsingRequestLine = true;
 parsingRequestLinePhase = 0;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1058571 - /tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java

2011-01-13 Thread markt
Author: markt
Date: Thu Jan 13 14:08:24 2011
New Revision: 1058571

URL: http://svn.apache.org/viewvc?rev=1058571view=rev
Log:
Fix FindBugs warnings

Modified:
tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java

Modified: 
tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java?rev=1058571r1=1058570r2=1058571view=diff
==
--- tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java 
Thu Jan 13 14:08:24 2011
@@ -178,12 +178,6 @@ public abstract class PersistentManagerB
 
 
 /**
- * Processing time during session expiration and passivation.
- */
-protected long processingTime = 0;
-
-
-/**
  * Sessions currently being swapped in and the associated locks
  */
 private final MapString,Object sessionSwapInLocks =
@@ -232,8 +226,8 @@ public abstract class PersistentManagerB
 int oldBackup = this.maxIdleBackup;
 this.maxIdleBackup = backup;
 support.firePropertyChange(maxIdleBackup,
-   new Integer(oldBackup),
-   new Integer(this.maxIdleBackup));
+   Integer.valueOf(oldBackup),
+   Integer.valueOf(this.maxIdleBackup));
 
 }
 
@@ -260,8 +254,8 @@ public abstract class PersistentManagerB
 int oldMaxIdleSwap = this.maxIdleSwap;
 this.maxIdleSwap = max;
 support.firePropertyChange(maxIdleSwap,
-   new Integer(oldMaxIdleSwap),
-   new Integer(this.maxIdleSwap));
+   Integer.valueOf(oldMaxIdleSwap),
+   Integer.valueOf(this.maxIdleSwap));
 
 }
 
@@ -290,8 +284,8 @@ public abstract class PersistentManagerB
 int oldMinIdleSwap = this.minIdleSwap;
 this.minIdleSwap = min;
 support.firePropertyChange(minIdleSwap,
-   new Integer(oldMinIdleSwap),
-   new Integer(this.minIdleSwap));
+   Integer.valueOf(oldMinIdleSwap),
+   Integer.valueOf(this.minIdleSwap));
 
 }
 
@@ -901,7 +895,8 @@ public abstract class PersistentManagerB
 if (log.isDebugEnabled())
 log.debug(sm.getString
 (persistentManager.swapMaxIdle,
- session.getIdInternal(), new 
Integer(timeIdle)));
+ session.getIdInternal(),
+ Integer.valueOf(timeIdle)));
 try {
 swapOut(session);
 } catch (IOException e) {
@@ -932,7 +927,7 @@ public abstract class PersistentManagerB
 if(log.isDebugEnabled())
 log.debug(sm.getString
 (persistentManager.tooManyActive,
- new Integer(sessions.length)));
+ Integer.valueOf(sessions.length)));
 
 int toswap = sessions.length - getMaxActiveSessions();
 long timeNow = System.currentTimeMillis();
@@ -951,7 +946,8 @@ public abstract class PersistentManagerB
 if(log.isDebugEnabled())
 log.debug(sm.getString
 (persistentManager.swapTooManyActive,
- session.getIdInternal(), new Integer(timeIdle)));
+ session.getIdInternal(),
+ Integer.valueOf(timeIdle)));
 try {
 swapOut(session);
 } catch (IOException e) {
@@ -989,7 +985,8 @@ public abstract class PersistentManagerB
 if (log.isDebugEnabled())
 log.debug(sm.getString
 (persistentManager.backupMaxIdle,
-session.getIdInternal(), new 
Integer(timeIdle)));
+session.getIdInternal(),
+Integer.valueOf(timeIdle)));
 
 try {
 writeSession(session);



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[ANN] Apache Tomcat 6.0.30 released

2011-01-13 Thread jean-frederic clere

The Apache Tomcat team announces the immediate availability of Apache
Tomcat 6.0.30 stable. This release includes bug-fixes over Apache
Tomcat 6.0.29.

Note that is version has 4 zip binaries: a generic one and three
bundled with Tomcat native binaries for different CPU architectures.

Apache Tomcat 6.0 includes new features over Apache Tomcat 5.5,
including support for the new Servlet 2.5 and JSP 2.1 specifications, a
refactored clustering implementation, advanced IO features, and
improvements in memory usage.

Please refer to the change log for the list of changes:
http://tomcat.apache.org/tomcat-6.0-doc/changelog.html

Downloads:
http://tomcat.apache.org/download-60.cgi

Migration guide from Apache Tomcat 5.5.x:
http://tomcat.apache.org/migration.html

Thank you,

-- The Apache Tomcat Team

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



simple tomcat extension

2011-01-13 Thread Juraj Burian

Hello folks,
I would like introduce new  very simple extension of Tomcat.
In my opinion, many people must have solved situation when some extra 
configurations or classes must be loaded into application that can't be 
part of WAR file.
Applications servers (WAS for example.) has concept of configurable 
shared libs. In Tomcat concept like this is missing.
So I think that would be very nice have possibility have some way how to 
do it.


Mine suggestion is to create new class loader (or extend current 
implementation of WebappClassLoader).

Simple solution can extend set of repositories in implicit manner.
If context is defined, let say CONTEXT,
and directory  CATALINA_HOME/webappsLib/[CONTEXT]/lib or directory 
CATALINA/webappsLib/[CONTEXT]/classes exists, then classloader append 
this entries to repositories.


More advanced strategy can be used for that, but as first step is this 
relatively good solution.


Please let me know your opinion.


I have code ready. It is separate implementation, so one must extends 
context.xml like this:


Context
Loader loaderClass=org.apache.catalina.loader.WebappClassLoaderExt/
...

best regards
Juraj Burian







RE: simple tomcat extension

2011-01-13 Thread Caldarale, Charles R
 From: Juraj Burian [mailto:j...@volny.cz] 
 Subject: simple tomcat extension

 Applications servers (WAS for example.) has concept of configurable 
 shared libs. In Tomcat concept like this is missing.

I think what you're looking for already exists:
http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html#VirtualWebappLoader_Implementation

(It's also available in Tomcat 6, and maybe earlier.)

You can also configure classloaders and paths for them in 
conf/catalina.properties.

 - 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.



Re: simple tomcat extension

2011-01-13 Thread Juraj Burian

Great,
thank you very much for answer Charles.
Mine problem was, that I can't use java 6 - so I never look to the 
Tomcat 7 documentation.
In Apache 6 documentation is this hint missing, but feature is 
implemented!!!


Thanks for great work folks.

best regards
JuBu


On 13.1.2011 17:21, Caldarale, Charles R wrote:

From: Juraj Burian [mailto:j...@volny.cz]
Subject: simple tomcat extension
Applications servers (WAS for example.) has concept of configurable
shared libs. In Tomcat concept like this is missing.

I think what you're looking for already exists:
http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html#VirtualWebappLoader_Implementation

(It's also available in Tomcat 6, and maybe earlier.)

You can also configure classloaders and paths for them in 
conf/catalina.properties.

  - 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 unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org




Re: Deploying new Applications

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jamie,

Technically speaking, this is a discussion best left to the user list.
I'm cross-posting. Please consider subscribing to the user list and
continuing the discussion there.

On 1/13/2011 7:27 AM, Jamie wrote:
 This works, but is not persistent. i.e. when tomcat is restarted the
 display name is taken from the context.xml file.
 Is there any way for Tomcat to set a persistent display name?

There have been some discussions about having the manager webapp persist
changes to files so they stick across Tomcat restarts. You may want to
re-post on the user list with a better subject line to see if you can
help with those (slow-going, as I understand) efforts.

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

iEYEARECAAYFAk0vLLgACgkQ9CaO5/Lv0PDYCwCgpWVsZ2Xt9VfNPI33bY3jkNXr
voIAn1Za8uVJMsge8HwE6HTub+VEIr7f
=7+G5
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1058689 - in /tomcat/trunk: java/org/apache/catalina/users/LocalStrings.properties java/org/apache/catalina/users/MemoryUserDatabase.java webapps/docs/changelog.xml

2011-01-13 Thread markt
Author: markt
Date: Thu Jan 13 17:55:55 2011
New Revision: 1058689

URL: http://svn.apache.org/viewvc?rev=1058689view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=18797
Provide null/zero-length protection

Modified:
tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties
tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties?rev=1058689r1=1058688r2=1058689view=diff
==
--- tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties Thu Jan 
13 17:55:55 2011
@@ -14,9 +14,12 @@
 # limitations under the License.
 
 memoryUserDatabase.invalidGroup=Invalid group name {0}
+memoryUserDatabase.notPersistable=User database is not persistable - no write 
permissions on directory
+memoryUserDatabase.nullGroup=Null or zero length group name specified. The 
group will be ignored.
+memoryUserDatabase.nullRole=Null or zero length role name specified. The role 
will be ignored.
+memoryUserDatabase.nullUser=Null or zero length user name specified. The user 
will be ignored.
+memoryUserDatabase.readOnly=User database has been configured to be read only. 
Changes cannot be saved
 memoryUserDatabase.renameOld=Cannot rename original file to {0}
 memoryUserDatabase.renameNew=Cannot rename new file to {0}
 memoryUserDatabase.writeException=IOException writing to {0}
-memoryUserDatabase.notPersistable=User database is not persistable - no write 
permissions on directory
-memoryUserDatabase.readOnly=User database has been configured to be read only. 
Changes cannot be saved
 memoryUserDatabase.xmlFeatureEncoding=Exception configuring digester to permit 
java encoding names in XML files. Only IANA encoding names will be supported.

Modified: tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java?rev=1058689r1=1058688r2=1058689view=diff
==
--- tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java Thu Jan 
13 17:55:55 2011
@@ -272,6 +272,12 @@ public class MemoryUserDatabase implemen
  */
 public Group createGroup(String groupname, String description) {
 
+if (groupname == null || groupname.length() == 0) {
+String msg = sm.getString(memoryUserDatabase.nullGroup);
+log.warn(msg);
+throw new IllegalArgumentException(msg);
+}
+
 MemoryGroup group = new MemoryGroup(this, groupname, description);
 synchronized (groups) {
 groups.put(group.getGroupname(), group);
@@ -289,6 +295,12 @@ public class MemoryUserDatabase implemen
  */
 public Role createRole(String rolename, String description) {
 
+if (rolename == null || rolename.length() == 0) {
+String msg = sm.getString(memoryUserDatabase.nullRole);
+log.warn(msg);
+throw new IllegalArgumentException(msg);
+}
+
 MemoryRole role = new MemoryRole(this, rolename, description);
 synchronized (roles) {
 roles.put(role.getRolename(), role);
@@ -308,12 +320,17 @@ public class MemoryUserDatabase implemen
 public User createUser(String username, String password,
String fullName) {
 
+if (username == null || username.length() == 0) {
+String msg = sm.getString(memoryUserDatabase.nullUser);
+log.warn(msg);
+throw new IllegalArgumentException(msg);
+}
+
 MemoryUser user = new MemoryUser(this, username, password, fullName);
 synchronized (users) {
 users.put(user.getUsername(), user);
 }
 return (user);
-
 }
 
 
@@ -399,13 +416,13 @@ public class MemoryUserDatabase implemen
 }
 digester.addFactoryCreate
 (tomcat-users/group,
- new MemoryGroupCreationFactory(this));
+ new MemoryGroupCreationFactory(this), true);
 digester.addFactoryCreate
 (tomcat-users/role,
- new MemoryRoleCreationFactory(this));
+ new MemoryRoleCreationFactory(this), true);
 digester.addFactoryCreate
 (tomcat-users/user,
- new MemoryUserCreationFactory(this));
+ new MemoryUserCreationFactory(this), true);
 
 // Parse the XML input file to load this 

DO NOT REPLY [Bug 18797] MemoryUserRule doesn't validate user attributes

2011-01-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=18797

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #1 from Mark Thomas ma...@apache.org 2011-01-13 12:56:12 EST ---
Fixed in 7.0.x and will be included in 7.0.7 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: simple tomcat extension

2011-01-13 Thread Filip Hanik - Dev Lists

can't you just create a directory, drop your jars in there, and in 
conf/catalina.properties, configure the shared.loader property?

best
Filip


On 1/13/2011 9:05 AM, Juraj Burian wrote:

Hello folks,
I would like introduce new  very simple extension of Tomcat.
In my opinion, many people must have solved situation when some extra configurations or classes must be loaded into application that can't 
be part of WAR file.

Applications servers (WAS for example.) has concept of configurable shared 
libs. In Tomcat concept like this is missing.
So I think that would be very nice have possibility have some way how to do it.

Mine suggestion is to create new class loader (or extend current implementation 
of WebappClassLoader).
Simple solution can extend set of repositories in implicit manner.
If context is defined, let say CONTEXT,
and directory  CATALINA_HOME/webappsLib/[CONTEXT]/lib or directory CATALINA/webappsLib/[CONTEXT]/classes exists, then classloader append 
this entries to repositories.


More advanced strategy can be used for that, but as first step is this 
relatively good solution.

Please let me know your opinion.


I have code ready. It is separate implementation, so one must extends 
context.xml like this:

Context
Loader loaderClass=org.apache.catalina.loader.WebappClassLoaderExt/
...

best regards
Juraj Burian








-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1191 / Virus Database: 1435/3375 - Release Date: 01/12/11



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[RESULT] [VOTE] Release Apache Tomcat 7.0.6

2011-01-13 Thread Mark Thomas
On 10/01/2011 18:54, Mark Thomas wrote:
 The proposed Apache Tomcat 7.0.6 release is now available for voting.
 
 It can be obtained from:
 http://people.apache.org/~markt/dev/tomcat-7/v7.0.6/
 The svn tag is:
 http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_6/
 
 The proposed 7.0.6 release is:
 
 [ ] Broken - do not release
 [ ] Alpha  - go ahead and release as 7.0.6 Alpha
 [ ] Beta   - go ahead and release as 7.0.6 Beta
 [ ] Stable - go ahead and release as 7.0.6 Stable
 
 This vote will run until at least 19.00 UTC Thursday 13th January (3
 working days).

The votes cast were:
+1: mturk*, markt*, Jason Brittain, funkman*, rjung*, kfujino*

* binding vote

7.0.6 will therefore be released as stable.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 50570] Allow explicit use of FIPS mode in APR connector

2011-01-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50570

Christopher Schultz ch...@christopherschultz.net changed:

   What|Removed |Added

Summary|Allow explicit use of FIPS  |Allow explicit use of FIPS
   |mode for SSL connectors |mode in APR connector

--- Comment #3 from Christopher Schultz ch...@christopherschultz.net 
2011-01-13 14:49:06 EST ---
Changing description to reflect new requirements: NIO/BIO connectors need no
such explicit configuration.

It looks like this can be done by adding a member, accessor, and mutator to
AprEndpoint and then in AprEndpoint.bind, call (a new method)
SSLContext.setFIPSMode which calls FIPS_mode_set.

One thing I'm unclear on is how to get the configuration from server.xml's
Connector all the way down to the AprEndpoint object. What object has
setXXX() called on it when configuring a Connector?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 19428] FileLogger - auto create new log file after being deleted

2011-01-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=19428

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX

--- Comment #2 from Mark Thomas ma...@apache.org 2011-01-13 17:08:33 EST ---
The FileLogger is no more with the switch to JULI in 5.5.x onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1058807 - in /tomcat/site/trunk: docs/download-70.html docs/index.html docs/whichversion.html xdocs/download-70.xml xdocs/index.xml xdocs/whichversion.xml

2011-01-13 Thread markt
Author: markt
Date: Fri Jan 14 00:00:57 2011
New Revision: 1058807

URL: http://svn.apache.org/viewvc?rev=1058807view=rev
Log:
Update for 7.0.6

Modified:
tomcat/site/trunk/docs/download-70.html
tomcat/site/trunk/docs/index.html
tomcat/site/trunk/docs/whichversion.html
tomcat/site/trunk/xdocs/download-70.xml
tomcat/site/trunk/xdocs/index.xml
tomcat/site/trunk/xdocs/whichversion.xml

Modified: tomcat/site/trunk/docs/download-70.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/download-70.html?rev=1058807r1=1058806r2=1058807view=diff
==
--- tomcat/site/trunk/docs/download-70.html (original)
+++ tomcat/site/trunk/docs/download-70.html Fri Jan 14 00:00:57 2011
@@ -227,8 +227,8 @@
 p
 blockquote
 a href=http://www.apache.org/dist/tomcat/tomcat-7/KEYS;KEYS/a |
-a href=#7.0.57.0.5/a |
-a href=[preferred]tomcat/tomcat-7/v7.0.5-betaBrowse/a |
+a href=#7.0.67.0.6/a |
+a href=[preferred]tomcat/tomcat-7/v7.0.6Browse/a |
 a href=http://archive.apache.org/dist/tomcat/tomcat-7;Archives/a
   /blockquote
 /p
@@ -328,11 +328,8 @@
 tr
 td bgcolor=#525D76
 font color=#ff face=arial,helvetica,sanserif
-a name=7.0.5 BETA
-!--()--
-/a
-a name=7.0.5_BETA
-strong7.0.5 BETA/strong
+a name=7.0.6
+strong7.0.6/strong
 /a
 /font
 /td
@@ -342,8 +339,8 @@
 p
 blockquote
   p
-  a name=7.0.5Please/a see the 
-  a href=[preferred]tomcat/tomcat-7/v7.0.5-beta/README.htmlREADME/a
+  a name=7.0.6Please/a see the 
+  a href=[preferred]tomcat/tomcat-7/v7.0.6/README.htmlREADME/a
   file for packaging information.  It explains what every distribution 
contains.
   /p
 
@@ -367,81 +364,95 @@
 liCore:
   ul
   li
-a 
href=[preferred]tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5.zipzip/a
 
-(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5.zip.asc;pgp/a,
 
-a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5.zip.md5;md5/a)
+a 
href=[preferred]tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6.zipzip/a 
+(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6.zip.asc;pgp/a,
 
+a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6.zip.md5;md5/a)
   /li
   li
-a 
href=[preferred]tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5.tar.gztar.gz/a
 
-(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5.tar.gz.asc;pgp/a,
 
-a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5.tar.gz.md5;md5/a)
+a 
href=[preferred]tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6.tar.gztar.gz/a
 
+(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6.tar.gz.asc;pgp/a,
 
+a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6.tar.gz.md5;md5/a)
   /li
   li
-a 
href=[preferred]tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5-windows-x86.zip32-bit
 Windows zip/a 
-(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5-windows-x86.zip.asc;pgp/a,
 
-a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5-windows-x86.zip.md5;md5/a)
+a 
href=[preferred]tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6-windows-x86.zip32-bit
 Windows zip/a 
+(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6-windows-x86.zip.asc;pgp/a,
 
+a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6-windows-x86.zip.md5;md5/a)
   /li
   li
-a 
href=[preferred]tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5-windows-x64.zip64-bit
 Windows zip/a 
-(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5-windows-x64.zip.asc;pgp/a,
 
-a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5-windows-x64.zip.md5;md5/a)
+a 
href=[preferred]tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6-windows-x64.zip64-bit
 Windows zip/a 
+(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6-windows-x64.zip.asc;pgp/a,
 
+a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.6/bin/apache-tomcat-7.0.6-windows-x64.zip.md5;md5/a)
   /li
   li
-a 
href=[preferred]tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5-windows-i64.zip64-bit
 Itanium Windows zip/a 
-(a 
href=http://www.apache.org/dist/tomcat/tomcat-7/v7.0.5-beta/bin/apache-tomcat-7.0.5-windows-i64.zip.asc;pgp/a,
 
-

Re: svn commit: r1058807 - in /tomcat/site/trunk: docs/download-70.html docs/index.html docs/whichversion.html xdocs/download-70.xml xdocs/index.xml xdocs/whichversion.xml

2011-01-13 Thread Konstantin Kolinko
2011/1/14  ma...@apache.org:
 Author: markt
 Date: Fri Jan 14 00:00:57 2011
 New Revision: 1058807

 URL: http://svn.apache.org/viewvc?rev=1058807view=rev
 Log:
 Update for 7.0.6

 Modified:
    tomcat/site/trunk/docs/download-70.html
    tomcat/site/trunk/docs/index.html
    tomcat/site/trunk/docs/whichversion.html
    tomcat/site/trunk/xdocs/download-70.xml
    tomcat/site/trunk/xdocs/index.xml
    tomcat/site/trunk/xdocs/whichversion.xml


Mark,

it looks that you didn't have the time to upload the 7.0.6 docs.  I
uploaded them and updated the symlink.

Please correct the group ownership for 7.0.5 ones (if we aren't
removing them yet). That will be

chgrp -R tomcat tomcat-7.0-doc-7.0.5


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 50582] New: Small JSPs do not set Content-Length (and use chunked encoding) if AccessLogValve is configured

2011-01-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=50582

   Summary: Small JSPs do not set Content-Length (and use chunked
encoding) if AccessLogValve is configured
   Product: Tomcat 7
   Version: 7.0.6
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: regression
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: knst.koli...@gmail.com


Reported in the following thread on users@:
http://markmail.org/thread/awcu5ler2m77jjok

Steps to reproduce:
1. Create the following JSP page, simple.jsp:
%= hello! %

2. Send the following request:
GET /simple.jsp HTTP/1.1
Host: localhost
Keep-Alive: 115
Connection: keep-alive

3. Expected response: (Tomcat 7.0.4)
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=0AFC2875C06A962DF8A02DE6A780F721; Path=/; HttpOnly
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 6
Date: Thu, 13 Jan 2011 21:16:23 GMT

hello!

4. Actual response: (Tomcat 7.0.6)
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=2C176DBAC054D5BBF3D99FBE5C026915; Path=/; HttpOnly
Content-Type: text/html;charset=ISO-8859-1
Transfer-Encoding: chunked
Date: Thu, 13 Jan 2011 21:23:19 GMT

6
hello!
0

===
Investigation.
If I place a breakpoint in AbstractHttp11Processor#prepareResponse() I see the
following line
 long contentLength = response.getContentLengthLong();
returns -1 and the call stack is:

Daemon Thread [http-bio-8080-exec-1] (Suspended)
Response.getContentLengthLong() line: 523
Http11Processor(AbstractHttp11Processor).prepareResponse() line: 887
Http11Processor(AbstractHttp11Processor).action(ActionCode, Object) line:
739
Response.action(ActionCode, Object) line: 170
Response.sendHeaders() line: 350
OutputBuffer.doFlush(boolean) line: 308
OutputBuffer.flush() line: 291
Response.getBytesWritten(boolean) line: 327
AccessLogValve$ByteSentElement.addElement(StringBuilder, Date, Request,
Response, long) line: 1052
AccessLogValve.log(Request, Response, long) line: 579
AccessLogValve.invoke(Request, Response) line: 562
StandardEngineValve.invoke(Request, Response) line: 118
CoyoteAdapter.service(Request, Response) line: 380
Http11Processor.process(SocketWrapperSocket) line: 243
Http11Protocol$Http11ConnectionHandler.process(SocketWrapperSocket,
SocketStatus) line: 188
Http11Protocol$Http11ConnectionHandler.process(SocketWrapperSocket) line:
166
JIoEndpoint$SocketProcessor.run() line: 288
ThreadPoolExecutor$Worker.runTask(Runnable) line: 886
ThreadPoolExecutor$Worker.run() line: 908
TaskThread(Thread).run() line: 662

Note OutputBuffer.flush() call above.


If I remove AccessLogValve from configuration, the
response.getContentLengthLong();
call returns 8 as expected and call stack is:

Daemon Thread [http-bio-8080-exec-1] (Suspended)
Http11Processor(AbstractHttp11Processor).prepareResponse() line: 888
Http11Processor(AbstractHttp11Processor).action(ActionCode, Object) line:
739
Response.action(ActionCode, Object) line: 170
Response.sendHeaders() line: 350
OutputBuffer.doFlush(boolean) line: 308
OutputBuffer.close() line: 275
Response.finishResponse() line: 501
CoyoteAdapter.service(Request, Response) line: 406
Http11Processor.process(SocketWrapperSocket) line: 243
Http11Protocol$Http11ConnectionHandler.process(SocketWrapperSocket,
SocketStatus) line: 188
Http11Protocol$Http11ConnectionHandler.process(SocketWrapperSocket) line:
166
JIoEndpoint$SocketProcessor.run() line: 288
ThreadPoolExecutor$Worker.runTask(Runnable) line: 886
ThreadPoolExecutor$Worker.run() line: 908
TaskThread(Thread).run() line: 662

===
The value returned by response.getContentLengthLong() should be set explicitly
(e.g. with content-length header). The second stack trace includes
OutputBuffer.close() call and it sets the length value to the response:

   coyoteResponse.setContentLength(bb.getLength());


This regression is triggered by flushing when AccessLogValve asks for the count
of bytes written and was introduced when implementing #50496.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1058556 - /tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java

2011-01-13 Thread Konstantin Kolinko
2011/1/13  ma...@apache.org:
 Author: markt
 Date: Thu Jan 13 13:54:08 2011
 New Revision: 1058556

 URL: http://svn.apache.org/viewvc?rev=1058556view=rev
 Log:
 Fix FindBugs warning
 Remove unnecessary code
 Better error handling

 Modified:
    tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java



 @@ -244,7 +241,11 @@ public class FarmWarDeployer extends Clu
                             addServiced(path);
                             try {
                                 remove(path);
 -                                factory.getFile().renameTo(deployable);
 +                                if (!factory.getFile().renameTo(deployable)) 
 {
 +                                    log.error(Failed to rename [ +
 +                                            factory.getFile() + ] to [ +
 +                                            deployable + ]);
(..)

i18n ?
It is error. It will be visible.


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org