You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2010/10/28 10:54:44 UTC
svn commit: r1028230 - in /openwebbeans/trunk:
webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
Author: gerdogdu
Date: Thu Oct 28 08:54:44 2010
New Revision: 1028230
URL: http://svn.apache.org/viewvc?rev=1028230&view=rev
Log:
[OWB-480] Avoid a couple NPEs, thanks to David Jencks
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java?rev=1028230&r1=1028229&r2=1028230&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java Thu Oct 28 08:54:44 2010
@@ -44,7 +44,7 @@ public class OpenWebBeansConfiguration
private final static String DEFAULT_CONFIG_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans.properties";
/**Property of application*/
- private Properties configProperties = new Properties();
+ private final Properties configProperties = new Properties();
/**Conversation periodic delay in ms.*/
public static final String CONVERSATION_PERIODIC_DELAY = "org.apache.webbeans.conversation.Conversation.periodicDelay";
@@ -214,9 +214,13 @@ public class OpenWebBeansConfiguration
public synchronized void parseConfiguration() throws WebBeansConfigurationException
{
Properties newConfigProperties = PropertyLoader.getProperties(DEFAULT_CONFIG_PROPERTIES_NAME);
+ configProperties.clear();
// set the new one as perfect fit.
- configProperties = newConfigProperties;
+ if(newConfigProperties != null)
+ {
+ configProperties.putAll(newConfigProperties);
+ }
}
Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java?rev=1028230&r1=1028229&r2=1028230&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java (original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java Thu Oct 28 08:54:44 2010
@@ -105,9 +105,17 @@ public final class WebContainerLifecycle
if(OpenWebBeansConfiguration.getInstance().isJspApplication())
{
logger.debug("Application is configured as JSP. Adding EL Resolver.");
-
- JspApplicationContext applicationCtx = JspFactory.getDefaultFactory().getJspApplicationContext((ServletContext)(startupObject));
- applicationCtx.addELResolver(resolver);
+
+ JspFactory factory = JspFactory.getDefaultFactory();
+ if (factory != null)
+ {
+ JspApplicationContext applicationCtx = factory.getJspApplicationContext((ServletContext)(startupObject));
+ applicationCtx.addELResolver(resolver);
+ }
+ else
+ {
+ logger.debug("Default JSPFactroy instance has not found");
+ }
}
// Add BeanManager to the 'javax.enterprise.inject.spi.BeanManager' servlet context attribute