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 da...@apache.org on 2008/03/19 11:02:04 UTC

svn commit: r638770 - in /webservices/axis2/trunk/c: include/ src/core/deployment/ src/core/description/

Author: damitha
Date: Wed Mar 19 03:01:48 2008
New Revision: 638770

URL: http://svn.apache.org/viewvc?rev=638770&view=rev
Log:
Adding meaningful log messages, modifying log messages to be meaningful, coding conventions

Modified:
    webservices/axis2/trunk/c/include/axis2_module.h
    webservices/axis2/trunk/c/src/core/deployment/axis2_deployment.h
    webservices/axis2/trunk/c/src/core/deployment/conf_init.c
    webservices/axis2/trunk/c/src/core/deployment/dep_engine.c
    webservices/axis2/trunk/c/src/core/deployment/desc_builder.c
    webservices/axis2/trunk/c/src/core/deployment/module_builder.c
    webservices/axis2/trunk/c/src/core/deployment/svc_builder.c
    webservices/axis2/trunk/c/src/core/description/module_desc.c

Modified: webservices/axis2/trunk/c/include/axis2_module.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_module.h?rev=638770&r1=638769&r2=638770&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_module.h (original)
+++ webservices/axis2/trunk/c/include/axis2_module.h Wed Mar 19 03:01:48 2008
@@ -140,17 +140,17 @@
 
     /** Initializes module.
         @sa axis2_module_ops#init */
-#define AXIS2_MODULE_INIT(module, env, conf_ctx, module_desc) \
+#define axis2_module_init(module, env, conf_ctx, module_desc) \
       ((module)->ops->init (module, env, conf_ctx, module_desc))
 
     /** Shutdowns module.
         @sa axis2_module_ops#shutdown */
-#define AXIS2_MODULE_SHUTDOWN(module, env) \
+#define axis2_module_shutdown(module, env) \
       ((module)->ops->shutdown (module, env))
 
     /** Fills handler create function map.
         @sa axis2_module_ops#fill_handler_create_func_map */
-#define AXIS2_MODULE_FILL_HANDLER_CREATE_FUNC_MAP(module, env) \
+#define axis2_module_fill_handler_create_func_map(module, env) \
       ((module)->ops->fill_handler_create_func_map (module, env))
 
     /** @} */

Modified: webservices/axis2/trunk/c/src/core/deployment/axis2_deployment.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/axis2_deployment.h?rev=638770&r1=638769&r2=638770&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/axis2_deployment.h (original)
+++ webservices/axis2/trunk/c/src/core/deployment/axis2_deployment.h Wed Mar 19 03:01:48 2008
@@ -106,6 +106,8 @@
 #define AXIS2_SERVICE_FOLDER "services"
 #define AXIS2_LIB_FOLDER "lib"
 #define AXIS2_LIB_DIR "libDir"
+#define AXIS2_SERVICE_DIR "servicesDir"
+#define AXIS2_MODULE_DIR "moduleDir"
 
 #define AXIS2_ATTRIBUTE_DEFAULT_VERSION "version"
 #define AXIS2_DEFAULT_MODULE_VERSION "defaultModuleVersions"

Modified: webservices/axis2/trunk/c/src/core/deployment/conf_init.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/conf_init.c?rev=638770&r1=638769&r2=638770&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/conf_init.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/conf_init.c Wed Mar 19 03:01:48 2008
@@ -295,7 +295,7 @@
                             axis2_module_desc_get_module(mod_desc, env);
                         if (mod)
                         {
-                            AXIS2_MODULE_INIT(mod, env, conf_ctx, mod_desc);
+                            axis2_module_init(mod, env, conf_ctx, mod_desc);
                         }
                     }
                 }

Modified: webservices/axis2/trunk/c/src/core/deployment/dep_engine.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/dep_engine.c?rev=638770&r1=638769&r2=638770&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/dep_engine.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/dep_engine.c Wed Mar 19 03:01:48 2008
@@ -38,41 +38,38 @@
     axis2_arch_reader_t *arch_reader;
 
     /**
-     * to keep a ref to engine register
-     * this ref will pass to engine when it call start()
-     * method
+     * To keep a reference to engine configuration.
+     * This reference will pass to engine when it call start()
+     * function
      */
     axis2_conf_t *conf;
     axis2_char_t *axis2_repos;
     axis2_bool_t hot_dep;       /* to do hot deployment or not */
     axis2_bool_t hot_update;    /* to do hot update or not */
 	
-	/* whether dep_engine build using axis2.xml */
+	/* Whether dep_engine built using axis2.xml */
 	axis2_bool_t file_flag;
 
     /**
-     * This will store all the web Services to deploy
+     * This will store all the web services to deploy
      */
     axutil_array_list_t *ws_to_deploy;
 
     /**
-     * this will store all the web Services to undeploy
+     * This will store all the web services to undeploy
      */
     axutil_array_list_t *ws_to_undeploy;
-    axis2_phases_info_t *phases_info;   /* to store phases list in axis2.xml */
+    axis2_phases_info_t *phases_info;   /* To store phases list in axis2.xml */
 
-    /**
-     * this constructor for the testing
-     */
     axis2_char_t *folder_name;
 
 	/**
-	 * module directory, dep_engine holds in the module build scenario
+	 * Module directory, dep_engine holds in the module build scenario.
 	 */
 	axis2_char_t *module_dir;
 
    /**
-    *services directory, services are avialble in services directory
+    * Services directory, services are avialble in services directory
     */
 
     axis2_char_t *svc_dir;
@@ -83,8 +80,8 @@
     axis2_char_t *conf_name;
 
     /**
-     * To store the module specified in the server.xml at the document parsing 
-     * time
+     * To store the module specified in the server.xml(axis2.xml) at the 
+     * document parsing time
      */
     axutil_array_list_t *module_list;
     axis2_repos_listener_t *repos_listener; /*Added this here to help with freeing
@@ -159,9 +156,11 @@
     if (!dep_engine)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
-  	dep_engine = (axis2_dep_engine_t *) memset (dep_engine, 0, sizeof (axis2_dep_engine_t));
+  	dep_engine = (axis2_dep_engine_t *) memset (dep_engine, 0, 
+        sizeof (axis2_dep_engine_t));
     dep_engine->curr_file = NULL;
     dep_engine->arch_reader = NULL;
     dep_engine->conf = NULL;
@@ -186,6 +185,7 @@
     if (!(dep_engine->ws_to_deploy))
     {
         axis2_dep_engine_free(dep_engine, env);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
 
@@ -198,6 +198,7 @@
     if (!(dep_engine->phases_info))
     {
         axis2_dep_engine_free(dep_engine, env);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
 
@@ -261,10 +262,12 @@
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, repos_path, NULL);
     AXIS2_PARAM_CHECK(env->error, svr_xml_file, NULL);
-    if (0 == axutil_strcmp("", repos_path))
+    if (!axutil_strcmp("", repos_path))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_REPO_CAN_NOT_BE_NULL,
                         AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Repository path cannot be empty");
         return NULL;
     }
 
@@ -273,6 +276,7 @@
     if (!dep_engine)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
 
@@ -282,6 +286,8 @@
         axis2_dep_engine_free(dep_engine, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_REPOSITORY_NOT_EXIST,
                         AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Repository path %s does not exist", repos_path);
         return NULL;
     }
 
@@ -290,6 +296,7 @@
     {
         axis2_dep_engine_free(dep_engine, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
 
@@ -298,6 +305,7 @@
     {
         axis2_dep_engine_free(dep_engine, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
 
@@ -310,6 +318,8 @@
         axis2_dep_engine_free(dep_engine, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_REPO_CAN_NOT_BE_NULL,
                         AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Axis2 Configuration file name cannot be NULL");
         return NULL;
     }
 	
@@ -319,8 +329,8 @@
         axis2_dep_engine_free(dep_engine, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CONFIG_NOT_FOUND,
                         AXIS2_FAILURE);
-		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s", 
-						 AXIS2_ERROR_GET_MESSAGE (env->error));
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Axis2 Configuration file name not found");
         return NULL;
     }
 
@@ -343,6 +353,7 @@
     if (!dep_engine)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
 
@@ -352,6 +363,8 @@
         axis2_dep_engine_free(dep_engine, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_REPO_CAN_NOT_BE_NULL,
                         AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Axis2 Configuration file name cannot be NULL");
         return NULL;
     }
     status = axutil_file_handler_access(dep_engine->conf_name, AXIS2_F_OK);
@@ -360,8 +373,8 @@
         axis2_dep_engine_free(dep_engine, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CONFIG_NOT_FOUND,
                         AXIS2_FAILURE);
-		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s", 
-						 AXIS2_ERROR_GET_MESSAGE (env->error));
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Axis2 Configuration file name not found");
         return NULL;
     }
 
@@ -559,7 +572,6 @@
 {
     axutil_qname_t *qname = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, module_qname, AXIS2_FAILURE);
 
     qname = axutil_qname_clone(module_qname, env);
@@ -569,6 +581,7 @@
         if (!dep_engine->module_list)
         {
             axutil_qname_free(qname, env);
+		    AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "No memory");
             return AXIS2_FAILURE;
         }
     }
@@ -602,7 +615,6 @@
     const axutil_env_t * env,
     axis2_arch_file_data_t * file)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, file, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -615,7 +627,6 @@
     const axutil_env_t * env,
     axis2_ws_info_t * file)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, file, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -645,7 +656,7 @@
 }
 
 /**
- * To set hotDeployment and hot update
+ * To set hot deployment and hot update
  */
 static axis2_status_t
 axis2_dep_engine_set_dep_features(
@@ -656,7 +667,6 @@
     axutil_param_t *para_hot_dep = NULL;
     axutil_param_t *para_hot_update = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
     para_hot_dep = axis2_conf_get_param(dep_engine->conf, env,
@@ -691,12 +701,12 @@
     axis2_status_t status = AXIS2_FAILURE;
     axutil_array_list_t *out_fault_phases = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
-
     if (!dep_engine->conf_name)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_PATH_TO_CONFIG_CAN_NOT_BE_NULL,
                         AXIS2_FAILURE);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Path to axis2 configuration file is NULL. Unable to continue");
         return NULL;
     }
 
