felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guilla...@apache.org
Subject svn commit: r1478410 - in /felix/trunk/ipojo: handler/temporal/temporal-dependency-handler/src/main/java/org/apache/felix/ipojo/handler/temporal/ runtime/api/src/main/java/org/apache/felix/ipojo/api/ runtime/api/src/main/java/org/apache/felix/ipojo/api...
Date Thu, 02 May 2013 15:19:33 GMT
Author: guillaume
Date: Thu May  2 15:19:32 2013
New Revision: 1478410

URL: http://svn.apache.org/r1478410
Log:
FELIX-4045 Chain Exceptions when possible

* Added some Throwable parameters in Exception sub classes to enable chaining
* Tracked most of the missing chained call in runtime project
* Chaining has not been changed in IT modules

Modified:
    felix/trunk/ipojo/handler/temporal/temporal-dependency-handler/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java
    felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/PrimitiveComponentType.java
    felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/composite/CompositeComponentType.java
    felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java
    felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java
    felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionException.java
    felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedService.java
    felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java
    felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/util/SourceManager.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationException.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/UnacceptableConfiguration.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Property.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java

Modified: felix/trunk/ipojo/handler/temporal/temporal-dependency-handler/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/temporal/temporal-dependency-handler/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/temporal/temporal-dependency-handler/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java (original)
+++ felix/trunk/ipojo/handler/temporal/temporal-dependency-handler/src/main/java/org/apache/felix/ipojo/handler/temporal/TemporalHandler.java Thu May  2 15:19:32 2013
@@ -195,7 +195,7 @@ public class TemporalHandler extends Pri
                 try {
                     filter = getInstanceManager().getContext().createFilter(fil);
                 } catch (InvalidSyntaxException e) {
-                    throw new ConfigurationException("A requirement filter is invalid : " + filter + " - " + e.getMessage());
+                    throw new ConfigurationException("A requirement filter is invalid : " + filter, e);
                 }
             }
 

Modified: felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/PrimitiveComponentType.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/PrimitiveComponentType.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/PrimitiveComponentType.java (original)
+++ felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/PrimitiveComponentType.java Thu May  2 15:19:32 2013
@@ -448,7 +448,7 @@ public class PrimitiveComponentType exte
             }
             m_factory.start();
         } catch (ConfigurationException e) {
-            throw new IllegalStateException("An exception occurs during factory initialization : " + e.getMessage());
+            throw new IllegalStateException("An exception occurs during factory initialization", e);
         }
 
     }
@@ -466,7 +466,7 @@ public class PrimitiveComponentType exte
             m_alreadyManipulated = newclazz.length == array.length;
             return newclazz;
         } catch (IOException e) {
-            throw new IllegalStateException("An exception occurs during implementation class manipulation : " + e.getMessage());
+            throw new IllegalStateException("An exception occurs during implementation class manipulation", e);
         }
     }
 

Modified: felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/composite/CompositeComponentType.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/composite/CompositeComponentType.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/composite/CompositeComponentType.java (original)
+++ felix/trunk/ipojo/runtime/api/src/main/java/org/apache/felix/ipojo/api/composite/CompositeComponentType.java Thu May  2 15:19:32 2013
@@ -318,7 +318,7 @@ public class CompositeComponentType exte
             m_factory = new CompositeFactory(m_context, m_metadata);
             m_factory.start();
         } catch (ConfigurationException e) {
-            throw new IllegalStateException("An exception occurs during factory initialization : " + e.getMessage());
+            throw new IllegalStateException("An exception occurs during factory initialization", e);
         }
 
     }

Modified: felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java (original)
+++ felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java Thu May  2 15:19:32 2013
@@ -254,7 +254,7 @@ public class InstanceHandler extends Com
                 conf = parseInstance(instances[i]);
             } catch (ParseException e) {
                 error("An instance cannot be parsed correctly", e);
-                throw new ConfigurationException("An instance cannot be parsed correctly : " + e.getMessage());
+                throw new ConfigurationException("An instance cannot be parsed correctly", e);
             }
 
             Properties instanceConfiguration = new Properties();

Modified: felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java (original)
+++ felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java Thu May  2 15:19:32 2013
@@ -107,7 +107,7 @@ public class ServiceDependencyHandler ex
         try {
             fil = getCompositeManager().getGlobalContext().createFilter(filter);
         } catch (InvalidSyntaxException e) {
-            throw new ConfigurationException("Malformed filter " + filter + " : " + e.getMessage());
+            throw new ConfigurationException("Malformed filter " + filter, e);
         }
 
         Properties prop = new Properties();
