avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ne...@apache.org
Subject cvs commit: avalon/fortress/tools/src/java/org/apache/avalon/fortress/tools FortressBean.java
Date Tue, 02 Dec 2003 13:37:59 GMT
neeme       2003/12/02 05:37:59

  Modified:    fortress/tools/src/java/org/apache/avalon/fortress/tools
                        FortressBean.java
  Log:
  added some more logging to classloader handling
  
  Revision  Changes    Path
  1.2       +10 -2     avalon/fortress/tools/src/java/org/apache/avalon/fortress/tools/FortressBean.java
  
  Index: FortressBean.java
  ===================================================================
  RCS file: /home/cvs/avalon/fortress/tools/src/java/org/apache/avalon/fortress/tools/FortressBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FortressBean.java	1 Dec 2003 18:04:15 -0000	1.1
  +++ FortressBean.java	2 Dec 2003 13:37:59 -0000	1.2
  @@ -107,7 +107,15 @@
       public void initialize() throws Exception {
           //only initialize if we do not already have a servicemanager passed in from outside
           if (this.sm == null) {
  -            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
  +            if (Thread.currentThread().getContextClassLoader() == null) {
  +                if (this.getClass().getClassLoader() != null) {
  +                    ClassLoader cl = this.getClass().getClassLoader();
  +                    config.setContextClassLoader(cl);
  +                    Thread.currentThread().setContextClassLoader(cl);
  +                } else {
  +                    getLogger().warn("context classloader not set and class classloader
is null!");
  +                }
  +            }
               // Get the root container initialized
               this.cm = new DefaultContainerManager(config.getContext());
               ContainerUtil.initialize(cm);
  
  
  

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


Mime
View raw message