@@ -704,11 +714,13 @@
 
     if (!dep_engine->conf)
     {
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "No memory. Allocation to configuration failed");
         return NULL;
     }
 	
-	/* set a flag to mark that conf is create using axis2 xml
-	 * to find out that conf is build using axis2 xml , this flag can be used
+	/* Set a flag to mark that conf is created using axis2 xml.
+	 * To find out that conf is build using axis2 xml , this flag can be used.
 	 */
 	axis2_conf_set_axis2_flag (dep_engine->conf, env, dep_engine->file_flag);
 	axis2_conf_set_axis2_xml (dep_engine->conf, env, dep_engine->conf_name);
@@ -723,6 +735,8 @@
     if (!(dep_engine->conf_builder))
     {
         axis2_conf_free(dep_engine->conf, env);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Configuration builder creation failed");
         dep_engine->conf = NULL;
     }
 
@@ -736,18 +750,24 @@
     {
         axis2_conf_free(dep_engine->conf, env);
         dep_engine->conf = NULL;
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Populating Axis2 Configuration failed");
         return NULL;
     }
 
     status = axis2_dep_engine_set_svc_and_module_dir_path (dep_engine, env);
     if (AXIS2_SUCCESS != status)
     {
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Setting service and module directory paths failed");
         return NULL;
     }
 
     status = axis2_dep_engine_set_dep_features(dep_engine, env);
     if (AXIS2_SUCCESS != status)
     {
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Setting deployment features failed");
         return NULL;
     }
 
@@ -766,8 +786,8 @@
         axis2_conf_free(dep_engine->conf, env);
         dep_engine->conf = NULL;
         AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
-                         "dep_engine repos listener creation failed, folder name is %s",
-                         dep_engine->folder_name);
+            "dep_engine repos listener creation failed, folder name is %s",
+                dep_engine->folder_name);
         return NULL;
     }
     axis2_conf_set_repo(dep_engine->conf, env, dep_engine->axis2_repos);
@@ -785,6 +805,8 @@
         dep_engine->conf = NULL;
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MODULE_VALIDATION_FAILED,
                         AXIS2_FAILURE);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Validating system predefined phases failed");
         return NULL;
     }
 
@@ -795,6 +817,8 @@
         axis2_repos_listener_free(dep_engine->repos_listener, env);
         axis2_conf_free(dep_engine->conf, env);
         dep_engine->conf = NULL;
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Setting phases info into Axis2 Configuration failed");
         return NULL;
     }
 	
@@ -809,6 +833,8 @@
         axis2_repos_listener_free(dep_engine->repos_listener, env);
         axis2_conf_free(dep_engine->conf, env);
         dep_engine->conf = NULL;
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Setting out fault phases into Axis2 Configuratin failed");
         return NULL;
     }
 	
@@ -823,7 +849,6 @@
                         AXIS2_FAILURE);
         return NULL;
     }
-    /*} */
 
     return dep_engine->conf;
 }
@@ -838,21 +863,21 @@
     axis2_status_t status = AXIS2_FAILURE;
     axis2_bool_t flag = AXIS2_FALSE;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, client_home, NULL);
 
     flag = axis2_dep_engine_get_file_flag (dep_engine, env);
 
-    if (flag == AXIS2_FALSE)
+    if (!flag)
     {
         dep_engine->axis2_repos = axutil_strdup(env, client_home);
         if (!dep_engine->axis2_repos)
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+		    AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "No memory");
             return NULL;
         }
 
-        if (client_home && 0 != axutil_strcmp("", client_home))
+        if (client_home && axutil_strcmp("", client_home))
         {
             status =
                 axis2_dep_engine_check_client_home(dep_engine, env, client_home);
@@ -863,7 +888,7 @@
             else
             {
                 AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
-                                 "axis2.xml is not available in client repo %s ", client_home);
+                    "axis2.xml is not available in client repo %s ", client_home);
                 AXIS2_ERROR_SET (env->error, AXIS2_ERROR_CONFIG_NOT_FOUND, AXIS2_FAILURE);
                 return NULL;
             }
@@ -874,7 +899,10 @@
                 axutil_strdup(env, AXIS2_CONFIGURATION_RESOURCE);
             if (!dep_engine->conf_name)
             {
-                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_REPO_CAN_NOT_BE_NULL, AXIS2_FAILURE);
+                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_REPO_CAN_NOT_BE_NULL, 
+                    AXIS2_FAILURE);
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                    "Axis2 Configuration file name cannot be NULL");
                 return NULL;
             }
         }
@@ -887,6 +915,8 @@
     dep_engine->conf = axis2_conf_create(env);
     if (!dep_engine->conf)
     {
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "No memory. Allocation for Axis2 Configuration failed");
         return NULL;
     }
     dep_engine->conf_builder =
@@ -903,7 +933,7 @@
     }
 
    /**
-      very important: only after populating we will be able to access
+      Very important: Only after populating we will be able to access
       parameters in axis2 xml.
     */
 
@@ -915,6 +945,8 @@
     {
         axis2_conf_free(dep_engine->conf, env);
         dep_engine->conf = NULL;
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Populating Axis2 Configuration failed");
         return NULL;
     }
 
@@ -923,11 +955,13 @@
     {
         axis2_conf_free(dep_engine->conf, env);
         dep_engine->conf = NULL;
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Setting service and module paths failed");
         return NULL;
     }
 
 
-    if (AXIS2_TRUE == is_repos_exist)
+    if (is_repos_exist)
     {
         dep_engine->hot_dep = AXIS2_FALSE;
         dep_engine->hot_update = AXIS2_FALSE;
@@ -956,9 +990,10 @@
         dep_engine->conf = NULL;
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MODULE_VALIDATION_FAILED,
                         AXIS2_FAILURE);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Module engage failed for deployment engine");
         return NULL;
     }