@@ -116,7 +116,7 @@ public class ServiceDependencyHandler ex
             try {
                 InstanceHandler.parseProperty(props[k], prop);
             } catch (ParseException e) {
-                throw new ConfigurationException("An instance configuration is invalid : " + e.getMessage());
+                throw new ConfigurationException("An instance configuration is invalid", e);
             }
         }
 
@@ -201,7 +201,7 @@ public class ServiceDependencyHandler ex
                 try {
                     fil = getCompositeManager().getGlobalContext().createFilter(filter);
                 } catch (InvalidSyntaxException e) {
-                    throw new ConfigurationException("A required filter " + filter + " is malformed : " + e.getMessage());
+                    throw new ConfigurationException("A required filter " + filter + " is malformed", e);
                 }
             }
 

Modified: felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionException.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionException.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionException.java (original)
+++ felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionException.java Thu May  2 15:19:32 2013
@@ -32,10 +32,13 @@ public class CompositionException extend
 
     /**
      * Constructor.
-     * @param message : a message.
+     * @param message a message.
      */
     public CompositionException(String message) {
-        super(message);
+        this(message, null);
     }
 
+    public CompositionException(String message, Throwable cause) {
+        super(message, cause);
+    }
 }

Modified: felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedService.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedService.java (original)
+++ felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedService.java Thu May  2 15:19:32 2013
@@ -125,9 +125,9 @@ public class ProvidedService implements 
             // Create the exports
             m_exports = new ServiceExporter(spec, filter, false, false, null, DependencyModel.DYNAMIC_BINDING_POLICY, m_scope, m_context, this, m_manager);
         } catch (InvalidSyntaxException e) {
-            throw new CompositionException("A provided service filter is invalid : " + e.getMessage());
+            throw new CompositionException("A provided service filter is invalid", e);
         } catch (ConfigurationException e) {
-            throw new CompositionException("The class " + m_composition.getSpecificationMetadata().getName() + " cannot be loaded : " + e.getMessage());
+            throw new CompositionException("The class " + m_composition.getSpecificationMetadata().getName() + " cannot be loaded", e);
         }
     }
 
