tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r510163 - in /incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba: CORBABean.java CSSBean.java NameService.java TSSBean.java
Date Wed, 21 Feb 2007 19:37:33 GMT
Author: rickmcguire
Date: Wed Feb 21 11:37:32 2007
New Revision: 510163

URL: http://svn.apache.org/viewvc?view=rev&rev=510163
Log:
GERONOMO-2862 Detect Yoko classes are not endorsed


Modified:
    incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CORBABean.java
    incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CSSBean.java
    incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/NameService.java
    incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/TSSBean.java

Modified: incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CORBABean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CORBABean.java?view=diff&rev=510163&r1=510162&r2=510163
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CORBABean.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CORBABean.java
Wed Feb 21 11:37:32 2007
@@ -26,6 +26,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.InvalidConfigurationException; 
 import org.apache.openejb.corba.security.config.ConfigAdapter;
 import org.apache.openejb.corba.security.config.ssl.SSLConfig;
 import org.apache.openejb.corba.security.config.tss.TSSConfig;
@@ -232,6 +233,9 @@
             // TSSBeans are going to need our rootPOA instance, so resolve this now.
             org.omg.CORBA.Object obj = orb.resolve_initial_references("RootPOA");
             rootPOA = POAHelper.narrow(obj);
+        } catch (NoSuchMethodError e) {
+            log.error("Incorrect level of org.omg.CORBA classes found.\nLikely cause is an
incorrect java.endorsed.dirs configuration"); 
+            throw new InvalidConfigurationException("CORBA usage requires Yoko CORBA spec
classes in java.endorsed.dirs classpath", e); 
         } finally {
             Thread.currentThread().setContextClassLoader(savedLoader);
         }

Modified: incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CSSBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CSSBean.java?view=diff&rev=510163&r1=510162&r2=510163
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CSSBean.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/CSSBean.java
Wed Feb 21 11:37:32 2007
@@ -25,6 +25,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.InvalidConfigurationException; 
 import org.apache.openejb.corba.security.config.ConfigAdapter;
 import org.apache.openejb.corba.security.config.css.CSSConfig;
 import org.apache.openejb.corba.security.config.ssl.SSLConfig;
@@ -154,11 +155,17 @@
             NameComponent[] nameComponent = ic.to_name(name);
             org.omg.CORBA.Object bean = ic.resolve(nameComponent);
 
-            //Install the client interceptors
+            // Ok, now we have an object reference from the naming service, but we need to

+            // activate that object on the cssORB instance before we hand it out.  Activating
it 
+            // on the cssORB will ensure that all of the interceptors and policies we define
on the 
+            // cssORB will get used for all requests involving this bean. 
             String beanIOR = nssORB.object_to_string(bean);
             bean = cssORB.string_to_object(beanIOR);
 
             return bean;
+        } catch (NoSuchMethodError e) {
+            log.error("Incorrect level of org.omg.CORBA classes found.\nLikely cause is an
incorrect java.endorsed.dirs configuration"); 
+            throw new InvalidConfigurationException("CORBA usage requires Yoko CORBA spec
classes in java.endorsed.dirs classpath", e); 
         } catch (UserException ue) {
             log.error(description + " - Looking up home", ue);
             throw new RuntimeException(ue);

Modified: incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/NameService.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/NameService.java?view=diff&rev=510163&r1=510162&r2=510163
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/NameService.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/NameService.java
Wed Feb 21 11:37:32 2007
@@ -19,6 +19,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.InvalidConfigurationException; 
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 
 import org.apache.openejb.corba.security.config.ConfigAdapter;
@@ -159,8 +160,13 @@
      */
     public void doStart() throws Exception {
         if (localServer) {
-            service = config.createNameService(host, port);
-            log.debug("Started transient CORBA name service on port " + port);
+            try {
+                service = config.createNameService(host, port);
+                log.debug("Started transient CORBA name service on port " + port);
+            } catch (NoSuchMethodError e) {
+                log.error("Incorrect level of org.omg.CORBA classes found.\nLikely cause
is an incorrect java.endorsed.dirs configuration"); 
+                throw new InvalidConfigurationException("CORBA usage requires Yoko CORBA
spec classes in java.endorsed.dirs classpath", e); 
+            }
         }
     }
 

Modified: incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/TSSBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/TSSBean.java?view=diff&rev=510163&r1=510162&r2=510163
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/TSSBean.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/TSSBean.java
Wed Feb 21 11:37:32 2007
@@ -19,6 +19,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.InvalidConfigurationException; 
 import org.omg.CORBA.Any;
 import org.omg.CORBA.ORB;
 import org.omg.CORBA.Policy;
@@ -132,6 +133,9 @@
             // NB:  This is initial context is never used by the TSSBean, but we request
it here
             // to verify that the server ORB is correctly configured and our target server
is accessible.
             initialContext = NamingContextExtHelper.narrow(obj);
+        } catch (NoSuchMethodError e) {
+            log.error("Incorrect level of org.omg.CORBA classes found.\nLikely cause is an
incorrect java.endorsed.dirs configuration"); 
+            throw new InvalidConfigurationException("CORBA usage requires Yoko CORBA spec
classes in java.endorsed.dirs classpath", e); 
         } finally {
             Thread.currentThread().setContextClassLoader(savedLoader);
         }



Mime
View raw message