-
     return dep_engine->conf;
 }
 
@@ -975,6 +1010,7 @@
     if (!dep_engine->folder_name)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "No memory");
         return AXIS2_FAILURE;
     }
     path_l = axutil_stracat(env, client_home, AXIS2_PATH_SEP_STR);
@@ -988,7 +1024,10 @@
         if (!dep_engine->conf_name)
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CONFIG_NOT_FOUND,
-                            AXIS2_FAILURE) return AXIS2_FAILURE;
+                            AXIS2_FAILURE);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Axis2 Configuration file name cannot be NULL");
+            return AXIS2_FAILURE;
         }
     }
 
@@ -997,6 +1036,8 @@
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CONFIG_NOT_FOUND,
                         AXIS2_FAILURE);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Axis2 Configuration file name not found");
         return AXIS2_FAILURE;
     }
 
@@ -1012,12 +1053,13 @@
     int i = 0;
     axis2_status_t status = AXIS2_FAILURE;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
     if (!dep_engine->module_list)
     {
-        /* there are no modules */
+        /* There are no modules */
+		AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI, 
+            "No modules configured");
         return AXIS2_SUCCESS;
     }
     size = axutil_array_list_size(dep_engine->module_list, env);
@@ -1032,6 +1074,9 @@
             status = axis2_conf_engage_module(dep_engine->conf, env, qname);
             if (AXIS2_SUCCESS != status)
             {
+		        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                    "Engaging module %s to Axis2 Configuration failed", 
+                    axutil_qname_get_localpart(qname, env));
                 return status;
             }
         }
@@ -1050,7 +1095,6 @@
     axis2_char_t *phase2 = NULL;
     axis2_char_t *phase3 = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
     in_phases = axis2_phases_info_get_in_phases(dep_engine->phases_info, env);
@@ -1083,7 +1127,6 @@
     int sizei = 0;
     int i = 0;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, svc_metadata, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -1107,12 +1150,11 @@
 
         svc = (axis2_svc_t *) axutil_array_list_get(svcs, env, i);
 
-        /*axis2_dep_engine_load_svc_props(dep_engine, env, svc); */
         file = axis2_arch_file_data_get_file(dep_engine->curr_file, env);
         file_name = axutil_file_get_name(file, env);
         axis2_svc_set_file_name(svc, env, file_name);
 
-        /* modules from svc group */
+        /* Modules from service group */
         grp_modules = axis2_svc_grp_get_all_module_qnames(svc_metadata, env);
         if (grp_modules)
         {
@@ -1134,7 +1176,7 @@
             }
             else
             {
-                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                                 "Invalid module reference taken from conf");
                 AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MODUELE_REF,
                                 AXIS2_FAILURE);
@@ -1142,7 +1184,7 @@
             }
         }
 
-        /* modules from <service> */
+        /* Modules from <service> */
         list = axis2_svc_get_all_module_qnames(svc, env);
         sizej = axutil_array_list_size(list, env);
         for (j = 0; j < sizej; j++)
@@ -1162,12 +1204,15 @@
                                             dep_engine->conf);
                 if (!status)
                 {
+		            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                        "Engaging module %s to service %s failed", 
+                        axutil_qname_get_localpart(qmodulename, env), file_name);
                     return status;
                 }
             }
             else
             {
-                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                                 "Invalid module reference taken from conf");
                 AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MODUELE_REF,
                                 AXIS2_FAILURE);
@@ -1213,6 +1258,9 @@
                     AXIS2_ERROR_SET(env->error,
                                     AXIS2_ERROR_INVALID_MODUELE_REF_BY_OP,
                                     AXIS2_FAILURE);
+		            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                        "Module %s is not added to the Axis2 Configuration", 
+                        axutil_qname_get_localpart(module_qname, env));
                     return AXIS2_FAILURE;
                 }
             }
@@ -1240,7 +1288,6 @@
     axis2_status_t status = AXIS2_FAILURE;
     axis2_char_t *dll_name = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -1263,9 +1310,11 @@
     if (AXIS2_SUCCESS != status)
     {
         axutil_dll_desc_free(dll_desc, env);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Setting dll path %s to the dll description failed", dll_path);
         return AXIS2_FAILURE;
     }
-    /* free all temp vars */
+    /* Free all temp vars */
     AXIS2_FREE(env->allocator, temp_path);
     temp_path = NULL;
     AXIS2_FREE(env->allocator, dll_path);
@@ -1297,7 +1346,6 @@
     int count = 0;
     int j = 0;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, flow, AXIS2_FAILURE);
 
     count = axis2_flow_get_handler_count(flow, env);
@@ -1333,7 +1381,6 @@
     axis2_handler_t *handler = NULL;
     axis2_char_t *dll_name = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, class_name, NULL);
     AXIS2_PARAM_CHECK (env->error, dep_engine, NULL);
 
@@ -1364,22 +1411,33 @@
     axis2_flow_t *out_fault_flow = NULL;
     axis2_module_t *module = NULL;
     axis2_status_t status = AXIS2_FAILURE;
+    axutil_qname_t *module_qname = NULL;
+    axis2_char_t *module_name = NULL;
 
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
+    module_qname = axis2_module_desc_get_qname(module_metadata, env);
+    module_name = axutil_qname_get_localpart(module_qname, env);
     status = axis2_dep_engine_load_module_dll(dep_engine, env, module_metadata);
     if (AXIS2_SUCCESS != status)
     {
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Loading module description %s failed", module_name);
         return status;
     }
     module = axis2_module_desc_get_module(module_metadata, env);
     if (!module)
     {
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Retrieving module from module description %s failed", module_name);
         return AXIS2_FAILURE;
     }
-    status = AXIS2_MODULE_FILL_HANDLER_CREATE_FUNC_MAP(module, env);
+    status = axis2_module_fill_handler_create_func_map(module, env);
     if (AXIS2_SUCCESS != status)
     {
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Filling handler create function for module map %s failed", 
+            module_name);
         return status;
     }
 
@@ -1430,7 +1488,6 @@
     int size = 0;
     axis2_status_t status = AXIS2_FAILURE;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
     size = axutil_array_list_size(dep_engine->ws_to_deploy, env);
@@ -1473,6 +1530,8 @@
                         dep_engine->curr_file = NULL;
                         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_SVC,
                                         AXIS2_FAILURE);
+		                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                            "Processing service group %s failed", file_name);
                         return status;
                     }
 
@@ -1484,6 +1543,9 @@
                         dep_engine->curr_file = NULL;
                         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_SVC,
                                         AXIS2_FAILURE);
+		                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                            "Adding new service %s to the deployment engine "\
+                            "failed", file_name);
                         return status;
                     }
                     dep_engine->curr_file = NULL;
@@ -1510,6 +1572,8 @@
                         dep_engine->curr_file = NULL;
                         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MODULE,
                                         AXIS2_FAILURE);
+		                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                            "Reading module archive for file %s failed", file_name);
                         return AXIS2_FAILURE;
                     }
                     status = axis2_dep_engine_add_new_module(dep_engine, env,
@@ -1521,6 +1585,9 @@
                         dep_engine->curr_file = NULL;
                         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MODULE,
                                         AXIS2_FAILURE);
+		                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                            "Adding new module %s to the deployment engine failed", 
+                                file_name);
                         return AXIS2_FAILURE;
                     }
                     dep_engine->curr_file = NULL;
@@ -1543,7 +1610,6 @@
     int size = 0;
     axis2_char_t *svc_name = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
     size = axutil_array_list_size(dep_engine->ws_to_undeploy, env);