@@ -216,11 +216,11 @@ public class ProvidedService implements 
             try {
                 m_instance = m_factory.createComponentInstance(props, m_manager.getServiceContext());
             } catch (UnacceptableConfiguration e) {
-                throw new IllegalStateException("Cannot create the service implementation : " + e.getMessage());
+                throw new IllegalStateException("Cannot create the service implementation", e);
             } catch (MissingHandlerException e) {
-                throw new IllegalStateException("Cannot create the service implementation : " + e.getMessage());
+                throw new IllegalStateException("Cannot create the service implementation", e);
             } catch (ConfigurationException e) {
-                throw new IllegalStateException("Cannot create the service implementation : " + e.getMessage());
+                throw new IllegalStateException("Cannot create the service implementation", e);
             }
         } else {
             // We have to reconfigure the instance in order to inject up to date glue component instance.

Modified: felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java (original)
+++ felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java Thu May  2 15:19:32 2013
@@ -157,7 +157,7 @@ public class ProvidedServiceHandler exte
                 try {
                     fil = m_context.createFilter(filter);
                 } catch (InvalidSyntaxException e) {
-                    throw new ConfigurationException("An exporter filter is invalid " + filter + " : " + e.getMessage());
+                    throw new ConfigurationException("An exporter filter is invalid " + filter, e);
                 }
 
                 Comparator cmp = DependencyModel.getComparator(provides[i], m_context);
@@ -350,16 +350,16 @@ public class ProvidedServiceHandler exte
             return; // No specification field
         } catch (ClassNotFoundException e) {
             error("[" + getCompositeManager().getInstanceName() + "] The service specification " + svc.getSpecification() + " cannot be load");
-            throw new CompositionException("The service specification " + svc.getSpecification() + " cannot be load : " + e.getMessage());
+            throw new CompositionException("The service specification " + svc.getSpecification() + " cannot be loaded", e);
         } catch (IllegalArgumentException e) {
             error("[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + svc.getSpecification() + " is not accessible : " + e.getMessage());
-            throw new CompositionException("The field 'specification' of the service specification " + svc.getSpecification() + " is not accessible : " + e.getMessage());
+            throw new CompositionException("The field 'specification' of the service specification " + svc.getSpecification() + " is not accessible", e);
         } catch (IllegalAccessException e) {
             error("[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + svc.getSpecification() + " is not accessible : " + e.getMessage());
-            throw new CompositionException("The field 'specification' of the service specification " + svc.getSpecification() + " is not accessible : " + e.getMessage());
+            throw new CompositionException("The field 'specification' of the service specification " + svc.getSpecification() + " is not accessible", e);
         } catch (ParseException e) {
             error("[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + svc.getSpecification() + " does not contain a valid String : " + e.getMessage());
-            throw new CompositionException("The field 'specification' of the service specification " + svc.getSpecification() + " does not contain a valid String : " + e.getMessage());
+            throw new CompositionException("The field 'specification' of the service specification " + svc.getSpecification() + " does not contain a valid String", e);
         }
     }
 
@@ -428,7 +428,7 @@ public class ProvidedServiceHandler exte
                     handlerManager.init(getCompositeManager(), new Element("composite", ""), new Properties());
                 } catch (ConfigurationException e) {
                     error("Internal error : cannot configure the Import Handler : " + e.getMessage());
-                    throw new CompositionException("Internal error : cannot configure the Import Handler : " + e.getMessage());
+                    throw new CompositionException("Internal error : cannot configure the Import Handler", e);
                 }
                 handler = (ServiceDependencyHandler) handlerManager.getHandler();
                 getCompositeManager().addCompositeHandler(handlerManager);
@@ -447,14 +447,14 @@ public class ProvidedServiceHandler exte
             try {
                 fil = getCompositeManager().getGlobalContext().createFilter(filter);
             } catch (InvalidSyntaxException e) {
-                throw new CompositionException("A required filter " + filter + " is malformed : " + e.getMessage());
+                throw new CompositionException("A required filter " + filter + " is malformed", e);
             }
 
             Class specToImport = null;
             try {
                 specToImport = getCompositeManager().getGlobalContext().getBundle().loadClass(spec);
             } catch (ClassNotFoundException e) {
-                throw new CompositionException("A required specification cannot be loaded : " + spec);
+                throw new CompositionException("A required specification cannot be loaded : " + spec, e);
             }
 
             ServiceImporter importer = new ServiceImporter(specToImport, fil, agg, opt, null, DependencyModel.DYNAMIC_BINDING_POLICY, context, null, handler);

Modified: felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/util/SourceManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/util/SourceManager.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/util/SourceManager.java (original)
+++ felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/util/SourceManager.java Thu May  2 15:19:32 2013
@@ -141,7 +141,7 @@ public class SourceManager implements Co
             try {
                 m_dependency.setFilter(m_context.createFilter(filter));
             } catch (InvalidSyntaxException e) {
-                throw new IllegalStateException("A context filter is invalid : " + filter);
+                throw new IllegalStateException("A context filter is invalid : " + filter, e);
             }
         }
     }
@@ -312,7 +312,7 @@ public class SourceManager implements Co
                 Filter filter = countext.createFilter(fil);
                 m_tracker = new Tracker(countext, filter, this);
             } catch (InvalidSyntaxException e) {
-                throw new ConfigurationException("A Context source filter is invalid " + fil + " : " + e.getMessage());
+                throw new ConfigurationException("A Context source filter is invalid " + fil, e);
             }
         }
 

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java Thu May  2 15:19:32 2013
@@ -185,7 +185,7 @@ public class ComponentFactory extends IP
         } catch (Throwable e) { // All others exception are handled here.
             instance.dispose();
             m_logger.log(Logger.ERROR, e.getMessage(), e);
-            throw new ConfigurationException(e.getMessage());
+            throw new ConfigurationException(e.getMessage(), e);
         }
 
     }

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationException.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationException.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationException.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationException.java Thu May  2 15:19:32 2013
@@ -39,24 +39,32 @@ public class ConfigurationException exte
     
     /**
      * Creates a new configuration exception.
-     * @param mes the error message
-     * @param typ the component type
+     * @param message the error message
      * @see Exception#Exception(String)
      */
