geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r800692 - /geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/EngineGBean.java
Date Tue, 04 Aug 2009 07:47:50 GMT
Author: xuhaihong
Date: Tue Aug  4 07:47:50 2009
New Revision: 800692

URL: http://svn.apache.org/viewvc?rev=800692&view=rev
Log:
GERONIMO-4771 Defining secondary HostGBean leads to ERROR [JAASRealm]

Modified:
    geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/EngineGBean.java

Modified: geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/EngineGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/EngineGBean.java?rev=800692&r1=800691&r2=800692&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/EngineGBean.java
(original)
+++ geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/EngineGBean.java
Tue Aug  4 07:47:50 2009
@@ -139,11 +139,17 @@
             refs.addReferenceCollectionListener(new ReferenceCollectionListener() {
 
                 public void memberAdded(ReferenceCollectionEvent event) {
-                    Object o = event.getMember();
-                    ObjectRetriever objectRetriever = (ObjectRetriever) o;
-                    String hostName = ((Host)objectRetriever.getInternalObject()).getName();
-                    if (!hostName.equals(defaultHostName))
-                        addHost(objectRetriever);
+                    ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
+                    try {
+                        Thread.currentThread().setContextClassLoader(EngineGBean.this.getClass().getClassLoader());
+                        Object o = event.getMember();
+                        ObjectRetriever objectRetriever = (ObjectRetriever) o;
+                        String hostName = ((Host) objectRetriever.getInternalObject()).getName();
+                        if (!hostName.equals(defaultHostName))
+                            addHost(objectRetriever);
+                    } finally {
+                        Thread.currentThread().setContextClassLoader(oldClassLoader);
+                    }
                 }
 
                 public void memberRemoved(ReferenceCollectionEvent event) {



Mime
View raw message