@@ -1621,7 +1687,6 @@
     const axutil_env_t * env,
     axis2_phases_info_t * phases_info)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, phases_info, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -1630,12 +1695,11 @@
 }
 
 /**
- * This method is used to fill a axisservice object using services.xml ,
- * first it should create
- * an axisservice object using WSDL and then fill that using given servic.xml 
- * and load all the requed
- * class and build the chains , finally add the  servicecontext to EngineContext \
- * and axisservice into EngineConfiguration
+ * This method is used to fill a axis2 service instance using services.xml ,
+ * first it should create an axis service instance and then fill that using 
+ * given service.xml and load all the required class and build the chains , 
+ * finally add the  service context to engine context and axis2 service into 
+ * Engine Configuration.
  */
 AXIS2_EXTERN axis2_svc_t *AXIS2_CALL
 axis2_dep_engine_build_svc(
@@ -1646,7 +1710,6 @@
 {
     axiom_node_t *node = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, file_name, NULL);
     AXIS2_PARAM_CHECK (env->error, dep_engine, NULL);
 
@@ -1664,13 +1727,13 @@
         axis2_desc_builder_build_om(axis2_svc_builder_get_desc_builder
                                     (dep_engine->svc_builder, env), env);
     axis2_svc_builder_populate_svc(dep_engine->svc_builder, env, node);
-    /*axis2_dep_engine_load_svc_props(dep_engine, env, svc); */
 
     return svc;
 }
 
 /**
- * This method can be used to build ModuleDescription for a given module archiev file
+ * This function can be used to build Module Description for a given module 
+ * archieve file.
  */
 AXIS2_EXTERN axis2_module_desc_t *AXIS2_CALL
 axis2_dep_engine_build_module(
@@ -1690,7 +1753,6 @@
     axis2_char_t *file_name = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, module_archive, NULL);
     AXIS2_PARAM_CHECK(env->error, conf, NULL);
     AXIS2_PARAM_CHECK (env->error, dep_engine, NULL);
@@ -1710,17 +1772,21 @@
     if (AXIS2_SUCCESS != status)
     {
         axis2_module_desc_free(module_desc, env);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Reading module archive for file %s failed", file_name);
         return NULL;
     }
     status = axis2_dep_engine_load_module_dll(dep_engine, env, module_desc);
     if (AXIS2_SUCCESS != status)
     {
         axis2_module_desc_free(module_desc, env);
+		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+            "Loading module dll %s failed", file_name);
         return NULL;
     }
 
     module = axis2_module_desc_get_module(module_desc, env);
-    AXIS2_MODULE_FILL_HANDLER_CREATE_FUNC_MAP(module, env);
+    axis2_module_fill_handler_create_func_map(module, env);
 
     in_flow = axis2_module_desc_get_in_flow(module_desc, env);
     if (in_flow)
@@ -1776,7 +1842,6 @@
     const axutil_env_t * env,
     axis2_arch_file_data_t * file_data)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
     if (dep_engine->curr_file)
     {
@@ -1793,7 +1858,6 @@
     const axutil_env_t * env,
     axis2_arch_reader_t * arch_reader)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
     if (dep_engine->arch_reader)
@@ -1811,7 +1875,6 @@
     const axutil_env_t * env,
     axis2_module_builder_t * module_builder)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, module_builder, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -1825,7 +1888,6 @@
     const axutil_env_t * env,
     axis2_svc_builder_t * svc_builder)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, svc_builder, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -1838,7 +1900,6 @@
     const axutil_env_t * env,
     axis2_svc_grp_builder_t * svc_grp_builder)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, svc_grp_builder, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -1852,7 +1913,6 @@
     const axutil_env_t * env,
     struct axis2_desc_builder * desc_builder)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, desc_builder, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 
@@ -1864,7 +1924,6 @@
 	const axis2_dep_engine_t * dep_engine,
     const axutil_env_t * env)
 {
-	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, NULL);
 	return axutil_strdup (env, dep_engine->module_dir);
 }
@@ -1875,7 +1934,6 @@
 	const axutil_env_t * env,
 	const axis2_char_t *module_dir)
 {
-	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 	AXIS2_PARAM_CHECK (env->error, module_dir, AXIS2_FAILURE);
 	dep_engine->module_dir = axutil_strdup (env, module_dir);
@@ -1888,7 +1946,6 @@
     const axis2_dep_engine_t * dep_engine,
     const axutil_env_t * env)
 {
-	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FALSE);
     return dep_engine->file_flag;
 }
@@ -1900,7 +1957,6 @@
 	const axis2_dep_engine_t * dep_engine,
     const axutil_env_t * env)
 {
-	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, NULL);
 	return axutil_strdup (env, dep_engine->svc_dir);
 }
@@ -1911,7 +1967,6 @@
 	const axutil_env_t * env,
 	const axis2_char_t *svc_dir)
 {
-	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
 	AXIS2_PARAM_CHECK (env->error, svc_dir, AXIS2_FAILURE);
 	dep_engine->svc_dir = axutil_strdup (env, svc_dir);
@@ -1928,7 +1983,7 @@
     axutil_param_t *dep_param;
     AXIS2_PARAM_CHECK (env->error, dep_engine, AXIS2_FAILURE);
     flag = dep_engine->file_flag;
-    if (flag == AXIS2_FALSE)
+    if (!flag)
     {
         return AXIS2_SUCCESS;
     }
@@ -1936,9 +1991,13 @@
     {
         conf = dep_engine->conf;
         if (!conf)
+        {
+		    AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                "Axis2 Configuration cannot be NULL");
             return AXIS2_FAILURE;
+        }
 
-        dep_param = axis2_conf_get_param (conf, env, "moduleDir");
+        dep_param = axis2_conf_get_param (conf, env, AXIS2_MODULE_DIR);
         if (dep_param)
         {
             dirpath = (axis2_char_t *)axutil_param_get_value(dep_param, env);
@@ -1950,7 +2009,7 @@
         }
         dep_param = NULL;
 
-        dep_param = axis2_conf_get_param (conf, env, "servicesDir");
+        dep_param = axis2_conf_get_param (conf, env, AXIS2_SERVICE_DIR);
         if (dep_param)
         {
             dirpath = (axis2_char_t *)axutil_param_get_value(dep_param, env);

Modified: webservices/axis2/trunk/c/src/core/deployment/desc_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/desc_builder.c?rev=638770&r1=638769&r2=638770&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/desc_builder.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/desc_builder.c Wed Mar 19 03:01:48 2008
@@ -47,8 +47,6 @@
 {
     axis2_desc_builder_t *desc_builder = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
-
     desc_builder = (axis2_desc_builder_t *) AXIS2_MALLOC(env->
                                                          allocator,
                                                          sizeof
@@ -57,6 +55,8 @@
     if (!desc_builder)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "No memory. Cannot allocate memory to desc_builder");
         return NULL;
     }
     desc_builder->file_name = NULL;
@@ -74,7 +74,6 @@
 {
     axis2_desc_builder_t *desc_builder = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, file_name, NULL);
     AXIS2_PARAM_CHECK(env->error, engine, NULL);
 
@@ -82,6 +81,8 @@
     if (!desc_builder)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "No memory. Cannot allocate memory to desc_builder");
         return NULL;
     }
 
@@ -91,6 +92,8 @@
     if (!desc_builder->file_name)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "No memory. Cannot allocate memory to desc_builder->file_name");
         return NULL;
     }
     desc_builder->engine = engine;
@@ -105,13 +108,14 @@
 {
     axis2_desc_builder_t *desc_builder = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, engine, NULL);
 
     desc_builder = (axis2_desc_builder_t *) axis2_desc_builder_create(env);
     if (!desc_builder)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "No memory. Cannot allocate memory to desc_builder");
         return NULL;
     }
 
@@ -125,8 +129,6 @@
     axis2_desc_builder_t * desc_builder,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, void);
-
     if (desc_builder->file_name)
     {
         AXIS2_FREE(env->allocator, desc_builder->file_name);
@@ -156,12 +158,12 @@
     axiom_document_t *document = NULL;
     axiom_node_t *root = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
-
     if (!desc_builder->file_name)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_DESC_BUILDER,
                         AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Invalid state desc builder. Unable to continue");
         return NULL;
     }
 
