geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r398028 - in /geronimo/branches/1.1/modules: connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Date Fri, 28 Apr 2006 22:20:54 GMT
Author: djencks
Date: Fri Apr 28 15:20:52 2006
New Revision: 398028

URL: http://svn.apache.org/viewcvs?rev=398028&view=rev
Log:
GERONIMO-847 Improve error messages for unresolved resource-refs

Modified:
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java

Modified: geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=398028&r1=398027&r2=398028&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Fri Apr 28 15:20:52 2006
@@ -17,6 +17,7 @@
 package org.apache.geronimo.connector.deployment;
 
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.common.UnresolvedReferenceException;
 import org.apache.geronimo.common.propertyeditor.PropertyEditors;
 import org.apache.geronimo.connector.ActivationSpecWrapperGBean;
 import org.apache.geronimo.connector.AdminObjectWrapper;
@@ -777,7 +778,7 @@
         try {
             configuration.findGBean(containerId);
         } catch (GBeanNotFoundException e) {
-            throw new DeploymentException("Can not resolve resource ref " + containerId +
" in configuration " + configuration.getId());
+            throw new UnresolvedReferenceException("Resource", false, containerId.toString());
         }
         return new ResourceReference(configuration.getId(), containerId, iface);
     }

Modified: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?rev=398028&r1=398027&r2=398028&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
(original)
+++ geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Fri Apr 28 15:20:52 2006
@@ -176,7 +176,25 @@
                     ref = refContext.getConnectionFactoryRef(containerId, iface, earContext);
                     builder.bind(name, ref);
                 } catch (UnresolvedReferenceException e) {
-                    throw new DeploymentException("Unable to resolve resource reference '"
+ name + "' (" + (e.isMultiple() ? "found multiple matching resources" : "no matching resources
found") + ")");
+
+                    StringBuffer errorMessage = new StringBuffer("Unable to resolve resource
reference '");
+                    errorMessage.append(name);
+                    errorMessage.append("' (");
+                    if (e.isMultiple()) {
+                        errorMessage.append("Found multiple matching resources.  Try being
more specific in a resource-ref mapping in your Geronimo deployment plan.");
+                    } else if (gerResourceRef == null){
+                        errorMessage.append("Could not auto-map to resource.  Try adding
a resource-ref mapping to your Geronimo deployment plan.");
+                    } else if (gerResourceRef.isSetResourceLink()){
+                        errorMessage.append("Could not find resource '");
+                        errorMessage.append(gerResourceRef.getResourceLink());
+                        errorMessage.append("'.  Perhaps it has not yet been configured,
or your application does not have a dependency declared for that resource module?");
+                    } else {
+                        errorMessage.append("Could not find the resource specified in your
Geronimo deployment plan:");
+                        errorMessage.append(gerResourceRef.getPattern());
+                    }
+                    errorMessage.append(")");
+
+                    throw new DeploymentException(errorMessage.toString());
                 }
             }
         }



Mime
View raw message