-    ConfigurationException(String mes, String typ) {
-        super(mes);
-        m_type = typ;
+    public ConfigurationException(String message) {
+        this(message, (String) null);
     }
-    
+
     /**
      * Creates a new configuration exception.
      * @param mes the error message
+     * @param type the component type
      * @see Exception#Exception(String)
      */
-    public ConfigurationException(String mes) {
-        super(mes);
+    public ConfigurationException(String mes, String type) {
+        this(mes, null, type);
     }
-    
+
+    public ConfigurationException(String message, Throwable cause) {
+        this(message, cause, null);
+    }
+
+    public ConfigurationException(String message, Throwable cause, String type) {
+        super(message, cause);
+        m_type = type;
+    }
+
     /**
      * Gets the error message.
      * @return the error message.

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java Thu May  2 15:19:32 2013
@@ -63,7 +63,7 @@ public class HandlerManagerFactory exten
 
         // Get the name
         m_factoryName = metadata.getAttribute("name");
-        if (m_factoryName == null) { throw new ConfigurationException("An Handler needs a name"); }
+        if (m_factoryName == null) { throw new ConfigurationException("A Handler needs a name"); }
 
         // Get the type
         String type = metadata.getAttribute("type");

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java Thu May  2 15:19:32 2013
@@ -266,7 +266,7 @@ public abstract class IPojoFactory imple
             m_logger.log(Logger.ERROR, "The configuration is not acceptable : " + e.getMessage());
             throw new UnacceptableConfiguration("The configuration "
                     + configuration + " is not acceptable for " + m_factoryName
-                    + ": " + e.getMessage());
+                    , e);
         }
 
         // Find name in the configuration
@@ -307,7 +307,7 @@ public abstract class IPojoFactory imple
         } catch (ConfigurationException e) {
             INSTANCE_NAME.remove(name);
             m_logger.log(Logger.ERROR, e.getMessage());
-            throw new ConfigurationException(e.getMessage(), m_factoryName);
+            throw new ConfigurationException(e.getMessage(), e, m_factoryName);
         }
 
 
@@ -673,13 +673,13 @@ public abstract class IPojoFactory imple
                 createComponentInstance(properties);
             } catch (UnacceptableConfiguration e) {
                 m_logger.log(Logger.ERROR, "The configuration is not acceptable : " + e.getMessage());
-                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage());
+                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage(), e);
             } catch (MissingHandlerException e) {
                 m_logger.log(Logger.ERROR, "Handler not available : " + e.getMessage());
-                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage());
+                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage(), e);
             } catch (ConfigurationException e) {
                 m_logger.log(Logger.ERROR, "The Component Type metadata are not correct : " + e.getMessage());
-                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage());
+                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage(), e);
             }
         } else {
             try {
@@ -687,10 +687,10 @@ public abstract class IPojoFactory imple
                 reconfigure(properties); // re-configure the component
             } catch (UnacceptableConfiguration e) {
                 m_logger.log(Logger.ERROR, "The configuration is not acceptable : " + e.getMessage());
-                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage());
+                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage(), e);
             } catch (MissingHandlerException e) {
                 m_logger.log(Logger.ERROR, "The factory is not valid, at least one handler is missing : " + e.getMessage());
-                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage());
+                throw new org.osgi.service.cm.ConfigurationException(properties.toString(), e.getMessage(), e);
             }
         }
     }
@@ -745,7 +745,7 @@ public abstract class IPojoFactory imple
                     ((Pojo) handler).getComponentInstance().dispose();
                     m_logger.log(Logger.ERROR, e.getMessage());
                     stop();
-                    throw new IllegalStateException(e.getMessage());
+                    throw new IllegalStateException(e);
                 }
             }
         }

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java Thu May  2 15:19:32 2013
@@ -739,7 +739,7 @@ public class InstanceManager implements 
                 m_logger.log(Logger.ERROR,
                                           "[" + m_name + "] createInstance -> The POJO constructor is not accessible : " + e.getMessage(), e);
                 stop();
-                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor is not accessible : " + e.getMessage());
+                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor is not accessible", e);
             } catch (SecurityException e) {
                 m_logger.log(
                                           Logger.ERROR,
@@ -748,7 +748,7 @@ public class InstanceManager implements 
                                                   + "] createInstance -> The POJO constructor is not accessible (security reason) : "
                                                   + e.getMessage(), e);
                 stop();
-                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor is not accessible : " + e.getMessage());
+                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor is not accessible", e);
             } catch (InvocationTargetException e) {
                 m_logger.log(
                                           Logger.ERROR,
@@ -758,18 +758,18 @@ public class InstanceManager implements 
                                                   + e.getTargetException().getMessage(), e.getTargetException());
                 onError(null, m_className, e.getTargetException());
                 stop();
-                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor has thrown an exception: " + e.getTargetException().getMessage());
+                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor has thrown an exception", e.getTargetException());
             } catch (NoSuchMethodException e) {
                 m_logger.log(Logger.ERROR,
                                           "[" + m_name + "] createInstance -> Cannot invoke the constructor (method not found) : " + e.getMessage(), e);
                 stop();
-                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor cannot be found : " + e.getMessage());
+                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor cannot be found", e);
             } catch (Throwable e) {
                 // Catch every other possible error and runtime exception.
                 m_logger.log(Logger.ERROR,
                         "[" + m_name + "] createInstance -> The POJO constructor invocation failed : " + e.getMessage(), e);
                 stop();
-                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor invocation has thrown an exception : " + e.getMessage());
+                throw new RuntimeException("Cannot create a POJO instance, the POJO constructor invocation has thrown an exception", e);
             }
         } else {
             try {
@@ -803,7 +803,7 @@ public class InstanceManager implements 
                                                           + "] createInstance -> Cannot invoke the factory-method (method not found) : "
                                                           + e2.getMessage(), e2);
                         stop();
-                        throw new RuntimeException("Cannot create a POJO instance, the factory-method cannot be found : " + e2.getMessage());
+                        throw new RuntimeException("Cannot create a POJO instance, the factory-method cannot be found", e2);
                     }
                 }
 
@@ -846,13 +846,13 @@ public class InstanceManager implements 
                                           "[" + m_name + "] createInstance -> The factory-method throws an exception : " + e.getTargetException(), e.getTargetException());
                 onError(null, m_className, e.getTargetException());
                 stop();
-                throw new RuntimeException("Cannot create a POJO instance, the factory-method has thrown an exception: " + e.getTargetException().getMessage());
+                throw new RuntimeException("Cannot create a POJO instance, the factory-method has thrown an exception", e.getTargetException());
             } catch (Throwable e) {
                 // Catch every other possible error and runtime exception.
                 m_logger.log(Logger.ERROR,
                         "[" + m_name + "] createInstance -> The factory-method invocation failed : " + e.getMessage(), e);
                 stop();
-                throw new RuntimeException("Cannot create a POJO instance, the factory-method invocation has thrown an exception : " + e.getMessage());
+                throw new RuntimeException("Cannot create a POJO instance, the factory-method invocation has thrown an exception", e);
             }
         }
         return instance;
@@ -977,7 +977,7 @@ public class InstanceManager implements 
             setIM.invoke(obj, new Object[] {this});
         } catch (Exception e) {
             // If anything wrong happened...
-            throw new RuntimeException("Cannot attach the injected object with the container of " + m_name + " : " + e.getMessage());
+            throw new RuntimeException("Cannot attach the injected object with the container of " + m_name, e);
         }
 
         // Call createInstance on Handlers :

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/UnacceptableConfiguration.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/UnacceptableConfiguration.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/UnacceptableConfiguration.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/UnacceptableConfiguration.java Thu May  2 15:19:32 2013
@@ -35,10 +35,13 @@ public class UnacceptableConfiguration e
 
     /**
      * Creates an UnacceptableConfiguration.
-     * @param message : message about the error.
+     * @param message message about the error.
      */
     public UnacceptableConfiguration(String message) {
-        super(message);
+        this(message, null);
     }
 
+    public UnacceptableConfiguration(String message, Throwable cause) {
+        super(message, cause);
+    }
 }

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java Thu May  2 15:19:32 2013
@@ -396,11 +396,9 @@ public class Dependency extends Dependen
         } catch (NoClassDefFoundError e) {
             // A NoClassDefFoundError is thrown if the specification uses a class not accessible by the actual instance.
             // It generally comes from a missing import.
-            throw new IllegalStateException("Cannot create the Nullable object, a referenced class cannot be loaded: " + e.getMessage());
+            throw new IllegalStateException("Cannot create the Nullable object, a referenced class cannot be loaded", e);
         } catch (Throwable e) { // Catch any other exception that can occurs
-            throw new IllegalStateException(
-                    "Cannot create the Nullable object, an unexpected error occurs: "
-                            + e.getMessage());
+            throw new IllegalStateException("Cannot create the Nullable object, an unexpected error occurs", e);
         }
 
         return m_nullable;
