You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2011/10/14 04:47:20 UTC
svn commit: r1183209 - in /geronimo/server/branches/2.2:
plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
plugins/tomcat/tomcat6/src/main/history/dependencies.xml pom.xml
Author: xuhaihong
Date: Fri Oct 14 02:47:19 2011
New Revision: 1183209
URL: http://svn.apache.org/viewvc?rev=1183209&view=rev
Log:
GERONIMO-6171
a. Comment out the codes for adding default context.
b. Use "" for the root context path
I do not think that we need to add a default context here, and actually, what is adding is a context of "TomcatWebContainer" as context path, which looks to me make no sense.
Also, in Tomcat, it uses "" to represent the default context, also named root context. Use '/' as the context path, which could cause an invalid requestURI in ApplicationContext, it could be something like //requestPath, sometimes, this will cause some issues in client applications.
Modified:
geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
geronimo/server/branches/2.2/plugins/tomcat/tomcat6/src/main/history/dependencies.xml
geronimo/server/branches/2.2/pom.xml
Modified: geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=1183209&r1=1183208&r2=1183209&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java (original)
+++ geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java Fri Oct 14 02:47:19 2011
@@ -84,7 +84,7 @@ public class TomcatContainer implements
*/
private final Engine engine;
- private final Map webServices = new HashMap();
+ private final Map<String, TomcatEJBWebServiceContext> webServices = new HashMap<String, TomcatEJBWebServiceContext>();
private final String objectName;
private final String[] applicationListeners;
private final WebManager manager;
@@ -150,7 +150,7 @@ public class TomcatContainer implements
// the default Realm if you are using container-managed security.
//Add default contexts
- File rootContext = new File(catalinaHome + "/ROOT");
+ /*File rootContext = new File(catalinaHome + "/ROOT");
String docBase = "";
if (rootContext.exists()) {
@@ -176,7 +176,7 @@ public class TomcatContainer implements
ctx.setServer(objName == null ? "geronimo" : objName.getKeyProperty(NameFactory.J2EE_SERVER));
}
host.addChild(defaultContext);
- }
+ }*/
// 6. Call addEngine() to attach this Engine to the set of defined
// Engines for this object.
@@ -265,7 +265,7 @@ public class TomcatContainer implements
* @see org.apache.catalina.Host
*/
public void addContext(TomcatContext contextInfo) throws Exception {
- Context context = createContext(contextInfo.getContextPath(), contextInfo.getDocBase(), contextInfo.getClassLoader());
+ Context context = createContext(contextInfo.getContextPath().equals("/") ? "" : contextInfo.getContextPath(), contextInfo.getDocBase(), contextInfo.getClassLoader());
// Set the context for the Tomcat implementation
contextInfo.setContext(context);
@@ -283,50 +283,6 @@ public class TomcatContainer implements
if (host == null) {
throw new IllegalArgumentException("Invalid virtual host '" + virtualServer + "'. Do you have a matching Host entry in the plan?");
}
-
- //Get the security-realm-name if there is one
- SecurityHolder secHolder = contextInfo.getSecurityHolder() == null? new SecurityHolder(): contextInfo.getSecurityHolder();
-
- //Did we declare a GBean at the context level?
-// if (contextInfo.getRealm() != null) {
-// Realm realm = contextInfo.getRealm();
-//
-// //Allow for the <security-realm-name> override from the
-// //geronimo-web.xml file to be used if our Realm is a JAAS type
-// if (secHolder.getConfigurationFactory() != null) {
-// if (realm instanceof JAASRealm) {
-// ((JAASRealm) realm).setAppName(secHolder.getConfigurationFactory().getConfigurationName());
-// }
-// }
-// context.setRealm(realm);
-// } else {
-// Realm realm = host.getRealm();
-// //Check and see if we have a declared realm name and no match to a parent name
-// if (secHolder.getConfigurationFactory() != null) {
-// //Is the context requiring JACC?
-// if (secHolder.isSecurity()) {
-// //JACC
-// realm = new TomcatGeronimoRealm(secHolder.getConfigurationFactory());
-// } else {
-// //JAAS
-// realm = new TomcatJAASRealm(secHolder.getConfigurationFactory());
-// ((JAASRealm) realm).setUserClassNames("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
-// ((JAASRealm) realm).setRoleClassNames("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
-// }
-//
-// if (log.isDebugEnabled()) {
-// log.debug("The security-realm-name '" + secHolder.getConfigurationFactory().getConfigurationName() +
-// "' was specified and a parent (Engine/Host) is not named the same or no RealmGBean was configured for this context. " +
-// "Creating a default " + realm.getClass().getName() +
-// " adapter for this context.");
-// }
-//
-// context.setRealm(realm);
-// } else {
-// //The same reason with the above
-// //anotherCtxObj.setRealm(realm);
-// }
-// }
// add application listeners to the new context
if (applicationListeners != null) {
@@ -382,15 +338,16 @@ public class TomcatContainer implements
Properties properties,
ClassLoader classLoader) throws Exception {
- if( log.isDebugEnabled() )
+ if (log.isDebugEnabled()) {
log.debug("Creating EJBWebService context '" + contextPath + "'.");
+ }
- TomcatEJBWebServiceContext context = new TomcatEJBWebServiceContext(contextPath, webServiceContainer, classLoader);
+ TomcatEJBWebServiceContext webServiceContext = new TomcatEJBWebServiceContext(contextPath, webServiceContainer, classLoader);
Subject defaultSubject = ContextManager.EMPTY;
ContextConfig config = new EjbWsContextConfig(policyContextId, configurationFactory, defaultSubject, authMethod, realmName);
- context.addLifecycleListener(config);
+ webServiceContext.addLifecycleListener(config);
- Context webServiceContext = (context);
+
String virtualServer;
if (virtualHosts != null && virtualHosts.length > 0) {
@@ -422,9 +379,9 @@ public class TomcatContainer implements
public Context createContext(String path, String docBase, ClassLoader cl) {
- if( log.isDebugEnabled() )
- log.debug("Creating context '" + path + "' with docBase '" +
- docBase + "'");
+ if (log.isDebugEnabled()) {
+ log.debug("Creating context '" + path + "' with docBase '" + docBase + "'");
+ }
GeronimoStandardContext context = new GeronimoStandardContext();
Modified: geronimo/server/branches/2.2/plugins/tomcat/tomcat6/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/tomcat/tomcat6/src/main/history/dependencies.xml?rev=1183209&r1=1183208&r2=1183209&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/tomcat/tomcat6/src/main/history/dependencies.xml (original)
+++ geronimo/server/branches/2.2/plugins/tomcat/tomcat6/src/main/history/dependencies.xml Fri Oct 14 02:47:19 2011
@@ -38,11 +38,6 @@
</dependency>
<dependency>
<groupId>org.apache.geronimo.ext.tomcat</groupId>
- <artifactId>shared</artifactId>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.ext.tomcat</groupId>
<artifactId>tribes</artifactId>
<type>jar</type>
</dependency>
Modified: geronimo/server/branches/2.2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/pom.xml?rev=1183209&r1=1183208&r2=1183209&view=diff
==============================================================================
--- geronimo/server/branches/2.2/pom.xml (original)
+++ geronimo/server/branches/2.2/pom.xml Fri Oct 14 02:47:19 2011
@@ -62,7 +62,7 @@
FIXME: STOP using properties for dependency versions unless you absolutly need them,
ie. you have a hundred dependencies that all use the same version.
-->
- <tomcatVersion>6.0.29.0</tomcatVersion>
+ <tomcatVersion>6.0.33.1</tomcatVersion>
<tomcatGroupId>org.apache.geronimo.ext.tomcat</tomcatGroupId>
<openejbVersion>3.1.5-SNAPSHOT</openejbVersion>