remm 01/03/20 14:04:31
Modified: catalina/src/share/org/apache/naming/factory EjbFactory.java
Log:
- Won't fail when bean isn't of right type, or when failing to load home interface.
Instead, will print out debug traces.
Revision Changes Path
1.4 +23 -12
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/EjbFactory.java
Index: EjbFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/EjbFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EjbFactory.java 2001/03/20 01:21:05 1.3
+++ EjbFactory.java 2001/03/20 22:04:27 1.4
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/EjbFactory.java,v
1.3 2001/03/20 01:21:05 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2001/03/20 01:21:05 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/EjbFactory.java,v
1.4 2001/03/20 22:04:27 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2001/03/20 22:04:27 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* Object factory for EJBs.
*
* @author Remy Maucherat
- * @version $Revision: 1.3 $ $Date: 2001/03/20 01:21:05 $
+ * @version $Revision: 1.4 $ $Date: 2001/03/20 22:04:27 $
*/
public class EjbFactory
@@ -121,15 +121,26 @@
// Load home interface and checking if bean correctly
// implements specified home interface
String homeClassName = ref.getClassName();
- Class home = Class.forName(homeClassName);
- if (home.isInstance(beanObj)) {
- return beanObj;
- } else {
- throw new NamingException
- ("Bean of type " + beanObj.getClass().getName()
- + " doesn't implement home interface "
- + home.getName());
+ try {
+ Class home = Class.forName(homeClassName);
+ if (home.isInstance(beanObj)) {
+ System.out.println("Bean of type "
+ + beanObj.getClass().getName()
+ + " doesn't implement home interface "
+ + home.getName());
+ } else {
+ /*
+ throw new NamingException
+ ("Bean of type " + beanObj.getClass().getName()
+ + " doesn't implement home interface "
+ + home.getName());
+ */
+ }
+ } catch (ClassNotFoundException e) {
+ System.out.println("Couldn't load home interface "
+ + homeClassName);
}
+ return beanObj;
}
ObjectFactory factory = null;