You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by az...@apache.org on 2007/07/02 16:12:36 UTC

svn commit: r552498 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: deployment/ClusterBuilder.java i18n/resource.properties

Author: azeez
Date: Mon Jul  2 07:12:35 2007
New Revision: 552498

URL: http://svn.apache.org/viewvc?view=rev&rev=552498
Log:
Printing out the name of the missing class


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java?view=diff&rev=552498&r1=552497&r2=552498
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java Mon Jul  2 07:12:35 2007
@@ -66,7 +66,13 @@
         String className = classNameAttr.getAttributeValue();
         ClusterManager clusterManager;
         try {
-            Class clazz = Class.forName(className);
+            Class clazz;
+            try {
+                clazz = Class.forName(className);
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
+                                                                  className));
+            }
             clusterManager = (ClusterManager) clazz.newInstance();
 
             clusterManager.setConfigurationContext(configCtx);
@@ -83,8 +89,6 @@
             loadContextManager(clusterElement, clusterManager);
 
             axisConfig.setClusterManager(clusterManager);
-        } catch (ClassNotFoundException e) {
-            throw new DeploymentException(Messages.getMessage("clusterImplNotFound"));
         } catch (InstantiationException e) {
             throw new DeploymentException(Messages.getMessage("cannotLoadClusterImpl"));
         } catch (IllegalAccessException e) {
@@ -94,7 +98,6 @@
 
     private void loadContextManager(OMElement clusterElement,
                                     ClusterManager clusterManager) throws DeploymentException,
-                                                                          ClassNotFoundException,
                                                                           InstantiationException,
                                                                           IllegalAccessException {
         OMElement contextManagerEle =
@@ -111,7 +114,13 @@
 
             String className = classNameAttr.getAttributeValue();
 
-            Class clazz = Class.forName(className);
+            Class clazz;
+            try {
+                clazz = Class.forName(className);
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
+                                                                  className));
+            }
             ContextManager contextManager = (ContextManager) clazz.newInstance();
             clusterManager.setContextManager(contextManager);
 
@@ -125,7 +134,12 @@
                                                                       TAG_LISTENER));
                 }
                 className = classNameAttr.getAttributeValue();
-                clazz = Class.forName(className);
+                try {
+                    clazz = Class.forName(className);
+                } catch (ClassNotFoundException e) {
+                    throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
+                                                                      className));
+                }
                 ContextManagerListener listener = (ContextManagerListener) clazz.newInstance();
                 contextManager.setContextManagerListener(listener);
             } else {
@@ -190,7 +204,6 @@
 
     private void loadConfigManager(OMElement clusterElement,
                                    ClusterManager clusterManager) throws DeploymentException,
-                                                                         ClassNotFoundException,
                                                                          InstantiationException,
                                                                          IllegalAccessException {
         OMElement configManagerEle =
@@ -203,7 +216,13 @@
             }
 
             String className = classNameAttr.getAttributeValue();
-            Class clazz = Class.forName(className);
+            Class clazz;
+            try {
+                clazz = Class.forName(className);
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
+                                                                  className));
+            }
 
             ConfigurationManager configurationManager =
                     (ConfigurationManager) clazz.newInstance();
@@ -214,19 +233,22 @@
             if (listenerEle != null) {
                 classNameAttr = listenerEle.getAttribute(new QName(TAG_CLASS_NAME));
                 if (classNameAttr == null) {
-                    throw new DeploymentException(Messages.getMessage("classAttributeNotFound",
+                    throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
                                                                       TAG_LISTENER));
                 }
 
                 className = classNameAttr.getAttributeValue();
-                clazz = Class.forName(className);
+                try {
+                    clazz = Class.forName(className);
+                } catch (ClassNotFoundException e) {
+                    throw new DeploymentException(Messages.getMessage("configurationManagerListenerIsNull"));
+                }
                 ConfigurationManagerListener listener = (ConfigurationManagerListener) clazz
                         .newInstance();
                 listener.setConfigurationContext(configCtx);
                 configurationManager.setConfigurationManagerListener(listener);
             } else {
-                throw new DeploymentException(Messages.
-                        getMessage("configurationManagerListenerIsNull"));
+                throw new DeploymentException(Messages.getMessage("configurationManagerListenerIsNull"));
             }
 
             //updating the ConfigurationManager with the new ConfigurationContext

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties?view=diff&rev=552498&r1=552497&r2=552498
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties Mon Jul  2 07:12:35 2007
@@ -230,7 +230,7 @@
 outmsgctxnull=The out message context is null. Set the out message context before calling this method.
 cannotreset=The message exchange pattern (MEP) is not complete. Cannot reset
 cannotaddmsgctx=The system cannot add the message context again until client runs.
-clusterImplNotFound=Cluster implementation class is not found
+clusterImplNotFound=Clustering implementation class {0} not found
 contextManagerListenerIsNull=Cluster ContextManager entry not found in axis2.xml
 configurationManagerListenerIsNull=Cluster ConfigurationManager entry not found in axis2.xml
 cannotLoadClusterImpl=Cluster implementation cannot be loaded



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org