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 na...@apache.org on 2009/12/17 07:43:57 UTC

svn commit: r891558 - /webservices/axis2/trunk/c/src/core/deployment/conf_init.c

Author: nandika
Date: Thu Dec 17 06:43:56 2009
New Revision: 891558

URL: http://svn.apache.org/viewvc?rev=891558&view=rev
Log:
build_conf_ctx_with_file function bug fixed

Modified:
    webservices/axis2/trunk/c/src/core/deployment/conf_init.c

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=891558&r1=891557&r2=891558&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/conf_init.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/conf_init.c Thu Dec 17 06:43:56 2009
@@ -121,9 +121,32 @@
 {
     axis2_conf_ctx_t *conf_ctx = NULL;
     axis2_dep_engine_t *dep_engine = NULL;
-
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_build_conf_ctx_with_file");
-    dep_engine = axis2_dep_engine_create_with_axis2_xml(env, file);
+	axis2_char_t *repos_path = NULL;
+	axis2_char_t *temp_path = NULL;
+	axis2_char_t *index = NULL;
+	axis2_char_t *xmlfile = NULL;
+	
+	AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_build_conf_ctx_with_file");
+	temp_path = axutil_strdup(env, file);
+	index = axutil_rindex(temp_path, AXIS2_PATH_SEP_CHAR);
+	if(!index)
+	{/* searching from windows specific path seperator */
+		index = axutil_rindex(temp_path, '\\');
+	}
+
+	if(!index)
+	{
+		/** only the xml file name is provided. Assume the default repo path */
+		repos_path = AXIS2_GETENV("AXIS2C_HOME");
+		xmlfile = file;
+	}else
+	{
+		xmlfile = index+1;
+		temp_path[index-temp_path] = '\0';
+		repos_path = temp_path;
+	}
+	
+	dep_engine = axis2_dep_engine_create_with_repos_name_and_svr_xml_file(env, repos_path, xmlfile);
     if(!dep_engine)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
@@ -139,7 +162,7 @@
             "Loading configuration context failed for given Axis2 configuration %s.", file);
         return NULL;
     }
-
+	AXIS2_FREE(env->allocator, temp_path);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_build_conf_ctx_with_file");
     return conf_ctx;
 }