@@ -423,13 +421,13 @@ public class Dependency extends Dependen
                     Class clazz = getHandler().getInstanceManager().getContext().getBundle().loadClass(m_di);
                     m_nullable = clazz.newInstance();
                 } catch (IllegalAccessException e) {
-                    throw new IllegalStateException("Cannot load the default-implementation " + m_di + " : " + e.getMessage());
+                    throw new IllegalStateException("Cannot load the default-implementation " + m_di, e);
                 } catch (InstantiationException e) {
-                    throw new IllegalStateException("Cannot load the default-implementation " + m_di + " : " + e.getMessage());
+                    throw new IllegalStateException("Cannot load the default-implementation " + m_di, e);
                 } catch (ClassNotFoundException e) {
-                    throw new IllegalStateException("Cannot load the default-implementation " + m_di + " : " + e.getMessage());
+                    throw new IllegalStateException("Cannot load the default-implementation " + m_di, e);
                 } catch (Throwable e) { // Catch any other exception
-                    throw new IllegalStateException("Cannot load the default-implementation (unexpected exception) " + m_di + " : " + e.getMessage());
+                    throw new IllegalStateException("Cannot load the default-implementation (unexpected exception) " + m_di, e);
                 }
             }
         }
@@ -707,7 +705,7 @@ public class Dependency extends Dependen
                     }
                 } catch (ArrayStoreException e) {
                     m_handler.error("Cannot create the array - Check that the bundle can access the service interface", e);
-                    throw new RuntimeException("Cannot create the array - Check that the bundle can access the service interface : " + e.getMessage());
+                    throw new RuntimeException("Cannot create the array - Check that the bundle can access the service interface", e);
                 }
             } else if (m_type == DependencyHandler.LIST) {
                 if (refs == null) {

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java Thu May  2 15:19:32 2013
@@ -38,6 +38,7 @@ import org.apache.felix.ipojo.parser.Met
 import org.apache.felix.ipojo.parser.PojoMetadata;
 import org.apache.felix.ipojo.util.DependencyModel;
 import org.apache.felix.ipojo.util.DependencyStateListener;
+import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
 import org.osgi.framework.InvalidSyntaxException;
@@ -388,10 +389,12 @@ public class DependencyHandler extends P
                     }
                 }
 
