Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5184

Code working with Axis 2 1.5.x throws exception with 1.6.1

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.6.1
    • Fix Version/s: None
    • Component/s: client-api
    • Labels:
      None
    • Environment:
      Windows / Solaris

      Description

      The following code is working when using JRE 5 with Axis2 1.5.1 and 1.5.6:

      public static void test() throws Exception

      { ConfigurationContext ctx = ConfigurationContextFactory.createDefaultConfigurationContext(); String svcAddrress = "http://localhost:8080/axis2/services/era_aas"; Era_aasStub stub = new Era_aasStub(ctx,svcAddrress); Era_aasStub.UserIdentityIn in = new Era_aasStub.UserIdentityIn(); in.setCallerId("DMITRIY"); // more fields are set here, all are Strings Era_aasStub.UserProfile out = stub.loginUi(in); }

      When I switch to JRE 6 using Axis 1.6.1 the code throws the following exception:

      java.lang.NullPointerException
      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:172)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at gov.nih.era.aas.client.auto.Era_aasStub.loginUi(Era_aasStub.java:498)
      at AasServiceTest.test(AasServiceTest.java:93)
      at AasServiceTest.main(AasServiceTest.java:53)

      The workaround I have found is to change the code as following (do not pass context to the stub constructor):

      public static void test() throws Exception

      { ConfigurationContext ctx = ConfigurationContextFactory.createDefaultConfigurationContext(); String svcAddrress = "http://localhost:8080/axis2/services/era_aas"; Era_aasStub stub = new Era_aasStub(svcAddrress); // <-- this is the only change I had to make Era_aasStub.UserIdentityIn in = new Era_aasStub.UserIdentityIn(); in.setCallerId("DMITRIY"); // more fields are set here, all are Strings Era_aasStub.UserProfile out = stub.loginUi(in); }

      However, this solution requires multiple code changes and also causes problems when we do need to pass context to the stub. Please advise if there is a proper way to make the code work using ConfigurationContextFactory.createDefaultConfigurationContext(). Additional details:

      No custom configuration - I am using standard binary distribution of Axis 2 version 1.6.1. The service code is generated from WSDL using ADB data binding.

        Attachments

          Activity

            People

            • Assignee:
              kishanthan Kishanthan Thangarajah
              Reporter:
              dmitriyk Dmitriy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: