[Jboss-cvs] JBossAS SVN: r56006 - branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 16 16:45:13 EDT 2006
Author: bstansberry at jboss.com
Date: 2006-08-16 16:45:10 -0400 (Wed, 16 Aug 2006)
New Revision: 56006
Modified:
branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/ClusteringNotSupportedException.java
branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java
branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheService.java
Log:
[JBAS-3525] Remove redundant ERROR logging
Modified: branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/ClusteringNotSupportedException.java
===================================================================
--- branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/ClusteringNotSupportedException.java 2006-08-16 20:44:09 UTC (rev 56005)
+++ branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/ClusteringNotSupportedException.java 2006-08-16 20:45:10 UTC (rev 56006)
@@ -31,8 +31,16 @@
*/
public class ClusteringNotSupportedException extends Exception
{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -2365801349845482947L;
+
public ClusteringNotSupportedException(String message)
{
super(message);
}
+
+ public ClusteringNotSupportedException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
}
Modified: branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java
===================================================================
--- branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java 2006-08-16 20:44:09 UTC (rev 56005)
+++ branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java 2006-08-16 20:45:10 UTC (rev 56006)
@@ -149,18 +149,11 @@
this.useJK_ = useJK;
this.replicationFieldBatchMode_ =
webMetaData.getReplicationFieldBatchMode() ? Boolean.TRUE : Boolean.FALSE;
- try
- {
- proxy_ = new JBossCacheService(cacheObjectNameString_);
- }
- catch (Throwable t)
- {
- String str = "JBossCacheService to Tomcat clustering not found";
- log_.error(str, t);
- throw new ClusteringNotSupportedException(str);
- }
+
+ proxy_ = new JBossCacheService(cacheObjectNameString_);
// Confirm our replication granularity is compatible with the cache
+ // Throws ISE if not
validateFieldMarshalling();
embedded_ = true;
@@ -1475,6 +1468,7 @@
proxy_ = new JBossCacheService(cacheObjectNameString_);
// Confirm our replication granularity is compatible with the cache
+ // Throws ISE if not
validateFieldMarshalling();
// We need to pass the classloader that is associated with this
@@ -1482,14 +1476,10 @@
tcl_ = container_.getLoader().getClassLoader();
proxy_.start(tcl_, this);
}
- catch (ClusteringNotSupportedException e)
- {
- throw new LifecycleException(e.getMessage(), e);
- }
catch (Throwable t)
{
- String str = "JBossCacheService to Tomcat clustering not found";
- log_.error(str);
+ String str = "Problem starting JBossCacheService for Tomcat clustering";
+ log_.error(str, t);
throw new LifecycleException(str, t);
}
@@ -1732,16 +1722,19 @@
* If we are using FIELD granularity, checks that the TreeCache
* supports marshalling.
*
- * @throws ClusteringNotSupportedException if not
+ * @throws IllegalStateException if not
*/
private void validateFieldMarshalling() throws ClusteringNotSupportedException
{
if (replicationGranularity_ == WebMetaData.REPLICATION_GRANULARITY_FIELD
&& !proxy_.isMarshallingAvailable())
{
- throw new ClusteringNotSupportedException("replication-granularity value is set to " +
- "'FIELD' but is not supported by the cache service configuration. " +
- "Must set 'UseRegionBasedMarshalling' to 'true' in the tc6-cluster.sar jboss-service.xml");
+ // BES 16/8/2006 -- throw ISE, not ClusteringNotSupportedException, as a
+ // misconfig should be treated differently from the absence of clustering
+ // services
+ throw new IllegalStateException("replication-granularity value is set to " +
+ "'FIELD' but is not supported by the cache service configuration. " +
+ "Must set 'UseRegionBasedMarshalling' to 'true' in the tc5-cluster.sar jboss-service.xml");
}
}
Modified: branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheService.java
===================================================================
--- branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheService.java 2006-08-16 20:44:09 UTC (rev 56005)
+++ branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheService.java 2006-08-16 20:45:10 UTC (rev 56006)
@@ -127,21 +127,29 @@
// Create Proxy-Object for this service
proxy_ = (PojoCacheMBean) MBeanProxyExt.create(PojoCacheMBean.class,
cacheServiceName_);
- if (proxy_ == null)
- {
- throw new RuntimeException("JBossCacheService: locate null TomcatCacheMbean");
- }
+ }
+ catch (Throwable t)
+ {
- cacheWrapper_ = new JBossCacheWrapper(proxy_);
-
- useTreeCacheMarshalling_ = proxy_.getUseRegionBasedMarshalling();
+ String str = "Could not access TreeCache service " +
+ (cacheServiceName_ == null ? "<null>" : cacheServiceName_.toString()) +
+ " for Tomcat clustering";
+ log_.debug(str);
+ throw new ClusteringNotSupportedException(str, t);
}
- catch (Throwable e)
+
+ if (proxy_ == null)
{
- String str = cacheServiceName_ + " service to Tomcat clustering not found";
- log_.error(str);
+ String str = "Could not access TreeCache service " +
+ (cacheServiceName_ == null ? "<null>" : cacheServiceName_.toString()) +
+ " for Tomcat clustering";
+ log_.debug(str);
throw new ClusteringNotSupportedException(str);
}
+
+ cacheWrapper_ = new JBossCacheWrapper(proxy_);
+
+ useTreeCacheMarshalling_ = proxy_.getUseRegionBasedMarshalling();
}
public void start(ClassLoader tcl, JBossCacheManager manager)
More information about the jboss-cvs-commits
mailing list