geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r293071 - /geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
Date Sun, 02 Oct 2005 05:01:01 GMT
Author: djencks
Date: Sat Oct  1 22:00:59 2005
New Revision: 293071

URL: http://svn.apache.org/viewcvs?rev=293071&view=rev
Log:
GERONIMO-1024 nice error message if you spell a module wrong

Modified:
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java?rev=293071&r1=293070&r2=293071&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
Sat Oct  1 22:00:59 2005
@@ -141,6 +141,15 @@
         if (pos > -1) {
             String targetModule = messageDestinationLink.substring(0, pos);
             Map destinations = (Map) messageDestinations.get(targetModule);
+            // Hmmm...if we don't find the module then something is wrong in the deployment.
+            if (destinations == null) {
+                StringBuffer sb = new StringBuffer();
+                for (Iterator mapIterator = messageDestinations.keySet().iterator(); mapIterator.hasNext();)
{
+                    sb.append((String) mapIterator.next() + "\n");
+                }
+                throw new DeploymentException("Unknown module " + targetModule + " when processing
message destination " + messageDestinationLink +
+                        "\nKnown modules in deployable unit are:\n" + sb.toString());
+            }
             messageDestinationLink = messageDestinationLink.substring(pos + 1);
             destination = destinations.get(messageDestinationLink);
         } else {
@@ -259,7 +268,7 @@
     private GBeanData locateComponentInModule(String resourceLink, URI moduleURI, String
moduleType, String type, J2eeContext j2eeContext, String queryType, NamingContext context,
boolean requireMatchInExplicitModule) throws UnresolvedReferenceException {
         GBeanData match;
         String name = resourceLink.substring(resourceLink.lastIndexOf('#') + 1);
-        String module = moduleURI == null? "": moduleURI.getPath();
+        String module = moduleURI == null ? "" : moduleURI.getPath();
 
         if (resourceLink.indexOf('#') > -1) {
             //presence of # means they explicitly want only gbeans in specified module in
this application.



Mime
View raw message