+                Bundle bundle = getInstanceManager().getContext().getBundle();
                 try {
-                    dep.setSpecification(getInstanceManager().getContext().getBundle().loadClass(className));
+                    dep.setSpecification(bundle.loadClass(className));
                 } catch (ClassNotFoundException e) {
-                    throw new ConfigurationException("The required service interface cannot be loaded : " + e.getMessage());
+                    throw new ConfigurationException("The required service interface (" + className
+                            + ") cannot be loaded from bundle " + bundle.getBundleId(), e);
                 }
             }
         }
@@ -515,7 +518,7 @@ public class DependencyHandler extends P
                 try {
                     fil = getInstanceManager().getContext().createFilter(filter);
                 } catch (InvalidSyntaxException e) {
-                    throw new ConfigurationException("A requirement filter is invalid : " + filter + " - " + e.getMessage());
+                    throw new ConfigurationException("A requirement filter is invalid : " + filter, e);
                 }
             }
 

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java Thu May  2 15:19:32 2013
@@ -162,13 +162,13 @@ public class LifecycleCallbackHandler ex
                     m_callbacks[i].call();
                 } catch (NoSuchMethodException e) {
                     error("[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " is not found");
-                    throw new IllegalStateException(e.getMessage());
+                    throw new IllegalStateException(e);
                 } catch (IllegalAccessException e) {
                     error("[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " is not accessible");
-                    throw new IllegalStateException(e.getMessage());
+                    throw new IllegalStateException(e);
                 } catch (InvocationTargetException e) {
                     error("[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " has thrown an exception : " + e.getTargetException().getMessage(), e.getTargetException());
-                    throw new IllegalStateException(e.getTargetException().getMessage());
+                    throw new IllegalStateException(e.getTargetException());
                 }
             }
         }

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java Thu May  2 15:19:32 2013
@@ -133,7 +133,7 @@ public class ProvidedServiceHandler exte
                             throw new ConfigurationException("The custom creation policy class " + custom.getName() + " does not implement " + CreationStrategy.class.getName());
                         }
                     } catch (ClassNotFoundException e) {
-                        throw new ConfigurationException("The custom creation policy class " + strategy + " cannot be loaded " + e.getMessage());
+                        throw new ConfigurationException("The custom creation policy class " + strategy + " cannot be loaded ", e);
 
                     }
 
@@ -335,13 +335,13 @@ public class ProvidedServiceHandler exte
             } catch (NoSuchFieldException e) {
                 return true; // No specification field
             } catch (ClassNotFoundException e) {
-                throw new ConfigurationException("Service Providing: The service specification " + svc.getServiceSpecifications()[i] + " cannot be load");
+                throw new ConfigurationException("Service Providing: The service specification " + svc.getServiceSpecifications()[i] + " cannot be loaded", e);
             } catch (IllegalArgumentException e) {
-                throw new ConfigurationException("Service Providing: The field 'specification' of the service specification " + svc.getServiceSpecifications()[i] + " is not accessible : " + e.getMessage());
+                throw new ConfigurationException("Service Providing: The field 'specification' of the service specification " + svc.getServiceSpecifications()[i] + " is not accessible", e);
             } catch (IllegalAccessException e) {
-                throw new ConfigurationException("Service Providing: The field 'specification' of the service specification " + svc.getServiceSpecifications()[i] + " is not accessible : " + e.getMessage());
+                throw new ConfigurationException("Service Providing: The field 'specification' of the service specification " + svc.getServiceSpecifications()[i] + " is not accessible", e);
             } catch (ParseException e) {
-                throw new ConfigurationException("Service Providing: The field 'specification' of the service specification " + svc.getServiceSpecifications()[i] + " does not contain a valid String : " + e.getMessage());
+                throw new ConfigurationException("Service Providing: The field 'specification' of the service specification " + svc.getServiceSpecifications()[i] + " does not contain a valid String", e);
             }
         }
 
