Permalink
Browse files

ARQ-384 Update some container v. in examples

  • Loading branch information...
1 parent 4fea174 commit 068104949d2093ad245edaf5ae7b1493c586cdcd @aslakknutsen aslakknutsen committed Mar 18, 2011
@@ -203,13 +203,18 @@ private Properties getInitialProperties() throws IOException
// Load properties from a jndi.properties file if it exists.
// OpenEJB would have done this if started via the InitialContext
- String propertiesFile = containerConfig.getJndiProperties() == null ? "jndi.properties" : containerConfig.getJndiProperties();
- InputStream jndiPropertiesStream = new FileInputStream(new File(propertiesFile));
- if (jndiPropertiesStream != null)
+ if(containerConfig.getJndiProperties() != null)
{
- properties.load(jndiPropertiesStream);
+ File jndiPropertiesFile = new File(containerConfig.getJndiProperties());
+ if(jndiPropertiesFile.exists())
+ {
+ InputStream jndiPropertiesStream = new FileInputStream(jndiPropertiesFile);
+ if (jndiPropertiesStream != null)
+ {
+ properties.load(jndiPropertiesStream);
+ }
+ }
}
-
// configure OpenEJB to not deploy apps from the classpath
properties.put("openejb.deployments.classpath", "false");
// configure OpenEJB to use integration classes from Arquillian
@@ -154,7 +154,7 @@ protected Object lookupEJB(Class<?> fieldType, String mappedName) throws Excepti
// }
InitialContext initcontext = createContext();
- if(mappedName != null)
+ if(mappedName != null && !mappedName.equals(""))
{
return initcontext.lookup(mappedName);
}

0 comments on commit 0681049

Please sign in to comment.