Permalink
Browse files

Handle null cep

  • Loading branch information...
1 parent b5b47a2 commit fb470d6a1e96d87803690810f753d5c2ad7f6973 fraenkel committed Oct 7, 2011
Showing with 5 additions and 2 deletions.
  1. +1 −1 wxsutils/pom.xml
  2. +4 −1 wxsutils/src/main/java/com/devwebsphere/wxsutils/WXSUtils.java
View
@@ -4,7 +4,7 @@
<groupId>com.billynewport.wxsutils</groupId>
<artifactId>wxsutils</artifactId>
<packaging>jar</packaging>
- <version>2.5.2-SNAPSHOT</version>
+ <version>2.5.3-SNAPSHOT</version>
<name>wxsutils</name>
<url>http://maven.apache.org</url>
<dependencies>
@@ -54,6 +54,7 @@
import com.ibm.websphere.objectgrid.ClientServerLoaderException;
import com.ibm.websphere.objectgrid.ObjectGrid;
import com.ibm.websphere.objectgrid.ObjectGridException;
+import com.ibm.websphere.objectgrid.ObjectGridManager;
import com.ibm.websphere.objectgrid.ObjectGridManagerFactory;
import com.ibm.websphere.objectgrid.ObjectGridRuntimeException;
import com.ibm.websphere.objectgrid.ObjectMap;
@@ -579,7 +580,9 @@ static public ObjectGrid connectClient(String cep, String gridName, String ogXML
*/
static public ObjectGrid connectClient(String cep, String gridName, URL ogXMLURL) {
try {
- ClientClusterContext ccc = ObjectGridManagerFactory.getObjectGridManager().connect(cep, null, ogXMLURL);
+ ObjectGridManager ogm = ObjectGridManagerFactory.getObjectGridManager();
+ // must call 2-arg version if cep is null
+ ClientClusterContext ccc = (cep == null) ? ogm.connect(null, ogXMLURL) : ogm.connect(cep, null, ogXMLURL);
ObjectGrid grid = ObjectGridManagerFactory.getObjectGridManager().getObjectGrid(ccc, gridName);
return grid;
} catch (Exception e) {

0 comments on commit fb470d6

Please sign in to comment.