@@ -589,7 +589,7 @@ public class ProvidedServiceHandler exte
                 getLogger().log(Logger.INFO, "Collected interfaces from " + metadata.getAttribute("classname") + " : " + interfaces);
                 getLogger().log(Logger.INFO, "Collected super classes from " + metadata.getAttribute("classname") + " : " + parentClasses);
             } catch (ClassNotFoundException e) {
-                throw new ConfigurationException("An interface or parent class cannot be loaded : " + e.getMessage());
+                throw new ConfigurationException("An interface or parent class cannot be loaded", e);
             }
 
             String serviceSpecificationStr = provides[i].getAttribute("specifications");

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java Thu May  2 15:19:32 2013
@@ -969,11 +969,11 @@ public abstract class DependencyModel im
                     Class cla = context.getBundle().loadClass(comp);
                     cmp = (Comparator) cla.newInstance();
                 } catch (ClassNotFoundException e) {
-                    throw new ConfigurationException("Cannot load a customized comparator : " + e.getMessage());
+                    throw new ConfigurationException("Cannot load a customized comparator", e);
                 } catch (IllegalAccessException e) {
-                    throw new ConfigurationException("Cannot create a customized comparator : " + e.getMessage());
+                    throw new ConfigurationException("Cannot create a customized comparator", e);
                 } catch (InstantiationException e) {
-                    throw new ConfigurationException("Cannot create a customized comparator : " + e.getMessage());
+                    throw new ConfigurationException("Cannot create a customized comparator", e);
                 }
             }
         }
@@ -992,7 +992,7 @@ public abstract class DependencyModel im
         try {
             spec = context.getBundle().loadClass(specification);
         } catch (ClassNotFoundException e) {
-            throw new ConfigurationException("A required specification cannot be loaded : " + specification);
+            throw new ConfigurationException("A required specification cannot be loaded : " + specification, e);
         }
         return spec;
     }

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Property.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Property.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Property.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Property.java Thu May  2 15:19:32 2013
@@ -225,11 +225,11 @@ public class Property implements FieldIn
                 try {
                     return context.getBundle().loadClass(type);
                 } catch (ClassNotFoundException e) {
-                    throw new ConfigurationException("Class not found exception in setValue on " + type + " : " + e.getMessage());
+                    throw new ConfigurationException("Class not found exception in setValue on " + type, e);
                 } catch (SecurityException e) {
-                    throw new ConfigurationException("Security execption in setValue on " + type + " : " + e.getMessage());
+                    throw new ConfigurationException("Security exception in setValue on " + type, e);
                 } catch (IllegalArgumentException e) {
-                    throw new ConfigurationException("Argument issue when calling the constructor of the type " + type);
+                    throw new ConfigurationException("Argument issue when calling the constructor of the type " + type, e);
                 }
             }
         }
@@ -280,11 +280,11 @@ public class Property implements FieldIn
             Object[] object = (Object[]) Array.newInstance(clazz, 0);
             return object.getClass();
         } catch (ClassNotFoundException e) {
-            throw new ConfigurationException("Class not found exception in setValue on " + internalType);
+            throw new ConfigurationException("Class not found exception in setValue on " + internalType, e);
         } catch (SecurityException e) {
-            throw new ConfigurationException("Security Exception in setValue on " + internalType);
+            throw new ConfigurationException("Security Exception in setValue on " + internalType, e);
         } catch (IllegalArgumentException e) {
-            throw new ConfigurationException("Argument issue when calling the constructor of the type " + internalType);
+            throw new ConfigurationException("Argument issue when calling the constructor of the type " + internalType, e);
         }
     }
 
