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

ClassCastExceptions between two axis2 client jars with different package

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Component/s: client-api
    • Labels:
      None
    • Environment:
      Windows XP, Java 1.6.

      Description

      In one EAR file, we have two client jars generated against the same wsdl. Both are using the org.apache.axis2.wsdl.WSDL2Java -uri <wsdl> -p <filepath> -d xmlbeans -ns2p <namespace>.

      ClientA proxy classes have package name as a.
      ClientB proxy classes have package name as b.

      in first.java, we use the clientA like:
      import a.ResponseDocumet;
      import a.Stub;

      responseDocument responseDoc = ResponseDocument.Factory.newInstance();
      ....
      responseDoc = stub.sameMethod(...);

      ------------------------------------------------------------------------------------------------------------------------------------------------------------
      in second.java, we use the ClientB like:
      import b.ResponseDocumet;
      import b.Stub;

      ResponseDocument responseDoc = ResponseDocument.Factory.newInstance();
      ....
      responseDoc = stub.sameMethod(...);

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------
      It doesn't have any problem in compile. And first.java is also working correctly at runtime. But second.java got this exception at runtime:
      org.apache.axis2.AxisFault: a.impl.ResponseDocumentImpl with cause as java.lang.ClassCastException: a.impl.ResponseDocumentImpl.

      It should be using b package, but don't know why it referred to a in the stub implementation.

      It will be highly appreciated if you can help.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sunny_nc Sunny Wu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: