User: dbudworth Date: 01/12/20 10:26:44 Modified: src/main/org/jboss/ejb EntityContainer.java StatefulSessionContainer.java StatelessSessionContainer.java Log: Modified: setupMarshalledInvocationMapping() Added check for remote home/bean interfaces to be valid before attempting to map their methods Removed extra exception stack trace in the catch clause, log.error(String,Exception) will do the stack trace on it's own, so there was no need for e.printStackTrace() Revision Changes Path 1.61 +14 -9 jboss/src/main/org/jboss/ejb/EntityContainer.java Index: EntityContainer.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- EntityContainer.java 2001/12/19 05:17:07 1.60 +++ EntityContainer.java 2001/12/20 18:26:44 1.61 @@ -44,7 +44,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Daniel OConnor</a> * @author <a href="[EMAIL PROTECTED]">Bill Burke</a> * @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a> -* @version $Revision: 1.60 $ +* @version $Revision: 1.61 $ * * <p><b>Revisions:</b> * @@ -282,7 +282,7 @@ homeInterface = classLoader.loadClass(metaData.getHome()); if (metaData.getRemote() != null) remoteInterface = classLoader.loadClass(metaData.getRemote()); - + // Call default init super.create(); @@ -853,15 +853,21 @@ { try {// Create method mappings for container invoker - Method [] m = homeInterface.getMethods(); - for (int i = 0 ; i<m.length ; i++) + if (homeInterface != null) { - marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[i])), m[i]); + Method [] m = homeInterface.getMethods(); + for (int i = 0 ; i<m.length ; i++) + { + marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[i])), m[i]); + } } - m = remoteInterface.getMethods(); - for (int j = 0 ; j<m.length ; j++) + if (remoteInterface != null) { - marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[j])), m[j]); + Method [] m = remoteInterface.getMethods(); + for (int j = 0 ; j<m.length ; j++) + { + marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[j])), m[j]); + } } // Get the getEJBObjectMethod @@ -872,7 +878,6 @@ } catch (Exception e) { - e.printStackTrace(); log.error("getEJBObject failed", e); } } 1.40 +14 -9 jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java Index: StatefulSessionContainer.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- StatefulSessionContainer.java 2001/12/19 05:30:04 1.39 +++ StatefulSessionContainer.java 2001/12/20 18:26:44 1.40 @@ -31,7 +31,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Rickard Öberg</a> * @author <a href="mailto:[EMAIL PROTECTED]">Daniel OConnor</a> * @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a> -* @version $Revision: 1.39 $ +* @version $Revision: 1.40 $ * * <p><b>Revisions</b> * <p><b>20010704</b> @@ -605,17 +605,23 @@ { try {// Create method mappings for container invoker - Method [] m = homeInterface.getMethods(); - for (int i = 0 ; i<m.length ; i++) + if (homeInterface != null) { - marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[i])), m[i]); + Method [] m = homeInterface.getMethods(); + for (int i = 0 ; i<m.length ; i++) + { + marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[i])), m[i]); + } } - m = remoteInterface.getMethods(); - for (int j = 0 ; j<m.length ; j++) + + if (remoteInterface != null) { - marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[j])), m[j]); + Method [] m = remoteInterface.getMethods(); + for (int j = 0 ; j<m.length ; j++) + { + marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[j])), m[j]); + } } - // Get the getEJBObjectMethod Method getEJBObjectMethod = Class.forName("javax.ejb.Handle").getMethod("getEJBObject", new Class[0]); @@ -624,7 +630,6 @@ } catch (Exception e) { - e.printStackTrace(); log.error("could not load methods", e); } } 1.31 +14 -8 jboss/src/main/org/jboss/ejb/StatelessSessionContainer.java Index: StatelessSessionContainer.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatelessSessionContainer.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- StatelessSessionContainer.java 2001/12/19 05:32:43 1.30 +++ StatelessSessionContainer.java 2001/12/20 18:26:44 1.31 @@ -32,7 +32,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Rickard Öberg</a> * @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a> * @author <a href="mailto:[EMAIL PROTECTED]">Daniel OConnor</a> -* @version $Revision: 1.30 $ +* @version $Revision: 1.31 $ * <p><b>2001219 marc fleury</b> * <ul> * <li> move to the new invocation layer and Invocation object @@ -493,15 +493,22 @@ { try {// Create method mappings for container invoker - Method [] m = homeInterface.getMethods(); - for (int i = 0 ; i<m.length ; i++) + if (homeInterface != null) { - marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[i])), m[i]); + Method [] m = homeInterface.getMethods(); + for (int i = 0 ; i<m.length ; i++) + { + marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[i])), m[i]); + } } - m = remoteInterface.getMethods(); - for (int j = 0 ; j<m.length ; j++) + + if (remoteInterface != null) { - marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[j])), m[j]); + Method [] m = remoteInterface.getMethods(); + for (int j = 0 ; j<m.length ; j++) + { + marshalledInvocationMapping.put( new Long(MarshalledInvocation.calculateHash(m[j])), m[j]); + } } // Get the getEJBObjectMethod @@ -512,7 +519,6 @@ } catch (Exception e) { - e.printStackTrace(); log.error("could not load methods", e); } }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development