@@ -173,6 +175,8 @@
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CREATING_XML_STREAM_READER,
                         AXIS2_FAILURE) return NULL;
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Could not create xml reader for %s", desc_builder->file_name);
     }
 
     /** create axiom_stax_builder by parsing pull_parser struct */
@@ -182,6 +186,9 @@
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CREATING_XML_STREAM_READER,
                         AXIS2_FAILURE) return NULL;
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Could not create xml stream reader for desc builder %s. Unable "\
+                "to continue", desc_builder->file_name);
     }
 
     /**
@@ -215,7 +222,6 @@
     axiom_children_qname_iterator_t *handlers = NULL;
     axutil_qname_t *qchild = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, parent, NULL);
     AXIS2_PARAM_CHECK(env->error, flow_node, NULL);
 
@@ -223,11 +229,15 @@
     if (!flow)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "No memory. Could not allocate to flow");
         return NULL;
     }
 
     if (!flow_element)
     {
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+            "There is no flow element to process");
         return NULL;
     }
 
@@ -239,7 +249,7 @@
         axutil_qname_free(qchild, env);
     }
 
-    while (AXIS2_TRUE == axiom_children_qname_iterator_has_next(handlers, env))
+    while (axiom_children_qname_iterator_has_next(handlers, env))
     {
         axiom_node_t *handler_node = NULL;
         axis2_handler_desc_t *handler_desc = NULL;
@@ -251,13 +261,18 @@
         handler_desc = axis2_desc_builder_process_handler(desc_builder, env,
                                                           handler_node, parent);
         status = axis2_flow_add_handler(flow, env, handler_desc);
-        if (AXIS2_SUCCESS != status)
+        if (!status)
         {
+            const axutil_string_t *handler_name = NULL;
+            const axis2_char_t *hname = NULL;
+            handler_name = axis2_handler_desc_get_name(handler_desc, env);
+            hname = axutil_string_get_buffer(handler_name, env);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Adding handler %s to flow failed", hname);
             axis2_flow_free(flow, env);
             return NULL;
         }
     }
-
     return flow;
 }
 
@@ -279,14 +294,17 @@
     axiom_node_t *order_node = NULL;
     axiom_element_t *order_element = NULL;
     axutil_qname_t *order_qname = NULL;
+    axutil_string_t *handler_name = NULL;
+    const axis2_char_t *hname = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, handler_node, NULL);
     AXIS2_PARAM_CHECK(env->error, parent, NULL);
 
     handler_desc = axis2_handler_desc_create(env, NULL);
     if (!handler_desc)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Could not create handler description");
         return NULL;
     }
     /* Setting Handler name */
@@ -303,11 +321,12 @@
         axis2_handler_desc_free(handler_desc, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
                         AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Name attribute not fould for handler.");
         return NULL;
     }
     else
     {
-        axutil_string_t *handler_name = NULL;
         axis2_char_t *value = NULL;
 
         value = axiom_attribute_get_value(name_attrib, env);
@@ -318,13 +337,16 @@
             axutil_string_free(handler_name, env);
         }
 
-        if (AXIS2_SUCCESS != status)
+        if (!status)
         {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Setting name for handler description failed in %s", 
+                    desc_builder->file_name);
             axis2_handler_desc_free(handler_desc, env);
             return NULL;
         }
     }
-
+    hname = axutil_string_get_buffer(handler_name, env);
     /*Setting Handler Class name */
     class_qname = axutil_qname_create(env, AXIS2_CLASSNAME, NULL, NULL);
     class_attrib = axiom_element_get_attribute(handler_element, env,
@@ -339,6 +361,8 @@
         axis2_handler_desc_free(handler_desc, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
                         AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Library name attribute not found for handler %s", hname);
         return NULL;
     }
     else
@@ -365,6 +389,8 @@
         axis2_handler_desc_free(handler_desc, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
                         AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Order node not found for handler description %s", hname);
         return NULL;
     }
     else
@@ -377,6 +403,9 @@
         order_itr = axiom_element_get_all_attributes(order_element, env);
         if (!order_itr)
         {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Order element for handler desc %s does not contain any "\
+                "attribute", hname);
             axis2_handler_desc_free(handler_desc, env);
             return NULL;
         }
@@ -397,61 +426,73 @@
             name = axutil_qname_get_localpart(qname, env);
 
             value = axiom_attribute_get_value(order_attrib, env);
-            if (0 == axutil_strcmp(AXIS2_AFTER, name))
+            if (!axutil_strcmp(AXIS2_AFTER, name))
             {
                 struct axis2_phase_rule *phase_rule = NULL;
 
                 phase_rule = axis2_handler_desc_get_rules(handler_desc, env);
                 status = axis2_phase_rule_set_after(phase_rule, env, value);
-                if (AXIS2_SUCCESS != status)
+                if (!status)
                 {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                        "Setting %s phase rule failed for handler %s", 
+                            AXIS2_AFTER, hname);
                     axis2_handler_desc_free(handler_desc, env);
                     return NULL;
                 }
             }
-            if (0 == axutil_strcmp(AXIS2_BEFORE, name))
+            if (!axutil_strcmp(AXIS2_BEFORE, name))
             {
                 struct axis2_phase_rule *phase_rule = NULL;
                 phase_rule = axis2_handler_desc_get_rules(handler_desc, env);
                 status = axis2_phase_rule_set_before(phase_rule, env, value);
-                if (AXIS2_SUCCESS != status)
+                if (!status)
                 {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                        "Setting %s phase rule failed for handler %s", 
+                            AXIS2_BEFORE, hname);
                     axis2_handler_desc_free(handler_desc, env);
                     return NULL;
                 }
             }
-            if (0 == axutil_strcmp(AXIS2_PHASE, name))
+            if (!axutil_strcmp(AXIS2_PHASE, name))
             {
                 struct axis2_phase_rule *phase_rule = NULL;
                 phase_rule = axis2_handler_desc_get_rules(handler_desc, env);
                 status = axis2_phase_rule_set_name(phase_rule, env, value);
-                if (AXIS2_SUCCESS != status)
+                if (!status)
                 {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                        "Setting phase rule name failed for handler %s", 
+                            hname);
                     axis2_handler_desc_free(handler_desc, env);
                     return NULL;
                 }
             }
-            if (0 == axutil_strcmp(AXIS2_PHASEFIRST, name))
+            if (!axutil_strcmp(AXIS2_PHASEFIRST, name))
             {
                 axis2_char_t *bool_val = NULL;
 
                 bool_val = axis2_desc_builder_get_value(desc_builder, env,
                                                         value);
-                if (0 == axutil_strcmp(bool_val, "true"))
+                if (!axutil_strcmp(bool_val, AXIS2_VALUE_TRUE))
                 {
                     struct axis2_phase_rule *phase_rule = NULL;
                     phase_rule =
                         axis2_handler_desc_get_rules(handler_desc, env);
                     status =
                         axis2_phase_rule_set_first(phase_rule, env, AXIS2_TRUE);
-                    if (AXIS2_SUCCESS != status)
+                    if (!status)
                     {
+                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                            "Setting %s property for phase rules for handler "\
+                            "%s failed", AXIS2_PHASEFIRST, hname);
                         axis2_handler_desc_free(handler_desc, env);
                         AXIS2_FREE(env->allocator, bool_val);
                         return NULL;
                     }
                 }
