axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Bobek (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-610) error when creating two times ServiceClient without a service
Date Mon, 24 Apr 2006 19:13:05 GMT
error when creating two times ServiceClient without a service
-------------------------------------------------------------

         Key: AXIS2-610
         URL: http://issues.apache.org/jira/browse/AXIS2-610
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug

  Components: client-api  
    Versions: 0.95    
    Reporter: Andreas Bobek


Follow exception is thrown when creating a ServiceClient with a null service two times with
the same ConfigurationContext:

ServiceClient client1 = new ServiceClient(confCtxt, null); // ok .
ServiceClient client2 = new ServiceClient(confCtxt, null); // throws Exception

java.lang.NullPointerException
        at org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59)
        at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:97)

Up to now I see two possibilities to avoid this exception:
1.) Reusing the client.
2.) Check whether an anonymous service was already created and let the ServiceClient create
one (if missed):
ServiceClient client = null;
AxisService anonymousService =
confCtxt.getAxisConfiguration().getService(ServiceClient.ANON_SERVICE);
if(anonymousService == null){
	client = new ServiceClient(confCtxt, null); } else{
	client = new ServiceClient(confCtxt, anonymousService); }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message