Index: extras/rails/src/main/java/com/sun/enterprise/rails/RailsDeployer.java =================================================================== --- extras/rails/src/main/java/com/sun/enterprise/rails/RailsDeployer.java (revision 17640) +++ extras/rails/src/main/java/com/sun/enterprise/rails/RailsDeployer.java (working copy) @@ -60,6 +60,9 @@ public RailsApplication load(RailsContainer container, DeploymentContext context) { String appContext = "/" + context.getCommandParameters().getProperty(DeployCommand.NAME); + if (appContext.equals("/ROOT")) { + appContext = ""; + } // TODO : we should really get the next available pool. RubyObjectPool pool = container.getPool(); String contextRoot = context.getSource().getURI().getSchemeSpecificPart(); Index: core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyAdapter.java =================================================================== --- core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyAdapter.java (revision 17640) +++ core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyAdapter.java (working copy) @@ -235,13 +235,18 @@ if (Utils.getDefaultLogger().isLoggable(Level.FINER)) { Utils.getDefaultLogger().finer("Received something on " + req.requestURI()); } - + boolean hasRoot = false; + for (String key : endpoints.keySet()) { + if (key.equals("/")) { + hasRoot = true; + } + } String requestURI = req.requestURI().toString(); try{ // TODO: This for loop is extremely dangerous. We need to re-use // Grizzly HTTP Mapper here to avoid scripting attach, dos, etc. for(;;) { - com.sun.grizzly.tcp.Adapter dispatchTo = endpoints.get(requestURI); + com.sun.grizzly.tcp.Adapter dispatchTo = endpoints.get(hasRoot ? "/" : requestURI); ApplicationContainer container = apps.get(dispatchTo); if (dispatchTo!=null) { ClassLoader cl = null;