-                else if (0 == axutil_strcmp(bool_val, "false"))
+                else if (!axutil_strcmp(bool_val, AXIS2_VALUE_FALSE))
                 {
                     struct axis2_phase_rule *phase_rule = NULL;
                     phase_rule =
@@ -459,8 +500,11 @@
                     status =
                         axis2_phase_rule_set_first(phase_rule, env,
                                                    AXIS2_FALSE);
-                    if (AXIS2_SUCCESS != status)
+                    if (!status)
                     {
+                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                            "Setting %s property for phase rules for handler "\
+                            "%s failed", AXIS2_PHASEFIRST, hname);
                         axis2_handler_desc_free(handler_desc, env);
                         AXIS2_FREE(env->allocator, bool_val);
                         return NULL;
@@ -477,18 +521,22 @@
                                                        handler_node);
         axutil_qname_free(param_qname, env);
         status = axis2_desc_builder_process_params(desc_builder, env, params,
-                                                   axis2_handler_desc_get_param_container
-                                                   (handler_desc, env), parent);
-        if (AXIS2_SUCCESS != status)
+                                       axis2_handler_desc_get_param_container
+                                       (handler_desc, env), parent);
+        if (!status)
         {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Processing params failed for handler %s", hname);
             axis2_handler_desc_free(handler_desc, env);
             return NULL;
         }
     }
 
     status = axis2_handler_desc_set_parent(handler_desc, env, parent);
-    if (AXIS2_SUCCESS != status)
+    if (!status)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Setting parent failed for handler %s", hname);
         axis2_handler_desc_free(handler_desc, env);
         return NULL;
     }
@@ -507,7 +555,6 @@
     axutil_hash_t *attrs = NULL;
     axiom_child_element_iterator_t *childs = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, param, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, param_element, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, param_node, AXIS2_FAILURE);
@@ -529,6 +576,8 @@
             axutil_hash_this(i, NULL, NULL, &v);
             if (!v)
             {
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                    "Attibute missing in the parameter element");
                 axutil_param_free(param, env);
                 return AXIS2_FAILURE;
             }
@@ -538,6 +587,7 @@
                 axutil_param_free(param, env);
                 AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY,
                                 AXIS2_FAILURE);
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
                 return AXIS2_FAILURE;
             }
             value = (axiom_attribute_t *) v;
@@ -559,7 +609,7 @@
         value_list = axutil_array_list_create(env, 0);
         axutil_param_set_value_list(param, env, value_list);
 
-        while (AXIS2_TRUE == AXIOM_CHILD_ELEMENT_ITERATOR_HAS_NEXT(childs, env))
+        while (AXIOM_CHILD_ELEMENT_ITERATOR_HAS_NEXT(childs, env))
         {
             axiom_node_t *node = NULL;
             axiom_element_t *element = NULL;
@@ -571,8 +621,10 @@
             param = axutil_param_create(env, NULL, NULL);
             pname = axiom_element_get_localname(element, env);
             status = axutil_param_set_name(param, env, pname);
-            if (AXIS2_SUCCESS != status)
+            if (!status)
             {
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                    "Setting name to parameter failed");
                 axutil_param_free(param, env);
                 return status;
             }
@@ -589,8 +641,10 @@
         temp = axiom_element_get_text(param_element, env, param_node);
         para_test_value = axutil_strdup(env, temp);
         status = axutil_param_set_value(param, env, para_test_value);
-        if (AXIS2_SUCCESS != status)
+        if (!status)
         {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Setting value to parameter failed");
             axutil_param_free(param, env);
             AXIS2_FREE(env->allocator, para_test_value);
             return status;
@@ -614,7 +668,6 @@
     axiom_element_t *rest_element = NULL;
     axiom_children_qname_iterator_t *rest_mappings = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, op_desc, AXIS2_FAILURE);
 
     op_element = axiom_node_get_data_element(op_node, env);
@@ -635,14 +688,14 @@
             axiom_children_qname_iterator_next(rest_mappings, env);
         rest_element = axiom_node_get_data_element(rest_node, env);
         param_value = axiom_element_get_attribute_value(rest_element, env, qname);
-        if (0 == strcmp(param_value, AXIS2_REST_HTTP_METHOD))
+        if (!strcmp(param_value, AXIS2_REST_HTTP_METHOD))
         {
             axis2_op_set_rest_http_method(op_desc, env,
                                           axiom_element_get_text(rest_element,
                                                                  env, rest_node));
         }
         param_value = axiom_element_get_attribute_value(rest_element, env, qname);
-        if (0 == strcmp(param_value, AXIS2_REST_HTTP_LOCATION))
+        if (!strcmp(param_value, AXIS2_REST_HTTP_LOCATION))
         {
             axis2_op_set_rest_http_location(op_desc, env,
                                             axiom_element_get_text(rest_element,
@@ -679,7 +732,6 @@
     axutil_qname_t *qname = NULL;
     axiom_children_qname_iterator_t *action_mappings = NULL;
     axutil_array_list_t *mapping_list = axutil_array_list_create(env, 0);
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, op_desc, AXIS2_FAILURE);
 
     op_element = axiom_node_get_data_element(op_node, env);
@@ -718,14 +770,14 @@
         input_action_string = axutil_strtrim(env, temp_str, NULL);
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Input action mapping found %s",
                         input_action_string);
-        if (0 != axutil_strcmp("", input_action_string))
+        if (axutil_strcmp("", input_action_string))
         {
             axutil_array_list_add(mapping_list, env, input_action_string);
         }
         else
         {
             AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Zero length "
-                            "input_action_string found. Not added to the mapping list");
+                "input_action_string found. Not added to the mapping list");
         }
     }
     axis2_op_set_wsamapping_list(op_desc, env, mapping_list);
@@ -742,11 +794,10 @@
 {
     axis2_status_t status = AXIS2_FAILURE;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, params, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, param_container, AXIS2_FAILURE);
 
-    while (AXIS2_FALSE != axiom_children_qname_iterator_has_next(params, env))
+    while (axiom_children_qname_iterator_has_next(params, env))
     {
         axiom_element_t *param_element = NULL;
         axiom_node_t *param_node = NULL;
@@ -772,13 +823,17 @@
         axutil_qname_free(att_qname, env);
         if (!para_name)
         {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Parameter name attribute not found for parameter");
             axutil_param_free(param, env);
             return AXIS2_FAILURE;
         }
         pname = axiom_attribute_get_value(para_name, env);
         status = axutil_param_set_name(param, env, pname);
-        if (AXIS2_SUCCESS != status)
+        if (!status)
         {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Could not set parameter name for parameter");
             axutil_param_free(param, env);
             return status;
         }
@@ -803,7 +858,7 @@
         {
             axis2_char_t *locked_value = NULL;
             locked_value = axiom_attribute_get_value(para_locked, env);
-            if (0 == axutil_strcmp("true", locked_value))
+            if (!axutil_strcmp(AXIS2_VALUE_TRUE, locked_value))
             {
                 axis2_char_t *param_name = NULL;
                 axis2_bool_t is_param_locked = AXIS2_FALSE;
@@ -814,12 +869,14 @@
                 is_param_locked = axutil_param_container_is_param_locked(parent,
                                                                          env,
                                                                          param_name);
-                if (parent && AXIS2_TRUE == is_param_locked)
+                if (parent && is_param_locked)
                 {
                     axutil_param_free(param, env);
                     AXIS2_ERROR_SET(env->error,
                                     AXIS2_ERROR_CONFIG_NOT_FOUND,
                                     AXIS2_FAILURE);
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                        "Parameter %s is locked", param_name);
                     return AXIS2_FAILURE;
                 }
                 else
@@ -840,12 +897,14 @@
 
             name = axutil_param_get_name(param, env);
             bvalue = axutil_param_container_is_param_locked(parent, env, name);
-            if (parent_para || AXIS2_FALSE == bvalue)
+            if (parent_para || !bvalue)
             {
                 status = axutil_param_container_add_param(param_container, env,
                                                           param);
-                if (AXIS2_SUCCESS != status)
+                if (!status)
                 {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                        "Adding parameter %s failed", name);
                     axutil_param_free(param, env);
                     return status;
                 }
@@ -855,8 +914,10 @@
         {
             status = axutil_param_container_add_param(param_container, env,
                                                       param);
-            if (AXIS2_SUCCESS != status)
+            if (!status)
             {
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                    "Adding parameter %s failed", pname);
                 axutil_param_free(param, env);
                 return status;
             }
@@ -877,12 +938,10 @@
     axutil_qname_t *qref = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, op, AXIS2_FAILURE);
 
     while (module_refs &&
-           AXIS2_TRUE == axiom_children_qname_iterator_has_next(module_refs,
-                                                                env))
+           axiom_children_qname_iterator_has_next(module_refs, env))
     {
         moduleref = (axiom_element_t *)
             axiom_children_qname_iterator_next(module_refs, env);
@@ -904,16 +963,22 @@
                 axutil_qname_free(ref_qname, env);
                 AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MODULE_NOT_FOUND,
                                 AXIS2_FAILURE);
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                    "Module %s not found in the deployment engine", ref_name);
                 return AXIS2_FAILURE;
             }
             else
             {
                 status = axis2_op_add_module_qname(op, env, ref_qname);
                 axutil_qname_free(ref_qname, env);
-                if (AXIS2_SUCCESS != status)
+                if (!status)
                 {
                     AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MODULE_NOT_FOUND,
                                     AXIS2_FAILURE);
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                        "Adding module ref %s to operation %s failed", ref_name, 
+                        axutil_qname_get_localpart(axis2_op_get_qname(op, env), 
+                            env));
                     return AXIS2_FAILURE;
                 }
             }
