[jboss-cvs] JBossAS SVN: r77554 - projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 27 19:26:00 EDT 2008


Author: ALRubinger
Date: 2008-08-27 19:26:00 -0400 (Wed, 27 Aug 2008)
New Revision: 77554

Modified:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java
Log:
[EJBTHREE-1345] Catch a LinkageError in addition to a CNFE when looking for a business interface class

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java	2008-08-27 22:04:54 UTC (rev 77553)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java	2008-08-27 23:26:00 UTC (rev 77554)
@@ -205,13 +205,24 @@
          {
             // See if we can get at the bean class from the TCL
             Class<?> businessInterfaceClass = Class.forName(businessInterfaceName, false, tcl);
+            
+            // Load the Bean Class from the Container's CL
+            Class<?> ourBusinessInterfaceClass = Class.forName(businessInterfaceName, false, this.getClassLoader());
 
-            // If so, use the TCL to generate the Proxy class, not the Container CL
-            Set<Class<?>> businessInterfaces = new HashSet<Class<?>>();
-            businessInterfaces.add(businessInterfaceClass);
-            constructor = this.createProxyConstructor(businessInterfaces, tcl);
+            // If the classes aren't equal, the injection target won't be assignable
+            if (!businessInterfaceClass.equals(ourBusinessInterfaceClass))
+            {
+               // So use the TCL to generate the Proxy class, not the Container CL
+               Set<Class<?>> businessInterfaces = new HashSet<Class<?>>();
+               businessInterfaces.add(businessInterfaceClass);
+               constructor = this.createProxyConstructor(businessInterfaces, tcl);
+            }
 
          }
+         catch(LinkageError le)
+         {
+            // Ignore
+         }
          catch (ClassNotFoundException cce)
          {
             // Ignore




More information about the jboss-cvs-commits mailing list