You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Krankurs Leonid <lk...@ford.com> on 2006/10/14 19:34:37 UTC

Axis2c, 0.94, error processing

Hi, 

Could you please clarify Axis2c, 0.94 error processing behavior in the
following scenario:


axis2_allocator_t* allocator = axis2_allocator_init (NULL);
axis2_error_t* error = axis2_error_create(allocator);
axis2_env_t* env = axis2_env_create_with_error(allocator, error); 

axis2_char_t* t = NULL;
axis2_char_t* url_str[3] = 
{ 
	"",
	"123",
	"http:",
}; 


for ( int i = 0; i < 3; ++i )
{
	if ( NULL == url[i] ) 
	{ 
		AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM);
		AXIS2_ERROR_SET_STATUS_CODE(error, (axis2_status_codes_t)AXIS2_FAILURE);
	} 
	else 
	{ 
		AXIS2_ERROR_SET_STATUS_CODE(error, (axis2_status_codes_t)AXIS2_SUCCESS);
	} 

	if ( AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(error) )
	{	
		 t = (axis2_char_t*)AXIS2_ERROR_GET_MESSAGE(env->error);
		 t = (axis2_char_t*) env->error->ops->get_extended_message(env->error);
	}
}


in the case of AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(error)

both calls
	AXIS2_ERROR_GET_MESSAGE(env->error)
	env->error->ops->get_extended_message(env->error)
return NULL

what is wrong?


Thank you,
Leonid

-- 
View this message in context: http://www.nabble.com/Axis2c%2C-0.94%2C-error-processing-tf2443488.html#a6812858
Sent from the Axis - C++ - User mailing list archive at Nabble.com.


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


Re: Axis2c, 0.94, error processing

Posted by Samisa Abeysinghe <sa...@wso2.com>.
Krankurs, Leonid wrote:
> Hi Samisa,
>
> Thank you very much for the tip - it works!,
>
> however it seems to me that the error message 
> "NULL paramater was passed when a non NULL parameter was expected"
> does not look informative as desirable.
>   
Agreed, but, does it not tell you the line number of the source file? 
That may give you a clue from where it is coming.

Thanks,
Samisa...

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


Re: Axis2c, 0.94, error processing

Posted by "Krankurs, Leonid" <lk...@ford.com>.
Hi Samisa,

Thank you very much for the tip - it works!,

however it seems to me that the error message 
"NULL paramater was passed when a non NULL parameter was expected"
does not look informative as desirable.


Best regards,
Leonid


Samisa Abeysinghe-2 wrote:
> 
> Krankurs Leonid wrote:
>> Hi, 
>>
>> Could you please clarify Axis2c, 0.94 error processing behavior in the
>> following scenario:
>>
>>
>> axis2_allocator_t* allocator = axis2_allocator_init (NULL);
>> axis2_error_t* error = axis2_error_create(allocator);
>> axis2_env_t* env = axis2_env_create_with_error(allocator, error); 
>>   
> calll axis2_error_init(); after creating the error. It is a bug that is 
> is not called from axis2_env_create_with_error, but you can call it 
> yourself for the time being.
>> both calls
>> 	AXIS2_ERROR_GET_MESSAGE(env->error)
>> 	env->error->ops->get_extended_message(env->error)
>> return NULL
>>
>> what is wrong?
>>   
> This would go away, if you call the axis2_error_init(); function. Please 
> raise a Jira for this.
> 
> Another alternative is to call
> axis2_env_create_all() to create the environment. That calls 
> axis2_error_init();
> 
> Samisa...
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Axis2c%2C-0.94%2C-error-processing-tf2443488.html#a6822733
Sent from the Axis - C++ - User mailing list archive at Nabble.com.


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


Re: Axis2c, 0.94, error processing

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Krankurs Leonid wrote:
> Hi, 
>
> Could you please clarify Axis2c, 0.94 error processing behavior in the
> following scenario:
>
>
> axis2_allocator_t* allocator = axis2_allocator_init (NULL);
> axis2_error_t* error = axis2_error_create(allocator);
> axis2_env_t* env = axis2_env_create_with_error(allocator, error); 
>   
calll axis2_error_init(); after creating the error. It is a bug that is 
is not called from axis2_env_create_with_error, but you can call it 
yourself for the time being.
> both calls
> 	AXIS2_ERROR_GET_MESSAGE(env->error)
> 	env->error->ops->get_extended_message(env->error)
> return NULL
>
> what is wrong?
>   
This would go away, if you call the axis2_error_init(); function. Please 
raise a Jira for this.

Another alternative is to call
axis2_env_create_all() to create the environment. That calls 
axis2_error_init();

Samisa...

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


Re: Axis2c, 0.94, error processing

Posted by "Krankurs, Leonid" <lk...@ford.com>.
Hi,

Thank you for the quick response,


