[jboss-cvs] JBossAS SVN: r64950 - trunk/ejb3/src/main/org/jboss/ejb3.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 29 10:30:16 EDT 2007


Author: ALRubinger
Date: 2007-08-29 10:30:16 -0400 (Wed, 29 Aug 2007)
New Revision: 64950

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/EJBContainer.java
Log:
EJBTHREE-1025: Enhanced error messages to be more meaningful to application developer

Modified: trunk/ejb3/src/main/org/jboss/ejb3/EJBContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/EJBContainer.java	2007-08-29 14:29:21 UTC (rev 64949)
+++ trunk/ejb3/src/main/org/jboss/ejb3/EJBContainer.java	2007-08-29 14:30:16 UTC (rev 64950)
@@ -516,9 +516,8 @@
     */
    protected void checkForDuplicateLocalAndRemoteInterfaces() throws EJBException
    {
-      // Initialize Error Message
-      String errorMessage = "Local and Remote Interfaces cannot have duplicate interface for bean " + this.getEjbName()
-            + " (EJBTHREE-1025)";
+      // Initialize issue used in Error Message
+      String issue = "(EJBTHREE-1025)";
 
       // Obtain annotations, if found
       Local local = (Local) resolveAnnotation(Local.class);
@@ -533,7 +532,8 @@
       // Ensure "value" attribute of both local and remote are not blank
       if (local.value().length < 1 && local.value().length < 1)
       {
-         throw new EJBException(errorMessage);
+         throw new EJBException("Cannot designate both " + Local.class.getName() + " and " + Remote.class.getName()
+               + " annotations without 'value' attribute on " + this.getEjbName() + ". " + issue);
       }
 
       // Iterate through local and remote interfaces, ensuring any one interface is not being used for both local and remote exposure
@@ -543,7 +543,8 @@
          {
             if (localClass.equals(remoteClass))
             {
-               throw new EJBException(errorMessage);
+               throw new EJBException("Cannot designate " + localClass.getName() + " as both " + Local.class.getName()
+                     + " and " + Remote.class.getName() + " on " + this.getEjbName() + ". " + issue);
             }
          }
       }




More information about the jboss-cvs-commits mailing list