Throw IllegalStateException when provider is null.

git-svn-id: https://svn.apache.org/repos/asf/geronimo/specs/trunk@1806730 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/CDI.java b/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/CDI.java
index 8652c71..ac55bc1 100644
--- a/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/CDI.java
+++ b/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/CDI.java
@@ -61,6 +61,10 @@
                 }
             }
         }
+        if (PROVIDER == null)
+        {
+            throw new IllegalStateException("Unable to locate a CDIProvider implementation");
+        }
         return PROVIDER.getCDI();
     }
 
@@ -77,7 +81,7 @@
     {
         if (provider == null)
         {
-            PROVIDER = null;
+            throw new IllegalStateException("CDIProvider must not be null");
         }
         else
         {