Author: jstrachan
Date: Wed Sep 26 04:21:12 2007
New Revision: 579595

URL: http://svn.apache.org/viewvc?rev=579595&view=rev
Log:
added better error handling if a typeo is made in the <library> or <component> 
tags

Modified:
    
incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/ClassLoaderXmlPreprocessor.java

Modified: 
incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/ClassLoaderXmlPreprocessor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/ClassLoaderXmlPreprocessor.java?rev=579595&r1=579594&r2=579595&view=diff
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/ClassLoaderXmlPreprocessor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/ClassLoaderXmlPreprocessor.java
 Wed Sep 26 04:21:12 2007
@@ -215,10 +215,16 @@
             parents.add(getParentClassLoader(applicationContext));
             for (String library : sls) {
                 SharedLibrary sl = 
container.getRegistry().getSharedLibrary(library);
+                if (sl == null) {
+                    throw new IllegalStateException("No such shared library: " 
+ library);
+                }
                 parents.add(sl.getClassLoader());
             }
             for (String component : components) {
                 ComponentMBeanImpl componentMBean = 
container.getRegistry().getComponent(component);
+                if (componentMBean == null) {
+                    throw new IllegalStateException("No such component: " + 
componentMBean);
+                }
                 
parents.add(componentMBean.getComponent().getClass().getClassLoader());
             }
             classLoader = new 
JarFileClassLoader(applicationContext.getDisplayName(),


Reply via email to