@@ -942,7 +1007,6 @@
     axis2_conf_t *conf = NULL;
     axis2_char_t *msg_recv_dll_name = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, recv_element, NULL);
 
     class_qname = axutil_qname_create(env, AXIS2_CLASSNAME, NULL, NULL);
@@ -953,6 +1017,8 @@
     conf = axis2_dep_engine_get_axis_conf(desc_builder->engine, env);
     if (!conf)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Configuration not found in the deployment engine");
         return NULL;
     }
     impl_info_param = axis2_conf_get_param(conf, env, class_name);
@@ -1011,13 +1077,13 @@
     axis2_char_t *file_name_l = NULL;
     axis2_char_t *short_name = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, file_name, NULL);
 
     file_name_l = axutil_strdup(env, file_name);
     if (!file_name_l)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "");
         return NULL;
     }
     separator = ".";
@@ -1039,12 +1105,12 @@
     axis2_char_t *file_name_l = NULL;
     axis2_char_t *short_name = NULL;
     int len = 0;
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, short_file_name, NULL);
     file_name_l = axutil_strdup(env, short_file_name);
     if (!file_name_l)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "");
         return NULL;
     }
     len = axutil_strlen(AXIS2_LIB_PREFIX);
@@ -1063,13 +1129,13 @@
     axis2_char_t *value = NULL;
     axis2_char_t *in_l = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, in, NULL);
 
     in_l = axutil_strdup(env, in);
     if (!in_l)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "");
         return NULL;
     }
     value = axutil_strstr(in_l, separator);
@@ -1106,6 +1172,7 @@
             policy = neethi_engine_get_policy(env, node, element);
             if (!policy)
             {
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "");
                 return AXIS2_FAILURE;
             }
             axis2_policy_include_add_policy_element(policy_include, env,
@@ -1141,3 +1208,4 @@
     }
     return AXIS2_SUCCESS;
 }
+

Modified: webservices/axis2/trunk/c/src/core/deployment/module_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/module_builder.c?rev=638770&r1=638769&r2=638770&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/module_builder.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/module_builder.c Wed Mar 19 03:01:48 2008
@@ -36,15 +36,14 @@
 {
     axis2_module_builder_t *module_builder = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
-
     module_builder = (axis2_module_builder_t *) AXIS2_MALLOC(env->allocator,
-                                                             sizeof
-                                                             (axis2_module_builder_t));
+        sizeof(axis2_module_builder_t));
 
     if (!module_builder)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "No memory to create module builder");
         return NULL;
     }
 
@@ -60,13 +59,13 @@
 {
     axis2_module_builder_t *module_builder = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
-
     module_builder =
         (axis2_module_builder_t *) axis2_module_builder_create(env);
     if (!module_builder)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "No memory to create module builder %s", file_name);
         return NULL;
     }
     module_builder->desc_builder =
@@ -74,6 +73,9 @@
                                                            dep_engine);
     if (!module_builder->desc_builder)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Description builder creation failed for module builder %s", 
+                file_name);
         axis2_module_builder_free(module_builder, env);
         return NULL;
     }
@@ -86,8 +88,6 @@
     axis2_module_builder_t * module_builder,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, void);
-
     if (module_builder->desc_builder)
     {
         axis2_desc_builder_free(module_builder->desc_builder, env);
@@ -131,41 +131,37 @@
     axutil_param_container_t *parent_container = NULL;
     int size = 0;
     int i = 0;
+    axis2_arch_file_data_t *file_data = NULL;
+    axis2_char_t *module_name = NULL;
+    axutil_qname_t *module_qname = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
-                    "axis2_module_builder_populate_module start");
-
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+                    "Entry:axis2_module_builder_populate_module");
 
     module_node =
         axis2_desc_builder_build_om(module_builder->desc_builder, env);
     module_element = axiom_node_get_data_element(module_node, env);
     if (!module_element)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Data element not found for the module node, Unable to proceed");
         return AXIS2_FAILURE;
     }
-    {
-        axis2_arch_file_data_t *file_data = NULL;
-        axis2_char_t *module_name = NULL;
-        axutil_qname_t *module_qname = NULL;
-
-        file_data =
-            axis2_dep_engine_get_current_file_item
-            (axis2_desc_builder_get_dep_engine
-             (module_builder->desc_builder, env), env);
-        module_name = axis2_arch_file_data_get_module_name(file_data, env);
-
-        module_qname = axutil_qname_create(env, module_name, NULL, NULL);
-        axis2_module_desc_set_qname(module_builder->module_desc, env,
-                                    module_qname);
+    file_data =
+        axis2_dep_engine_get_current_file_item
+        (axis2_desc_builder_get_dep_engine
+         (module_builder->desc_builder, env), env);
+    module_name = axis2_arch_file_data_get_module_name(file_data, env);
+
+    module_qname = axutil_qname_create(env, module_name, NULL, NULL);
+    axis2_module_desc_set_qname(module_builder->module_desc, env,
+                                module_qname);
 
-        if (module_qname)
-        {
-            axutil_qname_free(module_qname, env);
-        }
+    if (module_qname)
+    {
+        axutil_qname_free(module_qname, env);
     }
-
     /* Setting Module Dll Name , if it is there */
 
     qdllname = axutil_qname_create(env, AXIS2_CLASSNAME, NULL, NULL);
@@ -180,7 +176,7 @@
         axis2_char_t *class_name = NULL;
 
         class_name = axiom_attribute_get_value(module_dll_att, env);
-        if (class_name && (0 != axutil_strcmp("", class_name)))
+        if (class_name && (axutil_strcmp("", class_name)))
         {
             axis2_dep_engine_t *dep_engine =
                 axis2_desc_builder_get_dep_engine(module_builder->desc_builder,
@@ -230,7 +226,7 @@
         axutil_qname_free(qinflowst, env);
     }
 
-    if (in_flow_element && NULL != in_flow_node)
+    if (in_flow_element && in_flow_node)
     {
         axis2_flow_t *flow = NULL;
 
@@ -243,12 +239,14 @@
             axis2_module_desc_set_in_flow(module_builder->module_desc, env,
                                           flow);
 
-        if (AXIS2_SUCCESS != status)
+        if (!status)
         {
             if (flow)
             {
                 axis2_flow_free(flow, env);
             }
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Setting in flow failed for module desc %s", module_name);
             return status;
         }
     }
@@ -263,7 +261,7 @@
         axutil_qname_free(qoutflowst, env);
     }
 
-    if (out_flow_element && NULL != out_flow_node)
+    if (out_flow_element && out_flow_node)
     {
         axis2_flow_t *flow = NULL;
 
@@ -276,9 +274,11 @@
             axis2_module_desc_set_out_flow(module_builder->module_desc, env,
                                            flow);
 
-        if (AXIS2_SUCCESS != status)
+        if (!status)
         {
             axis2_flow_free(flow, env);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Setting out flow failed for module desc %s", module_name);
             return status;
         }
     }
@@ -306,9 +306,11 @@
             axis2_module_desc_set_fault_in_flow(module_builder->module_desc,
                                                 env, flow);
 
-        if (AXIS2_SUCCESS != status)
+        if (!status)
         {
             axis2_flow_free(flow, env);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Setting fault in flow failed for module desc %s", module_name);
             return status;
         }
     }
