svn commit: r1520501 - in /tomcat/jk/trunk/native/common: jk_ajp_common.c jk_connect.c jk_global.h jk_status.c

2013-09-06 Thread mturk
Author: mturk
Date: Fri Sep  6 07:04:28 2013
New Revision: 1520501

URL: http://svn.apache.org/r1520501
Log:
IPV6 support - use inet_ntop from APR. Stil no funtional changes

Modified:
tomcat/jk/trunk/native/common/jk_ajp_common.c
tomcat/jk/trunk/native/common/jk_connect.c
tomcat/jk/trunk/native/common/jk_global.h
tomcat/jk/trunk/native/common/jk_status.c

Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=1520501&r1=1520500&r2=1520501&view=diff
==
--- tomcat/jk/trunk/native/common/jk_ajp_common.c (original)
+++ tomcat/jk/trunk/native/common/jk_ajp_common.c Fri Sep  6 07:04:28 2013
@@ -1002,7 +1002,7 @@ static int ajp_handle_cping_cpong(ajp_en
  */
 int ajp_connect_to_endpoint(ajp_endpoint_t * ae, jk_logger_t *l)
 {
-char buf[32];
+char buf[64];
 int rc = JK_TRUE;
 
 JK_TRACE_ENTER(l);
@@ -1264,7 +1264,7 @@ int ajp_connection_tcp_get_message(ajp_e
 int rc;
 int msglen;
 unsigned int header;
-char buf[32];
+char buf[64];
 
 JK_TRACE_ENTER(l);
 

Modified: tomcat/jk/trunk/native/common/jk_connect.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_connect.c?rev=1520501&r1=1520500&r2=1520501&view=diff
==
--- tomcat/jk/trunk/native/common/jk_connect.c (original)
+++ tomcat/jk/trunk/native/common/jk_connect.c Fri Sep  6 07:04:28 2013
@@ -59,6 +59,18 @@ static apr_pool_t *jk_apr_pool = NULL;
 #define USE_SOCK_CLOEXEC
 #endif
 
+#ifndef IN6ADDRSZ
+#define IN6ADDRSZ   16
+#endif
+
+#ifndef INT16SZ
+#define INT16SZ sizeof(apr_int16_t)
+#endif
+
+#if !defined(EAFNOSUPPORT) && defined(WSAEAFNOSUPPORT)
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#endif
+
 /* our compiler cant deal with char* <-> const char* ... */
 #if defined(NETWARE) && !defined(__NOVELL_LIBC__)
 typedef char* SET_TYPE;
@@ -328,21 +340,16 @@ int jk_resolve(const char *host, int por
void *pool, int prefer_ipv6, jk_logger_t *l)
 {
 int x;
-struct in_addr laddr;
-struct sockaddr_in *rc;
+struct in_addr laddr4;
+struct sockaddr_in *rc4;
 
 JK_TRACE_ENTER(l);
 
 memset(saddr, 0, sizeof(jk_sockaddr_t));
-/* TODO:
- * This will depend on IPV4/IPV6 resolving
- * and prefer_ipv6
- */
-saddr->salen = (int)sizeof(struct sockaddr_in);
 
-rc = &saddr->sa.sin;
-rc->sin_port = htons((short)port);
-rc->sin_family = AF_INET;
+rc4 = &saddr->sa.sin;
+rc4->sin_port   = htons((short)port);
+rc4->sin_family = AF_INET;
 
 /* Check if we only have digits in the string */
 for (x = 0; host[x] != '\0'; x++) {
@@ -389,7 +396,7 @@ int jk_resolve(const char *host, int por
 
 apr_sockaddr_ip_get(&remote_ipaddr, remote_sa);
 
-laddr.s_addr = jk_inet_addr(remote_ipaddr);
+laddr4.s_addr = jk_inet_addr(remote_ipaddr);
 
 #else /* HAVE_APR */
 
@@ -405,18 +412,27 @@ int jk_resolve(const char *host, int por
 return JK_FALSE;
 }
 
-laddr = *((struct in_addr *)hoste->h_addr_list[0]);
+laddr4 = *((struct in_addr *)hoste->h_addr_list[0]);
 
 #endif /* HAVE_APR */
 }
 else {
 /* If we found only digits we use inet_addr() */
-laddr.s_addr = jk_inet_addr(host);
+laddr4.s_addr = jk_inet_addr(host);
 }
-memcpy(&(rc->sin_addr), &laddr, sizeof(laddr));
+/* TODO:
+ * This will depend on IPV4/IPV6 resolving
+ * and prefer_ipv6
+ */
+saddr->ipaddr_ptr = &rc4->sin_addr;
+saddr->ipaddr_len = (int)sizeof(struct in_addr);
+saddr->salen  = (int)sizeof(struct sockaddr_in);
+saddr->port   = port;
+saddr->host   = host;
+saddr->family = rc4->sin_family;
+
+memcpy(saddr->ipaddr_ptr, &laddr4, saddr->ipaddr_len);
 
-saddr->port = port;
-saddr->host = host;
 JK_TRACE_EXIT(l);
 return JK_TRUE;
 }
@@ -931,19 +947,178 @@ int jk_tcp_socket_recvfull(jk_sock_t sd,
 return rdlen;
 }
 
+/* const char *
+ * inet_ntop4(src, dst, size)
+ *  format an IPv4 address, more or less like inet_ntoa()
+ * return:
+ *  `dst' (as a const)
+ * notes:
+ *  (1) uses no statics
+ *  (2) takes a u_char* not an in_addr as input
+ * author:
+ *  Paul Vixie, 1996.
+ */
+static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size)
+{
+const apr_size_t MIN_SIZE = 16; /* space for 255.255.255.255\0 */
+int n = 0;
+char *next = dst;
+
+if (size < MIN_SIZE) {
+errno = ENOSPC;
+return NULL;
+}
+do {
+unsigned char u = *src++;
+if (u > 99) {
+*next++ = '0' + u/100;
+ u %= 100;
+*next++ = '0' + u/10;
+ u %= 10;
+}
+else if (u > 9) {
+*next++ = '0' + u/10;
+ u %= 10;
+}
+*next++ = '0' + u;
+ 

[Bug 55530] New: webdavServlet support aliases floder upload and delete

2013-09-06 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55530

Bug ID: 55530
   Summary: webdavServlet support aliases floder upload and delete
   Product: Tomcat 7
   Version: 7.0.42
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: virgil.h...@gmail.com

Created attachment 30803
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30803&action=edit
catalina.jar naming context judge add aslias floder retrieve

hi, guys, I want to know why T7 not support to WebDAV upload or delete file to
aliases floder, and I hack some code to support it

-- 
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: r1520524 - /tomcat/jk/trunk/native/common/jk_connect.c

2013-09-06 Thread mturk
Author: mturk
Date: Fri Sep  6 09:55:32 2013
New Revision: 1520524

URL: http://svn.apache.org/r1520524
Log:
IPV6 support - should work with APR only for now. Still need to implement for 
non httpd connectors

Modified:
tomcat/jk/trunk/native/common/jk_connect.c

Modified: tomcat/jk/trunk/native/common/jk_connect.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_connect.c?rev=1520524&r1=1520523&r2=1520524&view=diff
==
--- tomcat/jk/trunk/native/common/jk_connect.c (original)
+++ tomcat/jk/trunk/native/common/jk_connect.c Fri Sep  6 09:55:32 2013
@@ -339,31 +339,21 @@ in_addr_t jk_inet_addr(const char * addr
 int jk_resolve(const char *host, int port, jk_sockaddr_t *saddr,
void *pool, int prefer_ipv6, jk_logger_t *l)
 {
-int x;
-struct in_addr laddr4;
-struct sockaddr_in *rc4;
+int family = AF_INET;
+struct in_addr iaddr;
 
 JK_TRACE_ENTER(l);
 
 memset(saddr, 0, sizeof(jk_sockaddr_t));
+if (*host >= '0' && *host <= '9' && strspn(host, "0123456789.") == 
strlen(host)) {
 
-rc4 = &saddr->sa.sin;
-rc4->sin_port   = htons((short)port);
-rc4->sin_family = AF_INET;
-
-/* Check if we only have digits in the string */
-for (x = 0; host[x] != '\0'; x++) {
-if (!jk_isdigit(host[x]) && host[x] != '.') {
-break;
-}
+/* If we found only digits we use inet_addr() */
+iaddr.s_addr = jk_inet_addr(host);
+memcpy(&(saddr->sa.sin.sin_addr), &iaddr, sizeof(struct in_addr));
 }
-
-/* If we found also characters we should make name to IP resolution */
-if (host[x] != '\0') {
-
+else {
 #ifdef HAVE_APR
 apr_sockaddr_t *remote_sa, *temp_sa;
-char *remote_ipaddr;
 
 if (!jk_apr_pool) {
 if (apr_pool_create(&jk_apr_pool, (apr_pool_t *)pool) != 
APR_SUCCESS) {
@@ -372,66 +362,94 @@ int jk_resolve(const char *host, int por
 }
 }
 apr_pool_clear(jk_apr_pool);
-if (apr_sockaddr_info_get
-(&remote_sa, host, APR_UNSPEC, (apr_port_t) port, 0, jk_apr_pool)
-!= APR_SUCCESS) {
+if (apr_sockaddr_info_get(&remote_sa, host, APR_UNSPEC, 
(apr_port_t)port,
+  0, jk_apr_pool) != APR_SUCCESS) {
 JK_TRACE_EXIT(l);
 return JK_FALSE;
 }
 
-/* Since we are only handling AF_INET (IPV4) address (in_addr_t) */
-/* make sure we find one of those.   */
-temp_sa = remote_sa;
-while ((NULL != temp_sa) && (AF_INET != temp_sa->family))
-temp_sa = temp_sa->next;
-
-/* if temp_sa is set, we have a valid address otherwise, just return */
-if (NULL != temp_sa) {
-remote_sa = temp_sa;
+/* Check if we have multiple address matches
+ */
+if (remote_sa->next) {
+/* Since we are only handling AF_INET (IPV4) address (in_addr_t) */
+/* make sure we find one of those.   */
+temp_sa = remote_sa;
+#if APR_HAVE_IPV6
+if (prefer_ipv6) {
+while ((NULL != temp_sa) && (AF_INET6 != temp_sa->family))
+temp_sa = temp_sa->next;
+}
+#endif
+if (NULL != temp_sa) {
+remote_sa = temp_sa;
+}
+else {
+while ((NULL != temp_sa) && (AF_INET != temp_sa->family))
+temp_sa = temp_sa->next;
+}
+/* if temp_sa is set, we have a valid address otherwise, just 
return */
+if (NULL != temp_sa) {
+remote_sa = temp_sa;
+}
+else {
+JK_TRACE_EXIT(l);
+return JK_FALSE;
+}
 }
+if (remote_sa->family == AF_INET) {
+saddr->sa.sin = remote_sa->sa.sin;
+family = AF_INET;
+}
+#if APR_HAVE_IPV6
 else {
-JK_TRACE_EXIT(l);
-return JK_FALSE;
+saddr->sa.sin6 = remote_sa->sa.sin6;
+family = AF_INET6;
 }
-
-apr_sockaddr_ip_get(&remote_ipaddr, remote_sa);
-
-laddr4.s_addr = jk_inet_addr(remote_ipaddr);
-
+#endif
 #else /* HAVE_APR */
+/* Without APR go the classic way.
+ */
+
+struct hostent *hoste;
+/* TODO:
+ * Check for numeric IPV6 addresses
+ */
 
 /* XXX : WARNING : We should really use gethostbyname_r in 
multi-threaded env */
 /* Fortunatly when APR is available, ie under Apache 2.0, we use it */
 #if defined(NETWARE) && !defined(__NOVELL_LIBC__)
-struct hostent *hoste = gethostbyname((char*)host);
+hoste = gethostbyname((char*)host);
 #else
-struct hostent *hoste = gethostbyname(host);
+hoste = gethostbyname(host);
 #endif
 if (!hoste) {

svn commit: r1520528 - /tomcat/jk/trunk/native/common/jk_global.h

2013-09-06 Thread mturk
Author: mturk
Date: Fri Sep  6 10:22:25 2013
New Revision: 1520528

URL: http://svn.apache.org/r1520528
Log:
Use already present defines from configure

Modified:
tomcat/jk/trunk/native/common/jk_global.h

Modified: tomcat/jk/trunk/native/common/jk_global.h
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_global.h?rev=1520528&r1=1520527&r2=1520528&view=diff
==
--- tomcat/jk/trunk/native/common/jk_global.h (original)
+++ tomcat/jk/trunk/native/common/jk_global.h Fri Sep  6 10:22:25 2013
@@ -345,6 +345,7 @@ extern "C"
(tv)->tv_usec = tb.millitm * 1000; }
 #define HAVE_VSNPRINTF
 #define HAVE_SNPRINTF
+#define HAVE_SOCKADDR_STORAGE
 #ifdef HAVE_APR
 #define snprintf apr_snprintf
 #define vsnprintf apr_vsnprintf
@@ -404,10 +405,10 @@ typedef int jk_sock_t;
 #if defined(HAVE_APR)
 #define JK_HAVE_IPV6APR_HAVE_IPV6
 #else
-#if defined(WIN32) || defined(HAVE_IPV6)
-#define JK_HAVE_IPV61
+#if defined(WIN32) || defined(HAVE_AF_INET6)
+#define JK_HAVE_IPV61
 #else
-#define JK_HAVE_IPV60
+#define JK_HAVE_IPV60
 #endif
 #endif
 
@@ -431,8 +432,12 @@ struct jk_sockaddr_t {
 struct sockaddr_in6 sin6;
 #endif
 /** Placeholder to ensure that the size of this union is not
- * dependent on whether JK_HAVE_IPV6 is defined. */
+ * dependent on whether APR_HAVE_IPV6 is defined. */
+#ifdef HAVE_SOCKADDR_STORAGE
+struct sockaddr_storage sas;
+#else
 char sas[128];
+#endif
 } sa;
 };
 



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



Hello to Tomcat Dev Team

2013-09-06 Thread Mak Pandian
Hi All,

This mail is just to say Hello to all Tomcat developers and introduce
myself with you all.

I am Pandian passionate on Java and Open source technologies and am willing
to be a part of Dev team to fix bugs and develop features on Tomcat.

Looking forward to work with you all.


-- 
*Thanks & Regards*
* *
*Pandian*
*(Living @ Virtual World)*


[Bug 55529] error while building the source

2013-09-06 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55529

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Mark Thomas  ---
That is an (expected) warning, not an error. Please use the Tomcat users
mailing list if you need further assistance.

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



[Bug 55530] webdavServlet support aliases folder upload and delete

2013-09-06 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55530

Mark Thomas  changed:

   What|Removed |Added

Summary|webdavServlet support   |webdavServlet support
   |aliases floder upload and   |aliases folder upload and
   |delete  |delete
 OS||All
   Severity|normal  |enhancement

--- Comment #1 from Mark Thomas  ---
Fix typos in title. Mark as an enhancement.

-- 
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: r1520575 - in /tomcat/trunk: java/org/apache/catalina/webresources/ test/org/apache/catalina/webresources/ webapps/docs/config/

2013-09-06 Thread markt
Author: markt
Date: Fri Sep  6 14:18:59 2013
New Revision: 1520575

URL: http://svn.apache.org/r1520575
Log:
Fix some issues with the new Resources implementation reported by Dan Mikusa:
- The zero-arg constructors for WebResourceSet implementations were either 
missing or always failed meaning that they could not be specified in a 
context.xml file as the digester was unable to create them
- The internalPath attribute was not configurable

Modified:

tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java
tomcat/trunk/java/org/apache/catalina/webresources/DirResourceSet.java
tomcat/trunk/java/org/apache/catalina/webresources/FileResourceSet.java
tomcat/trunk/java/org/apache/catalina/webresources/JarResourceSet.java

tomcat/trunk/test/org/apache/catalina/webresources/AbstractTestResourceSet.java

tomcat/trunk/test/org/apache/catalina/webresources/AbstractTestResourceSetMount.java
tomcat/trunk/test/org/apache/catalina/webresources/TestDirResourceSet.java
tomcat/trunk/test/org/apache/catalina/webresources/TestFileResourceSet.java
tomcat/trunk/test/org/apache/catalina/webresources/TestJarResourceSet.java

tomcat/trunk/test/org/apache/catalina/webresources/TestJarResourceSetInternal.java
tomcat/trunk/webapps/docs/config/resources.xml

Modified: 
tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java?rev=1520575&r1=1520574&r2=1520575&view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java 
Fri Sep  6 14:18:59 2013
@@ -26,13 +26,12 @@ public abstract class AbstractFileResour
 
 protected static final String[] EMPTY_STRING_ARRAY = new String[0];
 
-protected final String internalPath;
 protected File fileBase;
 protected String absoluteBase;
 protected String canonicalBase;
 
 protected AbstractFileResourceSet(String internalPath) {
-this.internalPath = checkInternalPath(internalPath);
+setInternalPath(internalPath);
 }
 
 protected File file(String name, boolean mustExist) {
@@ -104,7 +103,7 @@ public abstract class AbstractFileResour
 // Lifecycle 
methods
 @Override
 protected void initInternal() throws LifecycleException {
-fileBase = new File(getBase(), internalPath);
+fileBase = new File(getBase(), getInternalPath());
 checkType(fileBase);
 
 String absolutePath = fileBase.getAbsolutePath();

Modified: 
tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java?rev=1520575&r1=1520574&r2=1520575&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/AbstractResourceSet.java 
Fri Sep  6 14:18:59 2013
@@ -28,8 +28,10 @@ public abstract class AbstractResourceSe
 
 private WebResourceRoot root;
 private String base;
+private String internalPath;
 private String webAppMount;
 
+
 protected static final StringManager sm =
 StringManager.getManager(Constants.Package);
 
@@ -40,15 +42,6 @@ public abstract class AbstractResourceSe
 }
 }
 
-protected final String checkInternalPath(String internalPath) {
-checkPath(internalPath);
-// Optimise internal processing
-if (internalPath.equals("/")) {
-return "";
-}
-return internalPath;
-}
-
 @Override
 public final void setRoot(WebResourceRoot root) {
 this.root = root;
@@ -58,6 +51,21 @@ public abstract class AbstractResourceSe
 return root;
 }
 
+
+public String getInternalPath() {
+return internalPath;
+}
+
+public void setInternalPath(String internalPath) {
+checkPath(internalPath);
+// Optimise internal processing
+if (internalPath.equals("/")) {
+this.internalPath = "";
+} else {
+this.internalPath = internalPath;
+}
+}
+
 public final void setWebAppMount(String webAppMount) {
 checkPath(webAppMount);
 // Optimise internal processing

Modified: tomcat/trunk/java/org/apache/catalina/webresources/DirResourceSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/DirResourceSet.java?rev=1520575&r1=1520574&r2=1520575&view=diff
==

[jira] [Created] (MTOMCAT-238) Parameter staticContextDocbase cant be used

2013-09-06 Thread Michal Franc (JIRA)
Michal Franc created MTOMCAT-238:


 Summary: Parameter staticContextDocbase cant be used
 Key: MTOMCAT-238
 URL: https://issues.apache.org/jira/browse/MTOMCAT-238
 Project: Apache Tomcat Maven Plugin
  Issue Type: Bug
  Components: tomcat6, tomcat7
Affects Versions: 2.0-beta-1
Reporter: Michal Franc
Assignee: Olivier Lamy (*$^¨%`£)


Attribute staticContextDocbase leads to IllegalArgumentException

org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo#createStaticContext
is context created from container and at the and added again to server which 
leads to java.lang.IllegalArgumentException: addChild:  Child name '/' is not 
unique

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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



[jira] [Commented] (MTOMCAT-238) Parameter staticContextDocbase cant be used

2013-09-06 Thread Michal Franc (JIRA)

[ 
https://issues.apache.org/jira/browse/MTOMCAT-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13760238#comment-13760238
 ] 

Michal Franc commented on MTOMCAT-238:
--

[ERROR] Failed to execute goal 
org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run (default-cli) on project 
web_cps: Execution default-cli of goal 
org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run failed: addChild:  Child 
name '/' is not unique -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run (default-cli) on project 
web_cps: Execution default-cli of goal 
org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run failed: addChild:  Child 
name '/' is not unique
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at 
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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:597)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run 
failed: addChild:  Child
name '/' is not unique
at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.IllegalArgumentException: addChild:  Child name '/' is not 
unique
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:887)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at 
org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.createStaticContext(AbstractRunMojo.java:1354)
at 
org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.startContainer(AbstractRunMojo.java:1020)
at 
org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.execute(AbstractRunMojo.java:512)
at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
... 20 more

> Parameter staticContextDocbase cant be used
> ---
>
> Key: MTOMCAT-238
> URL: https://issues.apache.org/jira/browse/MTOMCAT-238
> Project: Apache Tomcat Maven Plugin
>  Issue Type: Bug
>  Components: tomcat6, tomcat7
>Affects Versions: 2.0-beta-1
>Reporter: Michal Franc
>Assignee: Olivier Lamy (*$^¨%`£)
>
> Attribute staticContextDocbase leads to IllegalArgumentException
> org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo#createStaticContext
> is context created from container and at the and added again to server which 
> leads to java.lang.IllegalArgumentException: addChild:  Child name '/' is not 
> unique

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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



[jira] [Updated] (MTOMCAT-238) Parameter staticContextDocbase cant be used

2013-09-06 Thread Michal Franc (JIRA)

 [ 
https://issues.apache.org/jira/browse/MTOMCAT-238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michal Franc updated MTOMCAT-238:
-

Affects Version/s: 2.1

> Parameter staticContextDocbase cant be used
> ---
>
> Key: MTOMCAT-238
> URL: https://issues.apache.org/jira/browse/MTOMCAT-238
> Project: Apache Tomcat Maven Plugin
>  Issue Type: Bug
>  Components: tomcat6, tomcat7
>Affects Versions: 2.0-beta-1, 2.1
>Reporter: Michal Franc
>Assignee: Olivier Lamy (*$^¨%`£)
>
> Attribute staticContextDocbase leads to IllegalArgumentException
> org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo#createStaticContext
> is context created from container and at the and added again to server which 
> leads to java.lang.IllegalArgumentException: addChild:  Child name '/' is not 
> unique

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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



[Bug 55524] Deadlock produced during Websocket write operation (org.apache.catalina.websocket.WsOutbound)

2013-09-06 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55524

Mark Thomas  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Mark Thomas  ---
Error parsing HTTP request header is a different problem so should be in a new
bugzilla issue. Further there is insufficient information for any one to even
begin to debug the problem you are seeing. You should seek help on the users
list in the first instance. If that discussion concludes there is a Tomcat bug
then at that point open a new issue and provide all the necessary information
for the issue to be reproduced.

-- 
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: r1520633 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/WsFrameBase.java

2013-09-06 Thread markt
Author: markt
Date: Fri Sep  6 17:11:15 2013
New Revision: 1520633

URL: http://svn.apache.org/r1520633
Log:
Prevent problems if the message handlers are updated in the middle of handling 
a message spread across multiple frames. The entire message will be handled by 
the message handler in force at the start of the message.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1520632

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java?rev=1520633&r1=1520632&r2=1520633&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java Fri 
Sep  6 17:11:15 2013
@@ -63,6 +63,10 @@ public abstract class WsFrameBase {
 private boolean textMessage = false;
 private ByteBuffer messageBufferBinary;
 private CharBuffer messageBufferText;
+// Cache the message handler in force when the message starts so it is used
+// consistently for the entire message
+private MessageHandler binaryMsgHandler = null;
+private MessageHandler textMsgHandler = null;
 
 // Attributes of the current frame
 private boolean fin = false;
@@ -168,6 +172,8 @@ public abstract class WsFrameBase {
 if (size != messageBufferBinary.capacity()) {
 messageBufferBinary = ByteBuffer.allocate(size);
 }
+binaryMsgHandler = wsSession.getBinaryMessageHandler();
+textMsgHandler = null;
 } else if (opCode == Constants.OPCODE_TEXT) {
 // New text message
 textMessage = true;
@@ -175,6 +181,8 @@ public abstract class WsFrameBase {
 if (size != messageBufferText.capacity()) {
 messageBufferText = CharBuffer.allocate(size);
 }
+binaryMsgHandler = null;
+textMsgHandler = wsSession.getTextMessageHandler();
 } else {
 throw new WsIOException(new CloseReason(
 CloseCodes.PROTOCOL_ERROR,
@@ -338,11 +346,10 @@ public abstract class WsFrameBase {
 
 @SuppressWarnings("unchecked")
 private void sendMessageText(boolean last) throws WsIOException {
-MessageHandler mh = wsSession.getTextMessageHandler();
-if (mh != null) {
-if (mh instanceof WrappedMessageHandler) {
+if (textMsgHandler != null) {
+if (textMsgHandler instanceof WrappedMessageHandler) {
 long maxMessageSize =
-((WrappedMessageHandler) mh).getMaxMessageSize();
+((WrappedMessageHandler) 
textMsgHandler).getMaxMessageSize();
 if (maxMessageSize > -1 &&
 messageBufferText.remaining() > maxMessageSize) {
 throw new WsIOException(new CloseReason(CloseCodes.TOO_BIG,
@@ -353,12 +360,12 @@ public abstract class WsFrameBase {
 }
 
 try {
-if (mh instanceof MessageHandler.Partial) {
-((MessageHandler.Partial) mh).onMessage(
+if (textMsgHandler instanceof MessageHandler.Partial) {
+((MessageHandler.Partial) 
textMsgHandler).onMessage(
 messageBufferText.toString(), last);
 } else {
 // Caller ensures last == true if this branch is used
-((MessageHandler.Whole) mh).onMessage(
+((MessageHandler.Whole) textMsgHandler).onMessage(
 messageBufferText.toString());
 }
 } catch (Throwable t) {
@@ -522,11 +529,10 @@ public abstract class WsFrameBase {
 @SuppressWarnings("unchecked")
 private void sendMessageBinary(ByteBuffer msg, boolean last)
 throws WsIOException {
-MessageHandler mh = wsSession.getBinaryMessageHandler();
-if (mh != null) {
-if (mh instanceof WrappedMessageHandler) {
+if (binaryMsgHandler != null) {
+if (binaryMsgHandler instanceof WrappedMessageHandler) {
 long maxMessageSize =
-((WrappedMessageHandler) mh).getMaxMessageSize();
+((WrappedMessageHandler) 
binaryMsgHandler).getMaxMessageSize();
 if (maxMessageSize > -1 && msg.remaining() > maxMessageSize) {
 throw new WsIO

svn commit: r1520632 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java

2013-09-06 Thread markt
Author: markt
Date: Fri Sep  6 17:10:05 2013
New Revision: 1520632

URL: http://svn.apache.org/r1520632
Log:
Prevent problems if the message handlers are updated in the middle of handling 
a message spread across multiple frames. The entire message will be handled by 
the message handler in force at the start of the message.

Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java?rev=1520632&r1=1520631&r2=1520632&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java Fri Sep  6 
17:10:05 2013
@@ -63,6 +63,10 @@ public abstract class WsFrameBase {
 private boolean textMessage = false;
 private ByteBuffer messageBufferBinary;
 private CharBuffer messageBufferText;
+// Cache the message handler in force when the message starts so it is used
+// consistently for the entire message
+private MessageHandler binaryMsgHandler = null;
+private MessageHandler textMsgHandler = null;
 
 // Attributes of the current frame
 private boolean fin = false;
@@ -168,6 +172,8 @@ public abstract class WsFrameBase {
 if (size != messageBufferBinary.capacity()) {
 messageBufferBinary = ByteBuffer.allocate(size);
 }
+binaryMsgHandler = wsSession.getBinaryMessageHandler();
+textMsgHandler = null;
 } else if (opCode == Constants.OPCODE_TEXT) {
 // New text message
 textMessage = true;
@@ -175,6 +181,8 @@ public abstract class WsFrameBase {
 if (size != messageBufferText.capacity()) {
 messageBufferText = CharBuffer.allocate(size);
 }
+binaryMsgHandler = null;
+textMsgHandler = wsSession.getTextMessageHandler();
 } else {
 throw new WsIOException(new CloseReason(
 CloseCodes.PROTOCOL_ERROR,
@@ -338,11 +346,10 @@ public abstract class WsFrameBase {
 
 @SuppressWarnings("unchecked")
 private void sendMessageText(boolean last) throws WsIOException {
-MessageHandler mh = wsSession.getTextMessageHandler();
-if (mh != null) {
-if (mh instanceof WrappedMessageHandler) {
+if (textMsgHandler != null) {
+if (textMsgHandler instanceof WrappedMessageHandler) {
 long maxMessageSize =
-((WrappedMessageHandler) mh).getMaxMessageSize();
+((WrappedMessageHandler) 
textMsgHandler).getMaxMessageSize();
 if (maxMessageSize > -1 &&
 messageBufferText.remaining() > maxMessageSize) {
 throw new WsIOException(new CloseReason(CloseCodes.TOO_BIG,
@@ -353,12 +360,12 @@ public abstract class WsFrameBase {
 }
 
 try {
-if (mh instanceof MessageHandler.Partial) {
-((MessageHandler.Partial) mh).onMessage(
+if (textMsgHandler instanceof MessageHandler.Partial) {
+((MessageHandler.Partial) 
textMsgHandler).onMessage(
 messageBufferText.toString(), last);
 } else {
 // Caller ensures last == true if this branch is used
-((MessageHandler.Whole) mh).onMessage(
+((MessageHandler.Whole) textMsgHandler).onMessage(
 messageBufferText.toString());
 }
 } catch (Throwable t) {
@@ -522,11 +529,10 @@ public abstract class WsFrameBase {
 @SuppressWarnings("unchecked")
 private void sendMessageBinary(ByteBuffer msg, boolean last)
 throws WsIOException {
-MessageHandler mh = wsSession.getBinaryMessageHandler();
-if (mh != null) {
-if (mh instanceof WrappedMessageHandler) {
+if (binaryMsgHandler != null) {
+if (binaryMsgHandler instanceof WrappedMessageHandler) {
 long maxMessageSize =
-((WrappedMessageHandler) mh).getMaxMessageSize();
+((WrappedMessageHandler) 
binaryMsgHandler).getMaxMessageSize();
 if (maxMessageSize > -1 && msg.remaining() > maxMessageSize) {
 throw new WsIOException(new CloseReason(CloseCodes.TOO_BIG,
 sm.getString("wsFrame.messageTooBig",
@@ -535,11 +541,11 @@ public abstract class WsFrameBase {
 }
 }
 try {
-  

svn commit: r1520657 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java

2013-09-06 Thread markt
Author: markt
Date: Fri Sep  6 18:25:40 2013
New Revision: 1520657

URL: http://svn.apache.org/r1520657
Log:
Don't register the ReadListener until after onOpen has completed as 
MessageHandler instances are likely to be registered during onOpen. This 
prevents incoming messages from being processed until the onOpen event 
completes.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1520655

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java?rev=1520657&r1=1520656&r2=1520657&view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java
 Fri Sep  6 18:25:40 2013
@@ -124,11 +124,11 @@ public class WsHttpUpgradeHandler implem
 WsFrameServer wsFrame = new WsFrameServer(
 sis,
 wsSession);
-sis.setReadListener(new WsReadListener(this, wsFrame));
 sos.setWriteListener(
 new WsWriteListener(this, wsRemoteEndpointServer));
 ep.onOpen(wsSession, endpointConfig);
 webSocketContainer.registerSession(ep, wsSession);
+sis.setReadListener(new WsReadListener(this, wsFrame));
 } catch (DeploymentException e) {
 throw new IllegalArgumentException(e);
 } finally {



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



svn commit: r1520655 - /tomcat/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java

2013-09-06 Thread markt
Author: markt
Date: Fri Sep  6 18:25:05 2013
New Revision: 1520655

URL: http://svn.apache.org/r1520655
Log:
Don't register the ReadListener until after onOpen has completed as 
MessageHandler instances are likely to be registered during onOpen. This 
prevents incoming messages from being processed until the onOpen event 
completes.

Modified:

tomcat/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java?rev=1520655&r1=1520654&r2=1520655&view=diff
==
--- 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java 
(original)
+++ 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java 
Fri Sep  6 18:25:05 2013
@@ -124,11 +124,11 @@ public class WsHttpUpgradeHandler implem
 WsFrameServer wsFrame = new WsFrameServer(
 sis,
 wsSession);
-sis.setReadListener(new WsReadListener(this, wsFrame));
 sos.setWriteListener(
 new WsWriteListener(this, wsRemoteEndpointServer));
 ep.onOpen(wsSession, endpointConfig);
 webSocketContainer.registerSession(ep, wsSession);
+sis.setReadListener(new WsReadListener(this, wsFrame));
 } catch (DeploymentException e) {
 throw new IllegalArgumentException(e);
 } finally {



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



buildbot success in ASF Buildbot on tomcat-7-trunk

2013-09-06 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-7-trunk while 
building ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-7-trunk/builds/1383

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/tc7.0.x/trunk] 1520633
Blamelist: markt

Build succeeded!

sincerely,
 -The Buildbot





[Bug 55533] New: ProxyDirContext throws null pointer exception on reloaded context

2013-09-06 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55533

Bug ID: 55533
   Summary: ProxyDirContext throws null pointer exception on
reloaded context
   Product: Tomcat 7
   Version: 7.0.41
  Hardware: Macintosh
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: mattha...@gmail.com

This looks to be a repeat of bug #24588, from some time ago...

I am actually able to reproduce this same issue consistently on tomcat 7.0.41
whenever I make a request on a reloaded context.

1) Deploy war (unpacked) onto tomcat (embedded,
org.apache.catalina.startup.Tomcat) with context set to reloadable
2) Make requests to webapp, works fine
3) Recompile war to trigger context reload
4) Each request to webapp gives this stacktrace

2013-09-06 22:32:35,093 [http-nio-8080-exec-8] ERROR
org.apache.coyote.http11.Http11NioProcessor - Error processing request
java.lang.NullPointerException
at
org.apache.naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java:1660)
at
org.apache.naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java:1536)
at
org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:297)
at
org.apache.tomcat.util.http.mapper.Mapper.internalMapWrapper(Mapper.java:1009)
at org.apache.tomcat.util.http.mapper.Mapper.internalMap(Mapper.java:821)
at org.apache.tomcat.util.http.mapper.Mapper.map(Mapper.java:684)
at
org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:647)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

Checked, and it is failing on the same line:
  int n = is.read(b, pos, length - pos);

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