geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r619155 - in /geronimo/server/branches/2.1/framework: configs/rmi-naming/src/main/plan/plan.xml modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/JavaCompContextGBean.java
Date Wed, 06 Feb 2008 21:14:58 GMT
Author: djencks
Date: Wed Feb  6 13:14:57 2008
New Revision: 619155

URL: http://svn.apache.org/viewvc?rev=619155&view=rev
Log:
GERONIMO-3808 Fix shutdown NPE and provide better error when accessing java:comp env on a
non-initialized thread

Modified:
    geronimo/server/branches/2.1/framework/configs/rmi-naming/src/main/plan/plan.xml
    geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/JavaCompContextGBean.java

Modified: geronimo/server/branches/2.1/framework/configs/rmi-naming/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/configs/rmi-naming/src/main/plan/plan.xml?rev=619155&r1=619154&r2=619155&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/configs/rmi-naming/src/main/plan/plan.xml (original)
+++ geronimo/server/branches/2.1/framework/configs/rmi-naming/src/main/plan/plan.xml Wed Feb
 6 13:14:57 2008
@@ -32,7 +32,9 @@
 
     <gbean name="GlobalContext" class="org.apache.geronimo.gjndi.GlobalContextGBean"/>
 
-    <gbean name="JavaCompContext" class="org.apache.geronimo.gjndi.JavaCompContextGBean"/>
+    <gbean name="JavaCompContext" class="org.apache.geronimo.gjndi.JavaCompContextGBean">
+        <dependency><name>GlobalContext</name></dependency>
+    </gbean>
 
     <gbean name="JavaContext" class="org.apache.geronimo.gjndi.WritableContextGBean">
         <attribute name="nameInNamespace">java:</attribute>

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/JavaCompContextGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/JavaCompContextGBean.java?rev=619155&r1=619154&r2=619155&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/JavaCompContextGBean.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/gjndi/JavaCompContextGBean.java
Wed Feb  6 13:14:57 2008
@@ -29,7 +29,11 @@
  */
 public class JavaCompContextGBean extends ContextFlyweight {
     protected Context getContext() {
-        return RootContext.getComponentContext();
+        Context context = RootContext.getComponentContext();
+        if (context == null) {
+            throw new NullPointerException("You have accessed the java:comp jndi context
on a thread that has not initialized it");
+        }
+        return context;
     }
 
     public String getNameInNamespace() throws NamingException {



Mime
View raw message