geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r481466 - /geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
Date Sat, 02 Dec 2006 00:57:30 GMT
Author: djencks
Date: Fri Dec  1 16:57:29 2006
New Revision: 481466

URL: http://svn.apache.org/viewvc?view=rev&rev=481466
Log:
GERONIMO-2615 More info on what went wrong when a gbean ref isn't verified at deploy time

Modified:
    geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java

Modified: geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?view=diff&rev=481466&r1=481465&r2=481466
==============================================================================
--- geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
(original)
+++ geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
Fri Dec  1 16:57:29 2006
@@ -454,41 +454,43 @@
         // A collection valued reference doesn't need to be verified
         if (referenceInfo.getProxyType().equals(Collection.class.getName())) return null;
 
-        if (!isVerifyReference(referencePatterns)) {
+        String message = isVerifyReference(referencePatterns);
+        if (message != null) {
             return "Unable to resolve reference \"" + referenceName + "\" in gbean " +
-                    gbean.getAbstractName() + " to a gbean matching the pattern " + referencePatterns.getPatterns();
+                    gbean.getAbstractName() + " to a gbean matching the pattern " + referencePatterns.getPatterns()
+ "due to: " + message;
         }
         return null;
     }
 
     private String verifyDependency(AbstractName name, ReferencePatterns referencePatterns)
{
-        if (!isVerifyReference(referencePatterns)) {
+        String message = isVerifyReference(referencePatterns);
+        if (message != null) {
             return "Unable to resolve dependency in gbean " + name +
-                    " to a gbean matching the pattern " + referencePatterns.getPatterns();
+                    " to a gbean matching the pattern " + referencePatterns.getPatterns()
+ "due to: " + message;
         }
 
         return null;
     }
 
-    private boolean isVerifyReference(ReferencePatterns referencePatterns) {
+    private String isVerifyReference(ReferencePatterns referencePatterns) {
         // we can't verify a resolved reference since it will have a specific artifact already
set...
         // hopefully the deployer won't generate bad resolved references
-        if (referencePatterns.isResolved()) return true;
+        if (referencePatterns.isResolved()) return null;
 
         // Do not verify the reference if it has an explicit depenency on another artifact,
because it it likely
         // that the other artifact is not in the "environment" (if it were you wouldn't use
the long form)
         Set patterns = referencePatterns.getPatterns();
         for (Iterator iterator = patterns.iterator(); iterator.hasNext();) {
             AbstractNameQuery query = (AbstractNameQuery) iterator.next();
-            if (query.getArtifact() != null) return true;
+            if (query.getArtifact() != null) return null;
         }
 
         // attempt to find the bean
         try {
             findGBean(patterns);
-            return true;
+            return null;
         } catch (GBeanNotFoundException e) {
-            return false;
+            return e.getMessage();
         }
     }
 }



Mime
View raw message