since
axis2_error_t* error = axis2_error_create(allocator);
axis2_env_t* env = axis2_env_create_with_error(allocator, error);

env->error and error are objects of type axis2_error_t* and pointing to the
same address,

it seems one can use error and env->error interchangeably in this scenario
(i tried)
the result the same:

both calls
         AXIS2_ERROR_GET_MESSAGE(env->error)
         env->error->ops->get_extended_message(env->error)

still are returning NULL

Any second opinion?


Best regards,
Leonid



Sahan Gamage-2 wrote:
> 
> Hi,
> 
> If the code is exact as it is, I think you're setting the error to the
> "error" object and try to retrieve it from the "env->error" object.
> Since "error" and "env->error" are two objects you won't see the error
> set to one object reflected in the other.
> 
> HTH
> -sahan
> 
> On 10/14/06, Krankurs Leonid <lk...@ford.com> wrote:
>>
>> Hi,
>>
>> Could you please clarify Axis2c, 0.94 error processing behavior in the
>> following scenario:
>>
>>
>> axis2_allocator_t* allocator = axis2_allocator_init (NULL);
>> axis2_error_t* error = axis2_error_create(allocator);
>> axis2_env_t* env = axis2_env_create_with_error(allocator, error);
>>
>> axis2_char_t* t = NULL;
>> axis2_char_t* url_str[3] =
>> {
>>         "",
>>         "123",
>>         "http:",
>> };
>>
>>
>> for ( int i = 0; i < 3; ++i )
>> {
>>         if ( NULL == url[i] )
>>         {
>>                 AXIS2_ERROR_SET_ERROR_NUMBER(error,
>> AXIS2_ERROR_INVALID_NULL_PARAM);
>>                 AXIS2_ERROR_SET_STATUS_CODE(error,
>> (axis2_status_codes_t)AXIS2_FAILURE);
>>         }
>>         else
>>         {
>>                 AXIS2_ERROR_SET_STATUS_CODE(error,
>> (axis2_status_codes_t)AXIS2_SUCCESS);
>>         }
>>
>>         if ( AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(error) )
>>         {
>>                  t = (axis2_char_t*)AXIS2_ERROR_GET_MESSAGE(env->error);
>>                  t = (axis2_char_t*)
>> env->error->ops->get_extended_message(env->error);
>>         }
>> }
>>
>>
>> in the case of AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(error)
>>
>> both calls
>>         AXIS2_ERROR_GET_MESSAGE(env->error)
>>         env->error->ops->get_extended_message(env->error)
>> return NULL
>>
>> what is wrong?
>>
>>
>> Thank you,
>> Leonid
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Axis2c%2C-0.94%2C-error-processing-tf2443488.html#a6812858
>> Sent from the Axis - C++ - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Axis2c%2C-0.94%2C-error-processing-tf2443488.html#a6816653
Sent from the Axis - C++ - User mailing list archive at Nabble.com.


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


Re: Axis2c, 0.94, error processing

Posted by Sahan Gamage <sa...@gmail.com>.
Hi,

If the code is exact as it is, I think you're setting the error to the
"error" object and try to retrieve it from the "env->error" object.
Since "error" and "env->error" are two objects you won't see the error
set to one object reflected in the other.

HTH
-sahan

On 10/14/06, Krankurs Leonid <lk...@ford.com> wrote:
>
> Hi,
>
> Could you please clarify Axis2c, 0.94 error processing behavior in the
> following scenario:
>
>
> axis2_allocator_t* allocator = axis2_allocator_init (NULL);
> axis2_error_t* error = axis2_error_create(allocator);
> axis2_env_t* env = axis2_env_create_with_error(allocator, error);
>
> axis2_char_t* t = NULL;
> axis2_char_t* url_str[3] =
> {
>         "",
>         "123",
>         "http:",
> };
>
>
> for ( int i = 0; i < 3; ++i )
> {
>         if ( NULL == url[i] )
>         {
>                 AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM);
>                 AXIS2_ERROR_SET_STATUS_CODE(error, (axis2_status_codes_t)AXIS2_FAILURE);
>         }
>         else
>         {
>                 AXIS2_ERROR_SET_STATUS_CODE(error, (axis2_status_codes_t)AXIS2_SUCCESS);
>         }
>
>         if ( AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(error) )
>         {
>                  t = (axis2_char_t*)AXIS2_ERROR_GET_MESSAGE(env->error);
>                  t = (axis2_char_t*) env->error->ops->get_extended_message(env->error);
>         }
> }
>
>
> in the case of AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(error)
>
> both calls
>         AXIS2_ERROR_GET_MESSAGE(env->error)
>         env->error->ops->get_extended_message(env->error)
> return NULL
>
> what is wrong?
>
>
> Thank you,
> Leonid
>
> --
> View this message in context: http://www.nabble.com/Axis2c%2C-0.94%2C-error-processing-tf2443488.html#a6812858
> Sent from the Axis - C++ - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>

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