[jboss-cvs] JBossAS SVN: r78554 - projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Sep 15 18:57:25 EDT 2008
Author: ALRubinger
Date: 2008-09-15 18:57:24 -0400 (Mon, 15 Sep 2008)
New Revision: 78554
Modified:
projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiSessionRegistrarBase.java
Log:
[EJBTHREE-1241] Enhance runtime error message to end user
Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiSessionRegistrarBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiSessionRegistrarBase.java 2008-09-15 20:51:43 UTC (rev 78553)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiSessionRegistrarBase.java 2008-09-15 22:57:24 UTC (rev 78554)
@@ -218,7 +218,21 @@
{
// Obtain RemoteBinding URL
List<RemoteBindingMetaData> bindings = smd.getRemoteBindings();
- assert bindings != null && bindings.size() > 0 : "Remote Bindings are required and none are present";
+
+ // Sanity checks
+ boolean bindingsFound =bindings != null && bindings.size() > 0;
+ assert bindingsFound : "Remote Bindings are required and none are present";
+ if (!bindingsFound)
+ {
+ throw new RuntimeException(
+ "This bean has been declared as remote (possibly via @RemoteHome, but with no EJB2.1 View), "
+ + "yet no remote bindings have been defined");
+ }
+
+ //TODO Remote Bindings should be 1 per defined
+ // http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176636
+
+ // Get Remote Binding
RemoteBindingMetaData remoteBinding = bindings.get(0);
String url = remoteBinding.getClientBindUrl();
More information about the jboss-cvs-commits
mailing list