http://people.apache.org/~fhanik/patches/digester-attribute-warnings.patch
+1: fhanik, yoavs
-1:
-
-* Add missing mbean descriptor
- http://people.apache.org/~fhanik/patches/loader-mbean.patch
- +1: fhanik,funkman,yoavs
- -1:
-
-* Proposed solution to http://issues.apache.org/bugzilla/show_bug.cgi?id=42693
- Patch: http://issues.apache.org/bugzilla/attachment.cgi?id=20940
- +1: fhanik,funkman, yoavs
- -1:
* IcedTea support. Upcoming Linux distributions will package a (working) open source JRE,
available in /usr. As a result, it could now be possible to use a "/usr/bin/java" binary
-1:
0: yoavs
-* Fix multicasting bind address on multihomed computers
- http://issues.apache.org/bugzilla/show_bug.cgi?id=43641
- +1: fhanik, pero, yoavs, markt
- -1:
-
-* Warn if connector can not use external executors
- http://issues.apache.org/bugzilla/show_bug.cgi?id=43643
- +1: fhanik, pero, yoavs, markt
- -1:
-
-* Fix SSL buffer bug
- http://issues.apache.org/bugzilla/show_bug.cgi?id=43653
- +1: fhanik, yoavs, markt
- -1:
-
+
* Add a working ANT script that signs and publishes JARs to a maven repo
http://people.apache.org/~fhanik/patches/maven-publish.patch
+1: fhanik, yoavs
group="Loader"
type="org.apache.catalina.loader.WebappClassLoader" />
+ <mbean name="VirtualWebappLoader"
+ description="Extension of the webapp class loader with additional features"
+ domain="Catalina"
+ group="Loader"
+ type="org.apache.catalina.loader.VirtualWebappLoader" />
</mbeans-descriptors>
import org.apache.catalina.Executor;
import org.apache.tomcat.util.IntrospectionUtils;
import java.lang.reflect.Method;
+import org.apache.juli.logging.LogFactory;
+import org.apache.juli.logging.Log;
/**
public class ConnectorCreateRule extends Rule {
-
+ protected static Log log = LogFactory.getLog(ConnectorCreateRule.class);
// --------------------------------------------------------- Public Methods
public void _setExecutor(Connector con, Executor ex) throws Exception {
Method m = IntrospectionUtils.findMethod(con.getProtocolHandler().getClass(),"setExecutor",new Class[] {java.util.concurrent.Executor.class});
- m.invoke(con.getProtocolHandler(),new Object[] {ex});
+ if (m!=null) {
+ m.invoke(con.getProtocolHandler(), new Object[] {ex});
+ }else {
+ log.warn("Connector ["+con+"] does not support external executors. Method setExecutor(java.util.concurrent.Executor) not found.");
+ }
}
import org.apache.catalina.tribes.Channel;
import org.apache.catalina.tribes.Member;
import org.apache.catalina.tribes.MembershipListener;
+import java.net.BindException;
/**
* A <b>membership</b> implementation using simple multicast.
}
protected void setupSocket() throws IOException {
- if (mcastBindAddress != null) socket = new MulticastSocket(new InetSocketAddress(mcastBindAddress, port));
- else socket = new MulticastSocket(port);
+ if (mcastBindAddress != null) {
+ try {
+ log.info("Attempting to bind the multicast socket to "+address+":"+port);
+ socket = new MulticastSocket(new InetSocketAddress(address,port));
+ } catch (BindException e) {
+ /*
+ * On some plattforms (e.g. Linux) it is not possible to bind
+ * to the multicast address. In this case only bind to the
+ * port.
+ */
+ log.info("Binding to multicast address, failed. Binding to port only.");
+ socket = new MulticastSocket(port);
+ }
+ } else {
+ socket = new MulticastSocket(port);
+ }
socket.setLoopbackMode(false); //hint that we don't need loop back messages
if (mcastBindAddress != null) {
if(log.isInfoEnabled())
ctxt.checkOutputDir();
String javaFileName = ctxt.getServletJavaFileName();
- ServletWriter writer = null;
+ ServletWriter writer = null;
try {
- // Setup the ServletWriter
- String javaEncoding = ctxt.getOptions().getJavaEncoding();
- OutputStreamWriter osw = null;
-
- try {
- osw = new OutputStreamWriter(
- new FileOutputStream(javaFileName), javaEncoding);
- } catch (UnsupportedEncodingException ex) {
- errDispatcher.jspError("jsp.error.needAlternateJavaEncoding",
- javaEncoding);
- }
-
- writer = new ServletWriter(new PrintWriter(osw));
- ctxt.setWriter(writer);
// Reset the temporary variable counter for the generator.
JspUtil.resetTemporaryVariableName();
if (ctxt.isPrototypeMode()) {
// generate prototype .java file for the tag file
+ writer = setupContextWriter(javaFileName);
Generator.generate(writer, this, pageNodes);
writer.close();
writer = null;
ELFunctionMapper.map(this, pageNodes);
// generate servlet .java file
+ writer = setupContextWriter(javaFileName);
Generator.generate(writer, this, pageNodes);
writer.close();
writer = null;
return smapStr;
}
+ private ServletWriter setupContextWriter(String javaFileName)
+ throws FileNotFoundException, JasperException {
+ ServletWriter writer;
+ // Setup the ServletWriter
+ String javaEncoding = ctxt.getOptions().getJavaEncoding();
+ OutputStreamWriter osw = null;
+
+ try {
+ osw = new OutputStreamWriter(
+ new FileOutputStream(javaFileName), javaEncoding);
+ } catch (UnsupportedEncodingException ex) {
+ errDispatcher.jspError("jsp.error.needAlternateJavaEncoding",
+ javaEncoding);
+ }
+
+ writer = new ServletWriter(new PrintWriter(osw));
+ ctxt.setWriter(writer);
+ return writer;
+ }
+
/**
* Compile the servlet from .java file to .class file
*/
boolean timedout = false;
int keycount = 1; //assume we can write
long time = System.currentTimeMillis(); //start the timeout timer
- if (socket.getBufHandler().getWriteBuffer() != buf) {
- socket.getBufHandler().getWriteBuffer().put(buf);
- buf = socket.getBufHandler().getWriteBuffer();
- }
try {
while ( (!timedout) && buf.hasRemaining()) {
if (keycount > 0) { //only write if we were registered for a write
boolean timedout = false;
int keycount = 1; //assume we can write
long time = System.currentTimeMillis(); //start the timeout timer
- if ( socket.getBufHandler().getWriteBuffer()!= buf ) {
- socket.getBufHandler().getWriteBuffer().put(buf);
- buf = socket.getBufHandler().getWriteBuffer();
- }
try {
while ( (!timedout) && buf.hasRemaining() ) {
int cnt = 0;
* @todo Implement this java.nio.channels.WritableByteChannel method
*/
public int write(ByteBuffer src) throws IOException {
- //make sure we can handle expand, and that we only use on buffer
- if ( src != bufHandler.getWriteBuffer() ) throw new IllegalArgumentException("You can only write using the application write buffer provided by the handler.");
- //are we closing or closed?
- if ( closing || closed) throw new IOException("Channel is in closing state.");
-
- //the number of bytes written
- int written = 0;
-
- if (!flush(netOutBuffer)) {
- //we haven't emptied out the buffer yet
+ if ( src == this.netOutBuffer ) {
+ //we can get here through a recursive call
+ //by using the NioBlockingSelector
+ int written = sc.write(src);
return written;
- }
-
- /*
- * The data buffer is empty, we can reuse the entire buffer.
- */
- netOutBuffer.clear();
-
- SSLEngineResult result = sslEngine.wrap(src, netOutBuffer);
- written = result.bytesConsumed();
- netOutBuffer.flip();
-
- if (result.getStatus() == Status.OK) {
- if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) tasks();
} else {
- throw new IOException("Unable to wrap data, invalid engine state: " +result.getStatus());
- }
-
- //force a flush
- flush(netOutBuffer);
-
- return written;
+ //make sure we can handle expand, and that we only use on buffer
+ if ( src != bufHandler.getWriteBuffer() ) throw new IllegalArgumentException("You can only write using the application write buffer provided by the handler.");
+ //are we closing or closed?
+ if ( closing || closed) throw new IOException("Channel is in closing state.");
+
+ //the number of bytes written
+ int written = 0;
+
+ if (!flush(netOutBuffer)) {
+ //we haven't emptied out the buffer yet
+ return written;
+ }
+
+ /*
+ * The data buffer is empty, we can reuse the entire buffer.
+ */
+ netOutBuffer.clear();
+
+ SSLEngineResult result = sslEngine.wrap(src, netOutBuffer);
+ written = result.bytesConsumed();
+ netOutBuffer.flip();
+
+ if (result.getStatus() == Status.OK) {
+ if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) tasks();
+ } else {
+ throw new IOException("Unable to wrap data, invalid engine state: " +result.getStatus());
+ }
+
+ //force a flush
+ flush(netOutBuffer);
+ return written;
+ }
}
/**
</subsection>
<subsection name="Catalina">
<changelog>
+ <fix><bug>43653</bug>Fix SSL buffer mixup when response is unable to write more than socket buffer can handle</fix>
+ <fix><bug>43643</bug>If connector doesn't support external executor, display warning</fix>
+ <fix><bug>43641</bug>Property bind multicast address for cluster membership</fix>
+ <fix><bug>42693</bug> Fix JSP compiler bug</fix>
+ <update>Add mbean descriptor for virtual webapp loader</update>
<fix><bug>43487</bug>
Fix request processing stats
</fix>