JBossWeb SVN: r679 - trunk/java/org/apache/catalina/startup.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-20 09:36:44 -0400 (Fri, 20 Jun 2008)
New Revision: 679
Modified:
trunk/java/org/apache/catalina/startup/Embedded.java
Log:
AprLifecycleListener needs INIT_EVENT and AFTER_STOP_EVENT.
Modified: trunk/java/org/apache/catalina/startup/Embedded.java
===================================================================
--- trunk/java/org/apache/catalina/startup/Embedded.java 2008-06-20 11:25:23 UTC (rev 678)
+++ trunk/java/org/apache/catalina/startup/Embedded.java 2008-06-20 13:36:44 UTC (rev 679)
@@ -810,13 +810,18 @@
// Initialize some naming specific properties
initNaming();
+ // Initialise if not already done.
+ if (!initialized) {
+ initialized = true;
+ lifecycle.fireLifecycleEvent(INIT_EVENT, null);
+ }
+
// Validate and update our current component state
if (started)
throw new LifecycleException
(sm.getString("embedded.alreadyStarted"));
lifecycle.fireLifecycleEvent(START_EVENT, null);
started = true;
- initialized = true;
// Start our defined Engines first
for (int i = 0; i < engines.length; i++) {
@@ -865,6 +870,10 @@
if (engines[i] instanceof Lifecycle)
((Lifecycle) engines[i]).stop();
}
+ if (initialized) {
+ initialized = false;
+ lifecycle.fireLifecycleEvent(AFTER_STOP_EVENT, null);
+ }
}
17 years, 3 months
JBossWeb SVN: r678 - trunk/java/org/apache/tomcat/jni.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-20 07:25:23 -0400 (Fri, 20 Jun 2008)
New Revision: 678
Modified:
trunk/java/org/apache/tomcat/jni/Library.java
trunk/java/org/apache/tomcat/jni/LibraryLoader.java
Log:
Throws exceptions when something is really wrong.
Otherwise stuff like:
+++
java.lang.UnsatisfiedLinkError: /home/jfclere/jbossweb_trunk/output/build/bin/META-INF/lib/linux2/x64/libaprutil-1.so.0.2.8: libpq.so.3: cannot open shared object file: No such file or directory
+++
Can't be traced.
Modified: trunk/java/org/apache/tomcat/jni/Library.java
===================================================================
--- trunk/java/org/apache/tomcat/jni/Library.java 2008-06-19 18:04:17 UTC (rev 677)
+++ trunk/java/org/apache/tomcat/jni/Library.java 2008-06-20 11:25:23 UTC (rev 678)
@@ -33,6 +33,7 @@
static private Library _instance = null;
private Library()
+ throws Exception
{
boolean loaded = false;
String err = "";
@@ -42,6 +43,16 @@
loaded = true;
}
catch (Throwable e) {
+ String name = System.mapLibraryName(NAMES[i]);
+ String path = System.getProperty("java.library.path");
+ String sep = System.getProperty("path.separator");
+ String [] paths = path.split(sep);
+ for (int j=0; j<paths.length; j++) {
+ java.io.File fd = new java.io.File(paths[j] + System.getProperty("file.separator") + name);
+ if (fd.exists()) {
+ e.printStackTrace();
+ }
+ }
if ( i > 0)
err += ", ";
err += e.getMessage();
Modified: trunk/java/org/apache/tomcat/jni/LibraryLoader.java
===================================================================
--- trunk/java/org/apache/tomcat/jni/LibraryLoader.java 2008-06-19 18:04:17 UTC (rev 677)
+++ trunk/java/org/apache/tomcat/jni/LibraryLoader.java 2008-06-20 11:25:23 UTC (rev 678)
@@ -143,6 +143,12 @@
}
catch (Throwable d) {
if (!optional) {
+ java.io.File fd = new java.io.File(fullPath);
+ if (fd.exists()) {
+ d.printStackTrace();
+ } else {
+ System.out.println("Can't find: " + fullPath);
+ }
throw new UnsatisfiedLinkError(dlibName);
}
}
17 years, 3 months
JBossWeb SVN: r677 - in trunk/java/org/apache/catalina: connector and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-19 14:04:17 -0400 (Thu, 19 Jun 2008)
New Revision: 677
Modified:
trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
trunk/java/org/apache/catalina/connector/Request.java
Log:
Fix JBAS-5645
Modified: trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java 2008-06-19 17:12:53 UTC (rev 676)
+++ trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java 2008-06-19 18:04:17 UTC (rev 677)
@@ -430,7 +430,8 @@
if ("POST".equalsIgnoreCase(saved.getMethod())) {
ByteChunk body = saved.getBody();
- if (body != null) {
+ if (body != null && body.getLength() > 0) {
+ request.clearParameters();
request.getCoyoteRequest().action
(ActionCode.ACTION_REQ_SET_BODY_REPLAY, body);
@@ -445,6 +446,16 @@
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());
@@ -504,6 +515,16 @@
}
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);
+ }
+ }
}
saved.setMethod(request.getMethod());
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2008-06-19 17:12:53 UTC (rev 676)
+++ trunk/java/org/apache/catalina/connector/Request.java 2008-06-19 18:04:17 UTC (rev 677)
@@ -1590,7 +1590,7 @@
* Clear the collection of parameters associated with this Request.
*/
public void clearParameters() {
- // Not used
+ parametersParsed = false;
}
17 years, 3 months
JBossWeb SVN: r676 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/valves.
by jbossweb-commits@lists.jboss.org
Author: mmoyses
Date: 2008-06-19 13:12:53 -0400 (Thu, 19 Jun 2008)
New Revision: 676
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/valves/mbeans-descriptors.xml
Log:
JBAS-5644: containerName is read-only
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/valves/mbeans-descriptors.xml
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/valves/mbeans-descriptors.xml 2008-06-19 17:00:41 UTC (rev 675)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/valves/mbeans-descriptors.xml 2008-06-19 17:12:53 UTC (rev 676)
@@ -19,7 +19,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
<attribute name="directory"
description="The directory in which log files are created"
@@ -89,7 +90,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
</mbean>
@@ -111,7 +113,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
<attribute name="directory"
description="The directory in which log files are created"
@@ -176,7 +179,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
<attribute name="directory"
description="The directory in which log files are created"
@@ -226,7 +230,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
<attribute name="concurrency"
description="Desired concurrency level"
@@ -250,7 +255,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
<attribute name="className"
description="Fully qualified class name of the managed object"
@@ -277,7 +283,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
<attribute name="className"
description="Fully qualified class name of the managed object"
@@ -298,7 +305,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
<attribute name="className"
description="Fully qualified class name of the managed object"
@@ -320,7 +328,8 @@
<attribute name="containerName"
description="Object name of the container"
- type="javax.management.ObjectName"/>
+ type="javax.management.ObjectName"
+ writeable="false"/>
</mbean>
17 years, 3 months
JBossWeb SVN: r674 - sandbox/webapps.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-19 08:58:13 -0400 (Thu, 19 Jun 2008)
New Revision: 674
Modified:
sandbox/webapps/jboss-web.xml
Log:
In Jboss use the jmx-console existing users
Modified: sandbox/webapps/jboss-web.xml
===================================================================
--- sandbox/webapps/jboss-web.xml 2008-06-19 10:02:03 UTC (rev 673)
+++ sandbox/webapps/jboss-web.xml 2008-06-19 12:58:13 UTC (rev 674)
@@ -14,4 +14,9 @@
<virtual-host>jfcpc.gva.redhat.com</virtual-host>
-->
+ <!-- In Jboss use the jmx-console existing users -->
+ <context-root>/myapp</context-root>
+ <security-domain>java:/jaas/jmx-console</security-domain>
+
+
</jboss-web>
17 years, 3 months
JBossWeb SVN: r673 - in sandbox/webapps: html and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-19 06:02:03 -0400 (Thu, 19 Jun 2008)
New Revision: 673
Added:
sandbox/webapps/html/test_form.html
sandbox/webapps/html/test_form.jsp
Modified:
sandbox/webapps/myapp.xml
sandbox/webapps/src/TestFilter.java
Log:
Add a simple test for JBAS-5645
Added: sandbox/webapps/html/test_form.html
===================================================================
--- sandbox/webapps/html/test_form.html (rev 0)
+++ sandbox/webapps/html/test_form.html 2008-06-19 10:02:03 UTC (rev 673)
@@ -0,0 +1,15 @@
+<html>
+<head>
+ <title>Form test Example</title>
+</head>
+<body>
+
+<b> Send something...</b>
+<form name="myform" action="test_form.jsp" method="post">
+ Specify your name:<br />
+ <input type="text" name="name" size="15"/><br/>
+ <input type="submit" name="Submit" value="Submit your files"/>
+</form>
+
+</body>
+</html>
Added: sandbox/webapps/html/test_form.jsp
===================================================================
--- sandbox/webapps/html/test_form.jsp (rev 0)
+++ sandbox/webapps/html/test_form.jsp 2008-06-19 10:02:03 UTC (rev 673)
@@ -0,0 +1,28 @@
+<html>
+<head>
+ <title>Form test Example</title>
+</head>
+<body>
+
+<%
+String value = request.getParameter("name");
+if (value != null) {
+%>
+ <h1>Data Received at the Server</h1>
+
+Name <%= value %><br/>
+<%
+} else {
+%>
+<b> Nothing received</b>
+<form name="myform" action="test_form.jsp" method="post">
+ Specify your name:<br />
+ <input type="text" name="name" size="15"/><br/>
+ <input type="submit" name="Submit" value="Submit your files"/>
+</form>
+<%
+}
+%>
+
+</body>
+</html>
Modified: sandbox/webapps/myapp.xml
===================================================================
--- sandbox/webapps/myapp.xml 2008-06-19 03:21:52 UTC (rev 672)
+++ sandbox/webapps/myapp.xml 2008-06-19 10:02:03 UTC (rev 673)
@@ -166,11 +166,13 @@
<url-pattern>/TestDispatch</url-pattern>
</servlet-mapping>
+
<!-- Security testings -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Security Tests</web-resource-name>
<url-pattern>/UTF8.jsp</url-pattern>
+ <url-pattern>/test_form.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
Modified: sandbox/webapps/src/TestFilter.java
===================================================================
--- sandbox/webapps/src/TestFilter.java 2008-06-19 03:21:52 UTC (rev 672)
+++ sandbox/webapps/src/TestFilter.java 2008-06-19 10:02:03 UTC (rev 673)
@@ -77,8 +77,11 @@
chain.doFilter(request, response);
return;
}
+ if (path.endsWith(".jsp")) {
+ chain.doFilter(request, response);
+ return;
+ }
-
// get action
String action = req.getParameter("do");
if (action == null) {
17 years, 3 months
JBossWeb SVN: r671 - sandbox/webapps.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-18 12:23:29 -0400 (Wed, 18 Jun 2008)
New Revision: 671
Modified:
sandbox/webapps/jboss-web.xml
Log:
An example of setting the host in jboss-web.xml
Modified: sandbox/webapps/jboss-web.xml
===================================================================
--- sandbox/webapps/jboss-web.xml 2008-06-18 09:23:46 UTC (rev 670)
+++ sandbox/webapps/jboss-web.xml 2008-06-18 16:23:29 UTC (rev 671)
@@ -9,4 +9,9 @@
</replication-config>
+<!-- Comment out to test virtualHosts
+<context-root>/test2</context-root>
+<virtual-host>jfcpc.gva.redhat.com</virtual-host>
+ -->
+
</jboss-web>
17 years, 3 months
JBossWeb SVN: r670 - in trunk/java/org/apache/catalina: core and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-18 05:23:46 -0400 (Wed, 18 Jun 2008)
New Revision: 670
Modified:
trunk/java/org/apache/catalina/Server.java
trunk/java/org/apache/catalina/core/StandardServer.java
trunk/java/org/apache/catalina/startup/Catalina.java
Log:
Allow to start several JBossWEB on one machine with multiple IP.
Modified: trunk/java/org/apache/catalina/Server.java
===================================================================
--- trunk/java/org/apache/catalina/Server.java 2008-06-17 10:29:23 UTC (rev 669)
+++ trunk/java/org/apache/catalina/Server.java 2008-06-18 09:23:46 UTC (rev 670)
@@ -89,6 +89,20 @@
/**
+ * Return the address on which we listen to for shutdown commands.
+ */
+ public String getAddress();
+
+
+ /**
+ * Set the address on which we listen to for shutdown commands.
+ *
+ * @param address The new address
+ */
+ public void setAddress(String address);
+
+
+ /**
* Return the shutdown command string we are waiting for.
*/
public String getShutdown();
Modified: trunk/java/org/apache/catalina/core/StandardServer.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardServer.java 2008-06-17 10:29:23 UTC (rev 669)
+++ trunk/java/org/apache/catalina/core/StandardServer.java 2008-06-18 09:23:46 UTC (rev 670)
@@ -136,7 +136,12 @@
*/
private int port = 8005;
+ /**
+ * The address on which we wait for shutdown commands.
+ */
+ private String address = "localhost";
+
/**
* A random number generator that is <strong>only</strong> used if
* the shutdown command string is longer than 1024 characters.
@@ -280,6 +285,27 @@
/**
+ * Return the address on which we listen to for shutdown commands.
+ */
+ public String getAddress() {
+
+ return (this.address);
+
+ }
+
+
+ /**
+ * Set the address on which we listen to for shutdown commands.
+ *
+ * @param address The new address
+ */
+ public void setAddress(String address) {
+
+ this.address = address;
+
+ }
+
+ /**
* Return the shutdown command string we are waiting for.
*/
public String getShutdown() {
@@ -371,9 +397,10 @@
try {
serverSocket =
new ServerSocket(port, 1,
- InetAddress.getByName("localhost"));
+ InetAddress.getByName(address));
} catch (IOException e) {
- log.error("StandardServer.await: create[" + port
+ log.error("StandardServer.await: create[" + address
+ + ":" + port
+ "]: ", e);
System.exit(1);
}
Modified: trunk/java/org/apache/catalina/startup/Catalina.java
===================================================================
--- trunk/java/org/apache/catalina/startup/Catalina.java 2008-06-17 10:29:23 UTC (rev 669)
+++ trunk/java/org/apache/catalina/startup/Catalina.java 2008-06-18 09:23:46 UTC (rev 670)
@@ -412,7 +412,7 @@
// Stop the existing server
try {
- Socket socket = new Socket("localhost", server.getPort());
+ Socket socket = new Socket(server.getAddress(), server.getPort());
OutputStream stream = socket.getOutputStream();
String shutdown = server.getShutdown();
for (int i = 0; i < shutdown.length(); i++)
17 years, 3 months
JBossWeb SVN: r669 - in trunk/java/org/apache/catalina: session and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-06-17 06:29:23 -0400 (Tue, 17 Jun 2008)
New Revision: 669
Modified:
trunk/java/org/apache/catalina/connector/MapperListener.java
trunk/java/org/apache/catalina/session/StandardSession.java
Log:
- Port two minor Tomcat patches.
Modified: trunk/java/org/apache/catalina/connector/MapperListener.java
===================================================================
--- trunk/java/org/apache/catalina/connector/MapperListener.java 2008-06-12 14:22:50 UTC (rev 668)
+++ trunk/java/org/apache/catalina/connector/MapperListener.java 2008-06-17 10:29:23 UTC (rev 669)
@@ -26,14 +26,13 @@
import javax.management.ObjectInstance;
import javax.management.ObjectName;
-
-
+import org.apache.catalina.core.StandardContext;
+import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.http.mapper.Mapper;
+import org.apache.tomcat.util.http.mapper.MappingData;
import org.apache.tomcat.util.modeler.Registry;
-
import org.apache.tomcat.util.res.StringManager;
import org.jboss.logging.Logger;
-import org.jboss.logging.Logger;
/**
@@ -430,6 +429,17 @@
if (contextName.equals("/")) {
contextName = "";
}
+ // Don't un-map a context that is paused
+ MessageBytes hostMB = MessageBytes.newInstance();
+ hostMB.setString(hostName);
+ MessageBytes contextMB = MessageBytes.newInstance();
+ contextMB.setString(contextName);
+ MappingData mappingData = new MappingData();
+ mapper.map(hostMB, contextMB, mappingData);
+ if (mappingData.context instanceof StandardContext &&
+ ((StandardContext)mappingData.context).getPaused()) {
+ return;
+ }
if(log.isDebugEnabled())
log.debug(sm.getString
("mapperListener.unregisterContext", contextName));
Modified: trunk/java/org/apache/catalina/session/StandardSession.java
===================================================================
--- trunk/java/org/apache/catalina/session/StandardSession.java 2008-06-12 14:22:50 UTC (rev 668)
+++ trunk/java/org/apache/catalina/session/StandardSession.java 2008-06-17 10:29:23 UTC (rev 669)
@@ -1032,6 +1032,10 @@
throw new IllegalStateException
(sm.getString("standardSession.getAttribute.ise"));
+ if (name == null) {
+ return null;
+ }
+
return (attributes.get(name));
}
17 years, 3 months
JBossWeb SVN: r668 - trunk/java/org/jboss/web/cluster/advertise.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-06-12 10:22:50 -0400 (Thu, 12 Jun 2008)
New Revision: 668
Modified:
trunk/java/org/jboss/web/cluster/advertise/AdvertiseListener.java
trunk/java/org/jboss/web/cluster/advertise/AdvertisedServer.java
Log:
- Cleanup, no change.
Modified: trunk/java/org/jboss/web/cluster/advertise/AdvertiseListener.java
===================================================================
--- trunk/java/org/jboss/web/cluster/advertise/AdvertiseListener.java 2008-06-12 14:20:09 UTC (rev 667)
+++ trunk/java/org/jboss/web/cluster/advertise/AdvertiseListener.java 2008-06-12 14:22:50 UTC (rev 668)
@@ -25,25 +25,19 @@
package org.jboss.web.cluster.advertise;
import java.io.IOException;
-
-import java.net.InetAddress;
-import java.net.SocketAddress;
import java.net.DatagramPacket;
+import java.net.InetAddress;
import java.net.MulticastSocket;
-import java.net.NetworkInterface;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
import java.util.Date;
-import java.util.Locale;
import java.util.HashMap;
-import java.util.Collection;
+import java.util.Locale;
-import java.security.MessageDigest;
-import java.security.SecureRandom;
-import java.security.NoSuchAlgorithmException;
-
import org.jboss.web.cluster.ClusterListener;
Modified: trunk/java/org/jboss/web/cluster/advertise/AdvertisedServer.java
===================================================================
--- trunk/java/org/jboss/web/cluster/advertise/AdvertisedServer.java 2008-06-12 14:20:09 UTC (rev 667)
+++ trunk/java/org/jboss/web/cluster/advertise/AdvertisedServer.java 2008-06-12 14:22:50 UTC (rev 668)
@@ -26,7 +26,6 @@
import java.util.Date;
import java.util.HashMap;
-import java.util.Collection;
/**
* Advertised server instance
@@ -53,11 +52,6 @@
/** Manager-Host header */
public static String MANAGER_HOST = "X-Manager-Host";
- private AdvertisedServer()
- {
- // Disable creation.
- }
-
protected AdvertisedServer(String server)
{
this.server = server;
17 years, 3 months