Author: jleroux
Date: Mon Nov 26 06:30:44 2007 New Revision: 598288 URL: http://svn.apache.org/viewvc?rev=598288&view=rev Log: To avoid NPEs in Webtools/Minerva Connection Info (did not look further to check if it works fine) Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java ofbiz/trunk/framework/webtools/webapp/webtools/entity/minervaObjects.ftl Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java?rev=598288&r1=598287&r2=598288&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java Mon Nov 26 06:30:44 2007 @@ -20,6 +20,7 @@ import java.sql.Connection; import java.sql.SQLException; +import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -125,15 +126,18 @@ public static Set getPooledData(String helperName) throws GenericEntityException { XAPoolDataSource pds = dsCache.get(helperName); if (pds == null) { - throw new GenericEntityException("No pool found for helper name [" + helperName + "]"); + Debug.logError("No pool found for helper name [" + helperName + "]", module); + return new HashSet(); + } else { + return pds.getPooledObjectRecords(0); // 0 to return all (in use and waiting) } - return pds.getPooledObjectRecords(0); // 0 to return all (in use and waiting) } public static String getPoolName(String helperName) throws GenericEntityException { XAPoolDataSource pds = dsCache.get(helperName); if (pds == null) { - throw new GenericEntityException("No pool found for helper name [" + helperName + "]"); + Debug.logError("No pool found for helper name [" + helperName + "]", module); + return null; } return pds.getPoolDataString(); } Modified: ofbiz/trunk/framework/webtools/webapp/webtools/entity/minervaObjects.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/entity/minervaObjects.ftl?rev=598288&r1=598287&r2=598288&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/webapp/webtools/entity/minervaObjects.ftl (original) +++ ofbiz/trunk/framework/webtools/webapp/webtools/entity/minervaObjects.ftl Mon Nov 26 06:30:44 2007 @@ -41,8 +41,8 @@ <#list groups as group> <#assign helper = delegator.getGroupHelperName(group)?if_exists/> <#if (helper?has_content)> - <#assign pooledObjs = Static["org.ofbiz.entity.transaction.MinervaConnectionFactory"].getPooledData(helper)?if_exists/> - <#assign pool = Static["org.ofbiz.entity.transaction.MinervaConnectionFactory"].getPoolName(helper)?if_exists/> + <#assign pooledObjs = Static["org.ofbiz.entity.connection.MinervaConnectionFactory"].getPooledData(helper)?if_exists/> + <#assign pool = Static["org.ofbiz.entity.connection.MinervaConnectionFactory"].getPoolName(helper)?if_exists/> <#if (pooledObjs?has_content)> <#list pooledObjs as obj> <#assign isTx = (obj.getCurrentXid()?has_content)/> |
Free forum by Nabble | Edit this page |