Author: dblevins
Date: Fri Sep 21 23:48:51 2007
New Revision: 578381

URL: http://svn.apache.org/viewvc?rev=578381&view=rev
Log:
Convert exceptions properly for business intefaces that extend javax.rmi.Remote

Modified:
    
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
    
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java
    
openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml

Modified: 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java?rev=578381&r1=578380&r2=578381&view=diff
==============================================================================
--- 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
 (original)
+++ 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
 Fri Sep 21 23:48:51 2007
@@ -328,7 +328,7 @@
                 context.bind(name, ref);
                 bindings.add(name);
                 beanInfo.jndiNames.add(externalName);
-                logger.info("Jndi(name=" + externalName +") bound to 
Ejb(deployment-id="+beanInfo.ejbDeploymentId+")");
+                logger.info("Jndi(name=" + externalName +") --> 
Ejb(deployment-id="+beanInfo.ejbDeploymentId+")");
             } catch (NameAlreadyBoundException e) {
                 DeploymentInfo deployment = findNameOwner(name);
                 if (deployment != null){

Modified: 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java?rev=578381&r1=578380&r2=578381&view=diff
==============================================================================
--- 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java
 (original)
+++ 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java
 Fri Sep 21 23:48:51 2007
@@ -35,7 +35,6 @@
 import java.util.Properties;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.WeakHashMap;
 import java.util.Set;
 
@@ -249,7 +248,7 @@
                 IntraVmCopyMonitor.preCopyOperation();
                 try {
                     throwable = (Throwable) copyObj(throwable);
-                    throw convertException(throwable, method);
+                    throw convertException(throwable, method, interfce);
                 } finally {
                     IntraVmCopyMonitor.postCopyOperation();
                 }
@@ -290,7 +289,7 @@
                 IntraVmCopyMonitor.preCrossClassLoaderOperation();
                 try {
                     throwable = (Throwable) copyObj(throwable);
-                    throw convertException(throwable, method);
+                    throw convertException(throwable, method, interfce);
                 } finally {
                     IntraVmCopyMonitor.postCrossClassLoaderOperation();
                 }
@@ -321,7 +320,7 @@
 
                 return _invoke(proxy, interfce, method, args);
             } catch (Throwable t) {
-                throw convertException(t, method);
+                throw convertException(t, method, interfce);
             }
         }
     }
@@ -331,10 +330,12 @@
      * will be the top element in the stacktrace
      * @param e
      * @param method
+     * @param interfce
      */
-    protected Throwable convertException(Throwable e, Method method) {
+    protected Throwable convertException(Throwable e, Method method, Class 
interfce) {
+        boolean rmiRemote = java.rmi.Remote.class.isAssignableFrom(interfce);
         if (e instanceof TransactionRequiredException) {
-            if (interfaceType.isBusiness()) {
+            if (!rmiRemote && interfaceType.isBusiness()) {
                 return new 
EJBTransactionRequiredException(e.getMessage()).initCause(getCause(e));
             } else if (interfaceType.isLocal()) {
                 return new 
TransactionRequiredLocalException(e.getMessage()).initCause(getCause(e));
@@ -343,7 +344,7 @@
             }
         }
         if (e instanceof TransactionRolledbackException) {
-            if (interfaceType.isBusiness()) {
+            if (!rmiRemote && interfaceType.isBusiness()) {
                 return new 
EJBTransactionRolledbackException(e.getMessage()).initCause(getCause(e));
             } else if (interfaceType.isLocal()) {
                 return new 
TransactionRolledbackLocalException(e.getMessage()).initCause(getCause(e));
@@ -352,7 +353,7 @@
             }
         }
         if (e instanceof NoSuchObjectException) {
-            if (interfaceType.isBusiness()) {
+            if (!rmiRemote && interfaceType.isBusiness()) {
                 return new 
NoSuchEJBException(e.getMessage()).initCause(getCause(e));
             } else if (interfaceType.isLocal()) {
                 return new 
NoSuchObjectLocalException(e.getMessage()).initCause(getCause(e));
@@ -361,7 +362,7 @@
             }
         }
         if (e instanceof RemoteException) {
-            if (interfaceType.isBusiness()) {
+            if (!rmiRemote && interfaceType.isBusiness()) {
                 return new EJBException(e.getMessage()).initCause(getCause(e));
             } else if (interfaceType.isLocal()) {
                 return new EJBException(e.getMessage()).initCause(getCause(e));
@@ -370,7 +371,7 @@
             }
         }
         if (e instanceof AccessException) {
-            if (interfaceType.isBusiness()) {
+            if (!rmiRemote && interfaceType.isBusiness()) {
                 return new 
AccessLocalException(e.getMessage()).initCause(getCause(e));
             } else if (interfaceType.isLocal()) {
                 return new 
AccessLocalException(e.getMessage()).initCause(getCause(e));

Modified: 
openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml?rev=578381&r1=578380&r2=578381&view=diff
==============================================================================
--- 
openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
 (original)
+++ 
openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
 Fri Sep 21 23:48:51 2007
@@ -160,12 +160,12 @@
     # Specifies the size of the bean pools for this
     # stateful SessionBean container.
 
-    PoolSize 100
+    PoolSize 1000
 
     # Property name that specifies the number of instances
     # to passivate at one time when doing bulk passivation.
 
-    BulkPassivate 50
+    BulkPassivate 100
 
   </ServiceProvider>
 


Reply via email to