geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r524183 - in /geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba: StandardServant.java util/Util.java
Date Fri, 30 Mar 2007 17:15:43 GMT
Author: rickmcguire
Date: Fri Mar 30 10:15:42 2007
New Revision: 524183

URL: http://svn.apache.org/viewvc?view=rev&rev=524183
Log:
GERONIMO-3047 EJB .create() calls causing marshalling exceptions when invoked through CORBA.


Modified:
    geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/StandardServant.java
    geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/util/Util.java

Modified: geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/StandardServant.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/StandardServant.java?view=diff&rev=524183&r1=524182&r2=524183
==============================================================================
--- geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/StandardServant.java
(original)
+++ geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/StandardServant.java
Fri Mar 30 10:15:42 2007
@@ -44,6 +44,7 @@
 import org.apache.openejb.BeanType;
 import org.apache.openejb.RpcContainer;
 import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.ProxyInfo;
 import org.apache.geronimo.corba.util.Util;
 import org.omg.CORBA.INVALID_TRANSACTION;
 import org.omg.CORBA.MARSHAL;
@@ -239,6 +240,11 @@
                     try {
                         RpcContainer container = (RpcContainer) ejbDeployment.getContainer();
                         result = container.invoke(ejbDeployment.getDeploymentId(), method,
arguments, primaryKey, null);
+                        // some methods like create() return a ProxyInfo object.  We need
to 
+                        // turn this into a real EJB remote reference. 
+                        if (result instanceof ProxyInfo) {
+                            result = Util.getEJBProxy((ProxyInfo)result); 
+                        }
                     } catch (OpenEJBException e) {
                         Throwable cause = e.getCause();
                         if (cause instanceof Exception) {

Modified: geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/util/Util.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/util/Util.java?view=diff&rev=524183&r1=524182&r2=524183
==============================================================================
--- geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/util/Util.java
(original)
+++ geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/util/Util.java
Fri Mar 30 10:15:42 2007
@@ -66,6 +66,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.corba.CorbaApplicationServer;
+import org.apache.openejb.ProxyInfo;
 import org.apache.openejb.spi.ApplicationServer;
 import org.apache.openejb.core.ServerFederation;
 import org.apache.openejb.util.ObjectInputStreamExt;
@@ -112,6 +113,15 @@
             handleDelegate = (HandleDelegate) ic.lookup("java:comp/HandleDelegate");
         }
         return handleDelegate;
+    }
+    
+    public static Object getEJBProxy(ProxyInfo info) {
+        if (info.getInterfaceType().isHome()) {
+            return corbaApplicationServer.getEJBHome(info); 
+        }
+        else {
+            return corbaApplicationServer.getEJBObject(info); 
+        }
     }
 
     public static byte[] encodeOID(String oid) throws IOException {



Mime
View raw message