@@ -456,10 +456,10 @@ public class Property implements FieldIn
                 return valueOf.invoke(null, new String[] {strValue});
             } catch (InvocationTargetException e) {
                 throw new ConfigurationException("Cannot create an enumerated value for " + type
-                        + " with " + strValue + " : " + e.getTargetException());
+                        + " with " + strValue, e.getTargetException());
             } catch (Exception e) {
                 throw new ConfigurationException("Cannot create an enumerated value for " + type
-                        + " with " + strValue + " : " + e.getMessage());
+                        + " with " + strValue, e);
             }
         }
 
@@ -469,17 +469,17 @@ public class Property implements FieldIn
             Constructor cst = type.getConstructor(new Class[] { String.class });
             return cst.newInstance(new Object[] { strValue });
         } catch (SecurityException e) {
-            throw new ConfigurationException("Security exception during the creation of " + type + " : " + e.getMessage());
+            throw new ConfigurationException("Security exception during the creation of " + type, e);
         } catch (NoSuchMethodException e) {
-            throw new ConfigurationException("Constructor not found exception during the creation of " + type + " : " + e.getMessage());
+            throw new ConfigurationException("Constructor not found exception during the creation of " + type, e);
         } catch (IllegalArgumentException e) {
-            throw new ConfigurationException("Argument issue when calling the constructor of the type " + type);
+            throw new ConfigurationException("Argument issue when calling the constructor of the type " + type, e);
         } catch (InstantiationException e) {
-            throw new ConfigurationException("Instantiation problem  " + type);
+            throw new ConfigurationException("Instantiation problem  " + type, e);
         } catch (IllegalAccessException e) {
-            throw new ConfigurationException("Illegal Access " + type);
+            throw new ConfigurationException("Illegal Access " + type, e);
         } catch (InvocationTargetException e) {
-            throw new ConfigurationException("Invocation problem during the creation of " + type + " : " + e.getTargetException().getMessage());
+            throw new ConfigurationException("Invocation problem during the creation of " + type, e.getTargetException());
         }
 
     }
@@ -560,15 +560,15 @@ public class Property implements FieldIn
             }
             return object;
         } catch (NoSuchMethodException e) {
-            throw new ConfigurationException("Constructor not found exception in setValue on " + interntype.getName());
+            throw new ConfigurationException("Constructor not found exception in setValue on " + interntype.getName(), e);
         } catch (IllegalArgumentException e) {
-            throw new ConfigurationException("Argument issue when calling the constructor of the type " + interntype.getName());
+            throw new ConfigurationException("Argument issue when calling the constructor of the type " + interntype.getName(), e);
         } catch (InstantiationException e) {
-            throw new ConfigurationException("Instantiation problem  " + interntype.getName());
+            throw new ConfigurationException("Instantiation problem  " + interntype.getName(), e);
         } catch (IllegalAccessException e) {
-            throw new ConfigurationException("Illegal Access Exception in  " + interntype.getName());
+            throw new ConfigurationException("Illegal Access Exception in  " + interntype.getName(), e);
         } catch (InvocationTargetException e) {
-            throw new ConfigurationException("Invocation problem " + interntype.getName() + " : " + e.getTargetException().getMessage());
+            throw new ConfigurationException("Invocation problem " + interntype.getName(), e.getTargetException());
         }
     }
 

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java?rev=1478410&r1=1478409&r2=1478410&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/Tracker.java Thu May  2 15:19:32 2013
@@ -114,7 +114,7 @@ public class Tracker implements TrackerC
         try {
             this.m_filter = context.createFilter(m_listenerFilter);
         } catch (InvalidSyntaxException e) { // we could only get this exception if the ServiceReference was invalid
-            throw new IllegalArgumentException("unexpected InvalidSyntaxException: " + e.getMessage()); //$NON-NLS-1$
+            throw new IllegalArgumentException("unexpected InvalidSyntaxException", e); //$NON-NLS-1$
         }
     }
 
@@ -147,7 +147,7 @@ public class Tracker implements TrackerC
         } catch (InvalidSyntaxException e) { // we could only get this exception
             // if the clazz argument was
             // malformed
-            throw new IllegalArgumentException("unexpected InvalidSyntaxException: " + e.getMessage());
+            throw new IllegalArgumentException("unexpected InvalidSyntaxException", e);
         }
     }
 
@@ -203,7 +203,7 @@ public class Tracker implements TrackerC
                 // the initial
                 // references
             } catch (InvalidSyntaxException e) {
-                throw new IllegalStateException("unexpected InvalidSyntaxException: " + e.getMessage()); //$NON-NLS-1$
+                throw new IllegalStateException("unexpected InvalidSyntaxException", e); //$NON-NLS-1$
             }
         }
         /* Call tracked outside of synchronized region */



Mime
View raw message