You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by "Messner, Greg" <gm...@titan.com> on 2003/12/27 02:08:50 UTC

JettyWebServer.java Patch

I've been experimenting with Merlin embedded in an application with great success.  Just recently I tried to utilize the org.apache.avalon.merlin.http.WebServer service which is implemented by org.apache.avalon.merlin.http.JettyWebServer and ran into a problem using WebServer.deployWebApplication(String context, String appPath).  I was able to fix the problem in JettyWebServer.java by modifying loadWebApplicationContext(String contextName, String appURL) with the below patch.

BTW, keep up the great work.

Greg





Index: merlin/web/http/impl/src/java/org/apache/avalon/merlin/http/JettyWebServer.java
===================================================================
RCS file: /home/cvspublic/avalon/merlin/web/http/impl/src/java/org/apache/avalon/merlin/http/JettyWebServer.java,v
retrieving revision 1.3
diff -u -r1.3 JettyWebServer.java
--- merlin/web/http/impl/src/java/org/apache/avalon/merlin/http/JettyWebServer.java	2 Dec 2003 00:07:56 -0000	1.3
+++ merlin/web/http/impl/src/java/org/apache/avalon/merlin/http/JettyWebServer.java	27 Dec 2003 01:02:53 -0000
@@ -638,13 +638,23 @@
                 }
             }
             wac.setContextPath("/" + contextName + "/*");
-            String clazzName = org.apache.avalon.merlin.http.SessionManager.class.getName();
+            String clazzName = org.mortbay.jetty.servlet.SessionManager.class.getName();
             wac.getServletHandler().setSessionManager((SessionManager) m_serviceManager.lookup(clazzName));
         } catch (Exception e) {
             m_logger.error("Failed to load context: " + contextName);
             return;
         }
         m_httpServer.addContext(wac);
+
+        // Start the context if the HttpServer instance has been started
+        if (m_httpServer.isStarted()) {
+
+            try {
+                wac.start();
+            } catch (Exception e) {
+                m_logger.error("Failed to start context: " + contextName);
+            }
+        }
     }
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: JettyWebServer.java Patch

Posted by Stephen McConnell <mc...@apache.org>.

Messner, Greg wrote:

>I've been experimenting with Merlin embedded in an application with great success.  
>

Good news!

There are more than a couple of people in the homeland defence that will be
more than interested in this result.


>Just recently I tried to utilize the org.apache.avalon.merlin.http.WebServer service which is implemented by org.apache.avalon.merlin.http.JettyWebServer and ran into a problem using WebServer.deployWebApplication(String context, String appPath).  I was able to fix the problem in JettyWebServer.java by modifying loadWebApplicationContext(String contextName, String appURL) with the below patch.
>

The patch you supplied addresses two aspects.  One concerns the 
clazzName variable which I'll leave to Timothy to address because this 
has a direct relationship to the static dependecy declarations within 
derived context classes. IMO - this area is not so clear cut.

>
>BTW, keep up the great work.
>

Just something to keep in mind - the avalon http package has not been 
released at this time and there is stuff happening that could change 
this from  a component-side solution to a container-side solution.  All 
that means is "don't unsubscribe from this list because things could 
change" .. but if things do change - they will be really, really, cool!

Cheers, Steve.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org