JBossWeb SVN: r2323 - in branches/7.4.x/src/main/java/org/apache/coyote: ajp and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2013-12-09 11:18:00 -0500 (Mon, 09 Dec 2013)
New Revision: 2323
Modified:
branches/7.4.x/src/main/java/org/apache/coyote/Request.java
branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpAprProcessor.java
branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpProcessor.java
branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java
branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11Processor.java
Log:
Port improvements to content-length handling.
Modified: branches/7.4.x/src/main/java/org/apache/coyote/Request.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/Request.java 2013-12-09 15:25:05 UTC (rev 2322)
+++ branches/7.4.x/src/main/java/org/apache/coyote/Request.java 2013-12-09 16:18:00 UTC (rev 2323)
@@ -288,7 +288,7 @@
}
- public void setContentLength(int len) {
+ public void setContentLength(long len) {
this.contentLength = len;
}
Modified: branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpAprProcessor.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpAprProcessor.java 2013-12-09 15:25:05 UTC (rev 2322)
+++ branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpAprProcessor.java 2013-12-09 16:18:00 UTC (rev 2323)
@@ -28,6 +28,8 @@
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
+import javax.servlet.http.HttpServletResponse;
+
import org.apache.coyote.ActionCode;
import org.apache.coyote.ActionHook;
import org.apache.coyote.Adapter;
@@ -721,6 +723,7 @@
// Decode headers
MimeHeaders headers = request.getMimeHeaders();
+ boolean contentLengthSet = false;
int hCount = requestHeaderMessage.getInt();
for(int i = 0 ; i < hCount ; i++) {
String hName = null;
@@ -755,8 +758,15 @@
if (hId == Constants.SC_REQ_CONTENT_LENGTH ||
(hId == -1 && tmpMB.equalsIgnoreCase("Content-Length"))) {
- // just read the content-length header, so set it
- request.setContentLength( vMB.getInt() );
+ long cl = vMB.getLong();
+ if (contentLengthSet) {
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ error = true;
+ } else {
+ contentLengthSet = true;
+ // Set the content-length header for the request
+ request.setContentLength(cl);
+ }
} else if (hId == Constants.SC_REQ_CONTENT_TYPE ||
(hId == -1 && tmpMB.equalsIgnoreCase("Content-Type"))) {
// just read the content-type header, so set it
Modified: branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpProcessor.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpProcessor.java 2013-12-09 15:25:05 UTC (rev 2322)
+++ branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpProcessor.java 2013-12-09 16:18:00 UTC (rev 2323)
@@ -30,6 +30,8 @@
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
+import javax.servlet.http.HttpServletResponse;
+
import org.apache.coyote.ActionCode;
import org.apache.coyote.ActionHook;
import org.apache.coyote.Adapter;
@@ -735,6 +737,7 @@
// Decode headers
MimeHeaders headers = request.getMimeHeaders();
+ boolean contentLengthSet = false;
int hCount = requestHeaderMessage.getInt();
for(int i = 0 ; i < hCount ; i++) {
String hName = null;
@@ -769,8 +772,15 @@
if (hId == Constants.SC_REQ_CONTENT_LENGTH ||
(hId == -1 && tmpMB.equalsIgnoreCase("Content-Length"))) {
- // just read the content-length header, so set it
- request.setContentLength( vMB.getInt() );
+ long cl = vMB.getLong();
+ if (contentLengthSet) {
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ error = true;
+ } else {
+ contentLengthSet = true;
+ // Set the content-length header for the request
+ request.setContentLength(cl);
+ }
} else if (hId == Constants.SC_REQ_CONTENT_TYPE ||
(hId == -1 && tmpMB.equalsIgnoreCase("Content-Type"))) {
// just read the content-type header, so set it
Modified: branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java 2013-12-09 15:25:05 UTC (rev 2322)
+++ branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11AprProcessor.java 2013-12-09 16:18:00 UTC (rev 2323)
@@ -1475,10 +1475,19 @@
// Parse content-length header
long contentLength = request.getContentLengthLong();
- if (contentLength >= 0 && !contentDelimitation) {
- inputBuffer.addActiveFilter
- (inputFilters[Constants.IDENTITY_FILTER]);
- contentDelimitation = true;
+ if (contentLength >= 0) {
+ if (contentDelimitation) {
+ // contentDelimitation being true at this point indicates that
+ // chunked encoding is being used but chunked encoding should
+ // not be used with a content length. RFC 2616, section 4.4,
+ // bullet 3 states Content-Length must be ignored in this case -
+ // so remove it.
+ headers.removeHeader("content-length");
+ request.setContentLength(-1);
+ } else {
+ inputBuffer.addActiveFilter(inputFilters[Constants.IDENTITY_FILTER]);
+ contentDelimitation = true;
+ }
}
MessageBytes valueMB = headers.getValue("host");
Modified: branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java 2013-12-09 15:25:05 UTC (rev 2322)
+++ branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11NioProcessor.java 2013-12-09 16:18:00 UTC (rev 2323)
@@ -1013,12 +1013,22 @@
}
}
- // Parse content-length header
- long contentLength = request.getContentLengthLong();
- if (contentLength >= 0 && !contentDelimitation) {
- inputBuffer.addActiveFilter(inputFilters[Constants.IDENTITY_FILTER]);
- contentDelimitation = true;
- }
+ // Parse content-length header
+ long contentLength = request.getContentLengthLong();
+ if (contentLength >= 0) {
+ if (contentDelimitation) {
+ // contentDelimitation being true at this point indicates that
+ // chunked encoding is being used but chunked encoding should
+ // not be used with a content length. RFC 2616, section 4.4,
+ // bullet 3 states Content-Length must be ignored in this case -
+ // so remove it.
+ headers.removeHeader("content-length");
+ request.setContentLength(-1);
+ } else {
+ inputBuffer.addActiveFilter(inputFilters[Constants.IDENTITY_FILTER]);
+ contentDelimitation = true;
+ }
+ }
MessageBytes valueMB = headers.getValue("host");
Modified: branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11Processor.java 2013-12-09 15:25:05 UTC (rev 2322)
+++ branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11Processor.java 2013-12-09 16:18:00 UTC (rev 2323)
@@ -1328,10 +1328,19 @@
// Parse content-length header
long contentLength = request.getContentLengthLong();
- if (contentLength >= 0 && !contentDelimitation) {
- inputBuffer.addActiveFilter
- (inputFilters[Constants.IDENTITY_FILTER]);
- contentDelimitation = true;
+ if (contentLength >= 0) {
+ if (contentDelimitation) {
+ // contentDelimitation being true at this point indicates that
+ // chunked encoding is being used but chunked encoding should
+ // not be used with a content length. RFC 2616, section 4.4,
+ // bullet 3 states Content-Length must be ignored in this case -
+ // so remove it.
+ headers.removeHeader("content-length");
+ request.setContentLength(-1);
+ } else {
+ inputBuffer.addActiveFilter(inputFilters[Constants.IDENTITY_FILTER]);
+ contentDelimitation = true;
+ }
}
MessageBytes valueMB = headers.getValue("host");
11 years
JBossWeb SVN: r2322 - in branches/7.4.x: webapps/docs/config and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2013-12-09 10:25:05 -0500 (Mon, 09 Dec 2013)
New Revision: 2322
Modified:
branches/7.4.x/src/main/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
branches/7.4.x/src/main/java/org/apache/tomcat/util/net/jsse/NioJSSESocketChannelFactory.java
branches/7.4.x/webapps/docs/config/ssl.xml
Log:
Arrange doc and make sure the JSSE behaviour mimics the openssl one.
Modified: branches/7.4.x/src/main/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2013-12-09 11:40:09 UTC (rev 2321)
+++ branches/7.4.x/src/main/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2013-12-09 15:25:05 UTC (rev 2322)
@@ -200,7 +200,7 @@
* requested ciphers are supported
*/
protected String[] getEnabledCiphers(String requestedCiphers,
- String[] supportedCiphers) {
+ String[] supportedCiphers) throws IOException {
String[] enabledCiphers = null;
@@ -257,6 +257,8 @@
if (vec != null) {
enabledCiphers = new String[vec.size()];
vec.copyInto(enabledCiphers);
+ } else {
+ throw new IOException("no cipher match"); // Like openssl.
}
} else {
enabledCiphers = sslProxy.getDefaultCipherSuites();
Modified: branches/7.4.x/src/main/java/org/apache/tomcat/util/net/jsse/NioJSSESocketChannelFactory.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/tomcat/util/net/jsse/NioJSSESocketChannelFactory.java 2013-12-09 11:40:09 UTC (rev 2321)
+++ branches/7.4.x/src/main/java/org/apache/tomcat/util/net/jsse/NioJSSESocketChannelFactory.java 2013-12-09 15:25:05 UTC (rev 2322)
@@ -340,7 +340,7 @@
* @return Array of SSL cipher suites to be enabled, or null if none of the
* requested ciphers are supported
*/
- protected String[] getEnabledCiphers(String requestedCiphers, String[] supportedCiphers) {
+ protected String[] getEnabledCiphers(String requestedCiphers, String[] supportedCiphers) throws IOException {
String[] enabledCiphers = null;
SSLServerSocketFactory sslProxy = sslContext.getServerSocketFactory();
@@ -395,7 +395,9 @@
if (vec != null) {
enabledCiphers = new String[vec.size()];
vec.copyInto(enabledCiphers);
- }
+ } else {
+ throw new IOException("no cipher match"); // Like openssl.
+ }
} else {
enabledCiphers = sslProxy.getDefaultCipherSuites();
}
Modified: branches/7.4.x/webapps/docs/config/ssl.xml
===================================================================
--- branches/7.4.x/webapps/docs/config/ssl.xml 2013-12-09 11:40:09 UTC (rev 2321)
+++ branches/7.4.x/webapps/docs/config/ssl.xml 2013-12-09 15:25:05 UTC (rev 2322)
@@ -186,7 +186,7 @@
the default is "<code>ALL</code>".</p>
</attribute>
- <attribute name="ciphers" required="false">
+ <attribute name="cipher-suite" required="false">
<p>A comma seperated list of the encryption ciphers that may be used,
that MUST NOT be the JVM default in of JSSE as contains weak ciphers.
that is SSLCipherSuite when using OpenSSL (APR).
11 years
JBossWeb SVN: r2321 - branches/7.4.x/src/main/java/org/apache/tomcat/websocket.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2013-12-09 06:40:09 -0500 (Mon, 09 Dec 2013)
New Revision: 2321
Modified:
branches/7.4.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
Log:
Port minor addition to allow replacing SSL context.
Modified: branches/7.4.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2013-12-05 15:24:11 UTC (rev 2320)
+++ branches/7.4.x/src/main/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2013-12-09 11:40:09 UTC (rev 2321)
@@ -87,6 +87,13 @@
public static final String SSL_TRUSTSTORE_PWD_PROPERTY =
"org.apache.tomcat.websocket.SSL_TRUSTSTORE_PWD";
public static final String SSL_TRUSTSTORE_PWD_DEFAULT = "changeit";
+ /**
+ * Property name to set to configure used SSLContext. The value should be an
+ * instance of SSLContext. If this property is present, the SSL_TRUSTSTORE*
+ * properties are ignored.
+ */
+ public static final String SSL_CONTEXT_PROPERTY =
+ "org.apache.tomcat.websocket.SSL_CONTEXT";
/**
* Property name to set to configure the timeout (in milliseconds) when
@@ -645,42 +652,48 @@
throws DeploymentException {
try {
- // Create the SSL Context
- SSLContext sslContext = SSLContext.getInstance("TLS");
+ // See if a custom SSLContext has been provided
+ SSLContext sslContext =
+ (SSLContext) userProperties.get(SSL_CONTEXT_PROPERTY);
- // Trust store
- String sslTrustStoreValue =
- (String) userProperties.get(SSL_TRUSTSTORE_PROPERTY);
- if (sslTrustStoreValue != null) {
- String sslTrustStorePwdValue = (String) userProperties.get(
- SSL_TRUSTSTORE_PWD_PROPERTY);
- if (sslTrustStorePwdValue == null) {
- sslTrustStorePwdValue = SSL_TRUSTSTORE_PWD_DEFAULT;
- }
+ if (sslContext == null) {
+ // Create the SSL Context
+ sslContext = SSLContext.getInstance("TLS");
- File keyStoreFile = new File(sslTrustStoreValue);
- KeyStore ks = KeyStore.getInstance("JKS");
- InputStream is = null;
- try {
- is = new FileInputStream(keyStoreFile);
- ks.load(is, sslTrustStorePwdValue.toCharArray());
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException ioe) {
- // Ignore
+ // Trust store
+ String sslTrustStoreValue =
+ (String) userProperties.get(SSL_TRUSTSTORE_PROPERTY);
+ if (sslTrustStoreValue != null) {
+ String sslTrustStorePwdValue = (String) userProperties.get(
+ SSL_TRUSTSTORE_PWD_PROPERTY);
+ if (sslTrustStorePwdValue == null) {
+ sslTrustStorePwdValue = SSL_TRUSTSTORE_PWD_DEFAULT;
+ }
+
+ File keyStoreFile = new File(sslTrustStoreValue);
+ KeyStore ks = KeyStore.getInstance("JKS");
+ InputStream is = null;
+ try {
+ is = new FileInputStream(keyStoreFile);
+ ks.load(is, sslTrustStorePwdValue.toCharArray());
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException ioe) {
+ // Ignore
+ }
}
}
- }
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(
- TrustManagerFactory.getDefaultAlgorithm());
- tmf.init(ks);
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance(
+ TrustManagerFactory.getDefaultAlgorithm());
+ tmf.init(ks);
- sslContext.init(null, tmf.getTrustManagers(), null);
- } else {
- sslContext.init(null, null, null);
+ sslContext.init(null, tmf.getTrustManagers(), null);
+ } else {
+ sslContext.init(null, null, null);
+ }
}
SSLEngine engine = sslContext.createSSLEngine();
11 years
JBossWeb SVN: r2320 - branches/7.4.x/src/main/java/org/apache/catalina/authenticator.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2013-12-05 10:24:11 -0500 (Thu, 05 Dec 2013)
New Revision: 2320
Modified:
branches/7.4.x/src/main/java/org/apache/catalina/authenticator/FormAuthenticator.java
Log:
BZ 1030050: Sync some changes that offer more flexibility (in addition to using createInputStream which allows using a reader for the restored request).
Modified: branches/7.4.x/src/main/java/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/catalina/authenticator/FormAuthenticator.java 2013-12-03 09:17:47 UTC (rev 2319)
+++ branches/7.4.x/src/main/java/org/apache/catalina/authenticator/FormAuthenticator.java 2013-12-05 15:24:11 UTC (rev 2320)
@@ -300,6 +300,7 @@
// the landing page
String uri = request.getContextPath() + landingPage;
SavedRequest saved = new SavedRequest();
+ saved.setMethod("GET");
saved.setRequestURI(uri);
saved.setDecodedRequestURI(uri);
request.getSessionInternal(true).setNote(
@@ -330,6 +331,7 @@
// the landing page
String uri = request.getContextPath() + landingPage;
SavedRequest saved = new SavedRequest();
+ saved.setMethod("GET");
saved.setRequestURI(uri);
saved.setDecodedRequestURI(uri);
session.setNote(Constants.FORM_REQUEST_NOTE, saved);
@@ -366,6 +368,10 @@
request.changeSessionId(session.getId());
}
}
+ // Always use GET for the login page, regardless of the method used
+ String oldMethod = request.getMethod();
+ request.getCoyoteRequest().method().setString("GET");
+
RequestDispatcher disp =
context.getServletContext().getRequestDispatcher(config.getLoginPage());
try {
@@ -376,6 +382,9 @@
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
msg);
+ } finally {
+ // Restore original method so that it is written into access log
+ request.getCoyoteRequest().method().setString(oldMethod);
}
}
@@ -459,6 +468,16 @@
if (saved == null)
return (false);
+ // Swallow any request body since we will be replacing it
+ // Need to do this before headers are restored as AJP connector uses
+ // content length header to determine how much data needs to be read for
+ // request body
+ byte[] buffer = new byte[4096];
+ InputStream is = request.createInputStream();
+ while (is.read(buffer) >= 0) {
+ // Ignore request body
+ }
+
// Modify our current request to reflect the original one
request.clearCookies();
Iterator cookies = saved.getCookies();
@@ -466,10 +485,11 @@
request.addCookie((Cookie) cookies.next());
}
+ String method = saved.getMethod();
MimeHeaders rmh = request.getCoyoteRequest().getMimeHeaders();
rmh.recycle();
- boolean cachable = "GET".equalsIgnoreCase(saved.getMethod()) ||
- "HEAD".equalsIgnoreCase(saved.getMethod());
+ boolean cachable = "GET".equalsIgnoreCase(method) ||
+ "HEAD".equalsIgnoreCase(method);
Iterator names = saved.getHeaderNames();
while (names.hasNext()) {
String name = (String) names.next();
@@ -495,45 +515,36 @@
request.getCoyoteRequest().getParameters().setQueryStringEncoding(request.getConnector().getURIEncoding());
- // Swallow any request body since we will be replacing it
- byte[] buffer = new byte[4096];
- InputStream is = request.getInputStream();
- while (is.read(buffer) >= 0) {
- // Ignore request body
- }
+ ByteChunk body = saved.getBody();
- if ("POST".equalsIgnoreCase(saved.getMethod())) {
- ByteChunk body = saved.getBody();
-
- if (body != null && body.getLength() > 0) {
- request.clearParameters();
- request.getCoyoteRequest().action
- (ActionCode.ACTION_REQ_SET_BODY_REPLAY, body);
-
- // Set content type
- MessageBytes contentType = MessageBytes.newInstance();
-
- //If no content type specified, use default for POST
- String savedContentType = saved.getContentType();
- if (savedContentType == null) {
- savedContentType = "application/x-www-form-urlencoded";
- }
+ if (body != null) {
+ request.clearParameters();
+ request.getCoyoteRequest().action
+ (ActionCode.ACTION_REQ_SET_BODY_REPLAY, body);
- contentType.setString(savedContentType);
- request.getCoyoteRequest().setContentType(contentType);
+ // Set content type
+ MessageBytes contentType = MessageBytes.newInstance();
- } else {
- // Restore the parameters.
- Iterator params = saved.getParameterNames();
- while (params.hasNext()) {
- String name = (String) params.next();
- request.addParameter(name,
- saved.getParameterValues(name));
- }
-
+ //If no content type specified, use default for POST
+ String savedContentType = saved.getContentType();
+ if (savedContentType == null && "POST".equalsIgnoreCase(method)) {
+ savedContentType = "application/x-www-form-urlencoded";
}
+
+ contentType.setString(savedContentType);
+ request.getCoyoteRequest().setContentType(contentType);
+
+ } else {
+ // Restore the parameters.
+ Iterator params = saved.getParameterNames();
+ while (params.hasNext()) {
+ String name = (String) params.next();
+ request.addParameter(name,
+ saved.getParameterValues(name));
+ }
+
}
- request.getCoyoteRequest().method().setString(saved.getMethod());
+ request.getCoyoteRequest().method().setString(method);
request.getCoyoteRequest().queryString().setString
(saved.getQueryString());
@@ -577,30 +588,29 @@
saved.addLocale(locale);
}
- if ("POST".equalsIgnoreCase(request.getMethod())) {
- // May need to acknowledge a 100-continue expectation
- request.getResponse().sendAcknowledgement();
- ByteChunk body = new ByteChunk();
- body.setLimit(request.getConnector().getMaxSavePostSize());
+ // May need to acknowledge a 100-continue expectation
+ request.getResponse().sendAcknowledgement();
+ ByteChunk body = new ByteChunk();
+ body.setLimit(request.getConnector().getMaxSavePostSize());
- byte[] buffer = new byte[4096];
- int bytesRead;
- InputStream is = request.getInputStream();
-
- while ( (bytesRead = is.read(buffer) ) >= 0) {
- body.append(buffer, 0, bytesRead);
- }
+ byte[] buffer = new byte[4096];
+ int bytesRead;
+ InputStream is = request.getInputStream();
+
+ while ( (bytesRead = is.read(buffer) ) >= 0) {
+ body.append(buffer, 0, bytesRead);
+ }
+ if (body.getLength() > 0) {
saved.setContentType(request.getContentType());
saved.setBody(body);
-
- if (body.getLength() == 0) {
- // It means that parameters have already been parsed.
- Enumeration e = request.getParameterNames();
- for ( ; e.hasMoreElements() ;) {
- String name = (String) e.nextElement();
- String[] val = request.getParameterValues(name);
- saved.addParameter(name, val);
- }
+ }
+ if (body.getLength() == 0) {
+ // It means that parameters have already been parsed.
+ Enumeration e = request.getParameterNames();
+ for ( ; e.hasMoreElements() ;) {
+ String name = (String) e.nextElement();
+ String[] val = request.getParameterValues(name);
+ saved.addParameter(name, val);
}
}
11 years
JBossWeb SVN: r2319 - in branches/7.2.x/src/main/java/org/apache/coyote: http11 and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2013-12-03 04:17:47 -0500 (Tue, 03 Dec 2013)
New Revision: 2319
Modified:
branches/7.2.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java
branches/7.2.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java
branches/7.2.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java
Log:
BZ1036977: Fix using modeler (bad mbean names) with native and NIO2 connectors.
Modified: branches/7.2.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java 2013-12-03 09:14:08 UTC (rev 2318)
+++ branches/7.2.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java 2013-12-03 09:17:47 UTC (rev 2319)
@@ -166,14 +166,14 @@
if (this.domain != null ) {
try {
tpOname = new ObjectName
- (domain + ":" + "type=ThreadPool,name=" + getName());
+ (domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
} catch (Exception e) {
CoyoteLogger.AJP_LOGGER.errorRegisteringPool(e);
}
rgOname = new ObjectName
- (domain + ":type=GlobalRequestProcessor,name=" + getName());
+ (domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(cHandler.global, rgOname, null);
}
}
Modified: branches/7.2.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java 2013-12-03 09:14:08 UTC (rev 2318)
+++ branches/7.2.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java 2013-12-03 09:17:47 UTC (rev 2319)
@@ -118,14 +118,14 @@
if( this.domain != null ) {
try {
tpOname=new ObjectName
- (domain + ":" + "type=ThreadPool,name=" + getName());
+ (domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
} catch (Exception e) {
CoyoteLogger.HTTP_LOGGER.errorRegisteringPool(e);
}
rgOname=new ObjectName
- (domain + ":type=GlobalRequestProcessor,name=" + getName());
+ (domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent
( cHandler.global, rgOname, null );
}
Modified: branches/7.2.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java 2013-12-03 09:14:08 UTC (rev 2318)
+++ branches/7.2.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java 2013-12-03 09:17:47 UTC (rev 2319)
@@ -129,12 +129,12 @@
if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
if (this.domain != null) {
try {
- tpOname = new ObjectName(domain + ":" + "type=ThreadPool,name=" + getName());
+ tpOname = new ObjectName(domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(endpoint, tpOname, null);
} catch (Exception e) {
CoyoteLogger.HTTP_LOGGER.errorRegisteringPool(e);
}
- rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getName());
+ rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(cHandler.global, rgOname, null);
}
}
11 years, 1 month
JBossWeb SVN: r2318 - in branches: 7.4.x/src/main/java/org/apache/coyote/ajp and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2013-12-03 04:14:08 -0500 (Tue, 03 Dec 2013)
New Revision: 2318
Modified:
branches/7.3.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java
branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java
Log:
Fix apparently badly ported JMX code (java.io is correct, but not NIO 2 or native). Missed AJP.
Modified: branches/7.3.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- branches/7.3.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java 2013-12-02 12:06:55 UTC (rev 2317)
+++ branches/7.3.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java 2013-12-03 09:14:08 UTC (rev 2318)
@@ -166,14 +166,14 @@
if (this.domain != null ) {
try {
tpOname = new ObjectName
- (domain + ":" + "type=ThreadPool,name=" + getName());
+ (domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
} catch (Exception e) {
CoyoteLogger.AJP_LOGGER.errorRegisteringPool(e);
}
rgOname = new ObjectName
- (domain + ":type=GlobalRequestProcessor,name=" + getName());
+ (domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(cHandler.global, rgOname, null);
}
}
Modified: branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java 2013-12-02 12:06:55 UTC (rev 2317)
+++ branches/7.4.x/src/main/java/org/apache/coyote/ajp/AjpAprProtocol.java 2013-12-03 09:14:08 UTC (rev 2318)
@@ -166,14 +166,14 @@
if (this.domain != null ) {
try {
tpOname = new ObjectName
- (domain + ":" + "type=ThreadPool,name=" + getName());
+ (domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
} catch (Exception e) {
CoyoteLogger.AJP_LOGGER.errorRegisteringPool(e);
}
rgOname = new ObjectName
- (domain + ":type=GlobalRequestProcessor,name=" + getName());
+ (domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(cHandler.global, rgOname, null);
}
}
11 years, 1 month
JBossWeb SVN: r2317 - in branches/7.3.x: src/main/java/org/apache/jasper/compiler and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2013-12-02 07:06:55 -0500 (Mon, 02 Dec 2013)
New Revision: 2317
Modified:
branches/7.3.x/.classpath
branches/7.3.x/src/main/java/org/apache/jasper/compiler/JDTCompiler.java
Log:
Compatibility with new JDT.
Modified: branches/7.3.x/.classpath
===================================================================
--- branches/7.3.x/.classpath 2013-12-02 09:57:49 UTC (rev 2316)
+++ branches/7.3.x/.classpath 2013-12-02 12:06:55 UTC (rev 2317)
@@ -6,6 +6,6 @@
<classpathentry kind="lib" path="/home/remm/.m2/repository/org/jboss/spec/javax/servlet/jboss-servlet-api_3.0_spec/1.0.1.Final/jboss-servlet-api_3.0_spec-1.0.1.Final.jar"/>
<classpathentry kind="lib" path="/home/remm/.m2/repository/org/jboss/spec/javax/servlet/jsp/jboss-jsp-api_2.2_spec/1.0.1.Final/jboss-jsp-api_2.2_spec-1.0.1.Final.jar"/>
<classpathentry kind="lib" path="/home/remm/.m2/repository/org/jboss/spec/javax/el/jboss-el-api_2.2_spec/1.0.1.Final/jboss-el-api_2.2_spec-1.0.1.Final.jar"/>
- <classpathentry kind="lib" path="/home/remm/.m2/repository/org/jboss/web/jasper-jdt/7.0.3.Final/jasper-jdt-7.0.3.Final.jar"/>
+ <classpathentry kind="lib" path="/home/remm/.m2/repository/org/eclipse/jdt/core/compiler/ecj/4.2.2/ecj-4.2.2.jar"/>
<classpathentry kind="output" path=".settings/output"/>
</classpath>
Modified: branches/7.3.x/src/main/java/org/apache/jasper/compiler/JDTCompiler.java
===================================================================
--- branches/7.3.x/src/main/java/org/apache/jasper/compiler/JDTCompiler.java 2013-12-02 09:57:49 UTC (rev 2316)
+++ branches/7.3.x/src/main/java/org/apache/jasper/compiler/JDTCompiler.java 2013-12-02 12:06:55 UTC (rev 2317)
@@ -155,6 +155,10 @@
}
return result;
}
+
+ public boolean ignoreOptionalProblems() {
+ return false;
+ }
}
final INameEnvironment env = new INameEnvironment() {
11 years, 1 month
JBossWeb SVN: r2316 - in branches: 7.4.x/src/main/java/org/apache/coyote/http11 and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2013-12-02 04:57:49 -0500 (Mon, 02 Dec 2013)
New Revision: 2316
Modified:
branches/7.3.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java
branches/7.3.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java
branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java
branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java
Log:
Fix apparently badly ported JMX code (java.io is correct, but not NIO 2 or native).
Modified: branches/7.3.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- branches/7.3.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java 2013-11-29 16:40:39 UTC (rev 2315)
+++ branches/7.3.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java 2013-12-02 09:57:49 UTC (rev 2316)
@@ -118,14 +118,14 @@
if( this.domain != null ) {
try {
tpOname=new ObjectName
- (domain + ":" + "type=ThreadPool,name=" + getName());
+ (domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
} catch (Exception e) {
CoyoteLogger.HTTP_LOGGER.errorRegisteringPool(e);
}
rgOname=new ObjectName
- (domain + ":type=GlobalRequestProcessor,name=" + getName());
+ (domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent
( cHandler.global, rgOname, null );
}
Modified: branches/7.3.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java
===================================================================
--- branches/7.3.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java 2013-11-29 16:40:39 UTC (rev 2315)
+++ branches/7.3.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java 2013-12-02 09:57:49 UTC (rev 2316)
@@ -129,12 +129,12 @@
if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
if (this.domain != null) {
try {
- tpOname = new ObjectName(domain + ":" + "type=ThreadPool,name=" + getName());
+ tpOname = new ObjectName(domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(endpoint, tpOname, null);
} catch (Exception e) {
CoyoteLogger.HTTP_LOGGER.errorRegisteringPool(e);
}
- rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getName());
+ rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(cHandler.global, rgOname, null);
}
}
Modified: branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java 2013-11-29 16:40:39 UTC (rev 2315)
+++ branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11AprProtocol.java 2013-12-02 09:57:49 UTC (rev 2316)
@@ -118,14 +118,14 @@
if( this.domain != null ) {
try {
tpOname=new ObjectName
- (domain + ":" + "type=ThreadPool,name=" + getName());
+ (domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
} catch (Exception e) {
CoyoteLogger.HTTP_LOGGER.errorRegisteringPool(e);
}
rgOname=new ObjectName
- (domain + ":type=GlobalRequestProcessor,name=" + getName());
+ (domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent
( cHandler.global, rgOname, null );
}
Modified: branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java 2013-11-29 16:40:39 UTC (rev 2315)
+++ branches/7.4.x/src/main/java/org/apache/coyote/http11/Http11NioProtocol.java 2013-12-02 09:57:49 UTC (rev 2316)
@@ -129,12 +129,12 @@
if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
if (this.domain != null) {
try {
- tpOname = new ObjectName(domain + ":" + "type=ThreadPool,name=" + getName());
+ tpOname = new ObjectName(domain + ":" + "type=ThreadPool,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(endpoint, tpOname, null);
} catch (Exception e) {
CoyoteLogger.HTTP_LOGGER.errorRegisteringPool(e);
}
- rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getName());
+ rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getJmxName());
Registry.getRegistry(null, null).registerComponent(cHandler.global, rgOname, null);
}
}
11 years, 1 month