@@ -338,6 +340,8 @@
         if (AXIS2_SUCCESS != status)
         {
             axis2_flow_free(flow, env);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Setting fault out flow failed for module desc %s", module_name);
             return status;
         }
     }
@@ -361,7 +365,7 @@
     }
     axutil_array_list_free(ops, env);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
-                    "axis2_module_builder_populate_module end");
+                    "Exit:axis2_module_builder_populate_module");
     return AXIS2_SUCCESS;
 }
 
@@ -373,11 +377,10 @@
 {
     axutil_array_list_t *ops = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, op_itr, NULL);
 
     ops = axutil_array_list_create(env, 0);
-    while (AXIS2_TRUE == axiom_children_qname_iterator_has_next(op_itr, env))
+    while (axiom_children_qname_iterator_has_next(op_itr, env))
     {
         axiom_element_t *op_element = NULL;
         axiom_node_t *op_node = NULL;
@@ -413,6 +416,8 @@
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_OP_NAME_MISSING,
                             AXIS2_FAILURE);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Operation name missing for module operation.");
             return NULL;
         }
         qmep = axutil_qname_create(env, AXIS2_MEP, NULL, NULL);
@@ -517,3 +522,4 @@
     }
     return ops;
 }
+

Modified: webservices/axis2/trunk/c/src/core/deployment/svc_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/svc_builder.c?rev=638770&r1=638769&r2=638770&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/svc_builder.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/svc_builder.c Wed Mar 19 03:01:48 2008
@@ -45,8 +45,6 @@
 {
     axis2_svc_builder_t *svc_builder = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
-
     svc_builder = (axis2_svc_builder_t *) AXIS2_MALLOC(env->allocator,
                                                        sizeof
                                                        (axis2_svc_builder_t));
@@ -54,6 +52,8 @@
     if (!svc_builder)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "No memory. Allocation to svc_builder failed");
         return NULL;
     }
 
@@ -72,7 +72,6 @@
 {
     axis2_svc_builder_t *svc_builder = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, file_name, NULL);
     AXIS2_PARAM_CHECK(env->error, dep_engine, NULL);
     AXIS2_PARAM_CHECK(env->error, svc, NULL);
@@ -87,6 +86,9 @@
     if (!svc_builder->desc_builder)
     {
         axis2_svc_builder_free(svc_builder, env);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Creating description builder for service builder %s failed", 
+            file_name);
         return NULL;
     }
     svc_builder->svc = svc;
@@ -101,7 +103,6 @@
 {
     axis2_svc_builder_t *svc_builder = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, dep_engine, NULL);
     AXIS2_PARAM_CHECK(env->error, svc, NULL);
     svc_builder = (axis2_svc_builder_t *) axis2_svc_builder_create(env);
@@ -114,6 +115,8 @@
     if (!svc_builder->desc_builder)
     {
         axis2_svc_builder_free(svc_builder, env);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Creating description builder for service builder failed");
         return NULL;
     }
     svc_builder->svc = svc;
@@ -125,9 +128,6 @@
     axis2_svc_builder_t * svc_builder,
     const axutil_env_t * env)
 {
-
-    AXIS2_ENV_CHECK(env, void);
-
     if (svc_builder->desc_builder)
     {
         axis2_desc_builder_free(svc_builder->desc_builder, env);
@@ -198,7 +198,6 @@
     axutil_array_list_t *svc_module_qnames = NULL;
     int svc_module_qname_size = 0;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, svc_node, AXIS2_FAILURE);
 
     svc_element = axiom_node_get_data_element(svc_node, env);
@@ -207,6 +206,7 @@
     if (!qparamst)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return AXIS2_FAILURE;
     }
     itr = axiom_element_get_children_with_qname(svc_element, env, qparamst,
@@ -227,6 +227,8 @@
                                                (parent, env));
     if (AXIS2_SUCCESS != status)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Processing parameters failed");
         return status;
     }
 
@@ -286,6 +288,8 @@
     if (!impl_info_param)
     {
         axutil_dll_desc_free(dll_desc, env);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "%s parameter not found", AXIS2_SERVICE_CLASS);
         return AXIS2_FAILURE;
     }
     class_name = axutil_strtrim(env, 
@@ -316,6 +320,8 @@
     if (AXIS2_SUCCESS != status)
     {
         axutil_dll_desc_free(dll_desc, env);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Setting name to  %s dll description failed", dll_path);
         return status;
     }
     AXIS2_FREE(env->allocator, dll_path);
@@ -328,6 +334,8 @@
     if (AXIS2_SUCCESS != status)
     {
         axutil_dll_desc_free(dll_desc, env);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Setting dll_desc to parameter %s failed", class_name);
         return status;
     }
     /* processing service wide modules which required to engage globally */
@@ -340,6 +348,8 @@
         axis2_svc_builder_process_module_refs(svc_builder, env, module_refs);
     if (AXIS2_SUCCESS != status)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Processing module references failed");
         return status;
     }
     
@@ -492,7 +502,6 @@
 {
     axutil_array_list_t *ops = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, op_itr, NULL);
 
     ops = axutil_array_list_create(env, 0);
@@ -534,6 +543,7 @@
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_OP_NAME_MISSING,
                             AXIS2_FAILURE);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "");
             return NULL;
         }
 
@@ -618,6 +628,9 @@
                                                            module_itr, op_desc);
         if (AXIS2_SUCCESS != status)
         {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Processing module operation references failed for operation %s", 
+                op_name);
             return NULL;
         }
 
@@ -689,7 +702,7 @@
     axiom_children_qname_iterator_t * iterator,
     axis2_op_t * op)
 {
-    while (AXIS2_TRUE == axiom_children_qname_iterator_has_next(iterator, env))
+    while (axiom_children_qname_iterator_has_next(iterator, env))
     {
         axiom_node_t *node = NULL;
         axiom_element_t *element = NULL;
@@ -783,8 +796,7 @@
     axutil_param_container_t * parent,
     axis2_svc_t * svc)
 {
-    while (AXIS2_TRUE ==
-           axiom_children_qname_iterator_has_next(module_confs, env))
+    while (axiom_children_qname_iterator_has_next(module_confs, env))
     {
         axiom_element_t *module_conf_element = NULL;
         axiom_node_t *module_conf_node = NULL;
@@ -804,6 +816,8 @@
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MODULE_CONF,
                             AXIS2_FAILURE);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Module name attribute not found for module node");
             return AXIS2_FAILURE;
         }
     }
@@ -816,11 +830,9 @@
     const axutil_env_t * env,
     axiom_children_qname_iterator_t * module_refs)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, module_refs, AXIS2_FAILURE);
 
-    while (AXIS2_TRUE ==
-           axiom_children_qname_iterator_has_next(module_refs, env))
+    while (axiom_children_qname_iterator_has_next(module_refs, env))
     {
         axiom_element_t *module_ref_element = NULL;
         axiom_node_t *module_ref_node = NULL;
@@ -868,3 +880,4 @@
 {
     return svc_builder->desc_builder;
 }
+

Modified: webservices/axis2/trunk/c/src/core/description/module_desc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/description/module_desc.c?rev=638770&r1=638769&r2=638770&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/description/module_desc.c (original)
+++ webservices/axis2/trunk/c/src/core/description/module_desc.c Wed Mar 19 03:01:48 2008
@@ -126,7 +126,7 @@
 
     if (module_desc->module)
     {
-        AXIS2_MODULE_SHUTDOWN(module_desc->module, env);
+        axis2_module_shutdown(module_desc->module, env);
     }
 
     if (module_desc->params)



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