Update of /var/cvs/src/org/mmbase/bridge
In directory james.mmbase.org:/tmp/cvs-serv6085

Modified Files:
        RemoteContext.java 
Log Message:
don't swallow exception and return null, it wills simply result in uniformative 
NPE's later on


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/bridge


Index: RemoteContext.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/bridge/RemoteContext.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- RemoteContext.java  10 Feb 2007 15:47:42 -0000      1.9
+++ RemoteContext.java  16 Jul 2008 10:50:14 -0000      1.10
@@ -19,11 +19,10 @@
 /**
  * @javadoc
  * @author Kees Jongenburger <[EMAIL PROTECTED]>
- * @version $Id: RemoteContext.java,v 1.9 2007/02/10 15:47:42 nklasens Exp $
+ * @version $Id: RemoteContext.java,v 1.10 2008/07/16 10:50:14 michiel Exp $
  * @since MMBase-1.5
  */
 public abstract class RemoteContext {
-
     /**
      * Connect to a remote cloudcontext. The name of the context
      * depends on configurations found in mmbaseroot.xml (host) and
@@ -37,16 +36,10 @@
         try {
             
             Object remoteCloudContext= Naming.lookup(uri);
-            try {
                 Class<?> clazz = 
Class.forName("org.mmbase.bridge.remote.implementation.RemoteCloudContext_Impl");
                 Constructor<?> constr =  clazz.getConstructor(new Class [] { 
Class.forName("org.mmbase.bridge.remote.RemoteCloudContext") });
                 return (CloudContext) constr.newInstance(new Object[] { 
remoteCloudContext } );
                 //new RemoteCloudContext_Impl(remoteCloudContext);
-            } catch (ClassNotFoundException e) {
-                return null;
-            } catch (NoSuchMethodException e) {
-                return null;
-            }
         } catch (MalformedURLException mue) {
             String message = mue.getMessage();
             if (message != null && message.indexOf("no protocol") > -1) {
@@ -60,7 +53,7 @@
             }
             throw new BridgeException("While connecting to " + uri + ": " + 
mue.getMessage(), mue);
         } catch (Exception e){
-            throw new BridgeException("While connecting to " + uri + ": " +  
e.getMessage(), e);
+            throw new BridgeException("While connecting to " + uri + ": " + 
e.getClass() + " " +  e.getMessage(), e);
         }
     }
     public static void main(String[] argv) {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to