Beehive
  1. Beehive
  2. BEEHIVE-780

WSM leaks InputStreams at build time

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: V1Alpha, V1Beta, v1m1
    • Fix Version/s: 1.0
    • Component/s: Web Services (181)
    • Labels:
      None

      Description

      The WSM code base leaks InputStreams in the following locations:

      AbstractWsdl2AJava
      generateAnnotatedJavaFromWSDL – an InputStream is used to construct the BeehiveWsTypeMetadata object and is not closed
      Utilities
      findSchemaDocument – an InputStream is passed to the WSDLParser class and is not closed

      1. streampatch.txt
        204 kB
        daryoush mehrtash

        Activity

        Hide
        daryoush mehrtash added a comment -

        The abstract-ness of the class doesn't seem to make sense. The object model that is generated from WSDL has system dependencies for resolving types (needs Axis), so there has to be a class in the Axis package that gets the OM. The relationship between the base class and the axis class should be changed to follow IOC model, where the Axis implementation constructs the OM and passes it to the implementation to generated the JWS file. It should then close the stream also.

        Show
        daryoush mehrtash added a comment - The abstract-ness of the class doesn't seem to make sense. The object model that is generated from WSDL has system dependencies for resolving types (needs Axis), so there has to be a class in the Axis package that gets the OM. The relationship between the base class and the axis class should be changed to follow IOC model, where the Axis implementation constructs the OM and passes it to the implementation to generated the JWS file. It should then close the stream also.
        Hide
        daryoush mehrtash added a comment -

        This is the fix for this bug and also 781.

        The interfaces on the classes have been cleaned up by moving the parsing of the xml document out of the XMLBeanWSDLProcess and Schema classes and updated calling classes. The WSDL to xmlbean parsing has been moved to the org.apache.beehive.wsm.wsdl.Utilitites class. Also added two unit tests to verify the WSDL to OM logic. For the test I am using the current Google and Amazon wsdls. There is no need to update thse WSDLs as we are not really connecting to the service, rather just using the current version of their wsdl as a test data. We should add more real wsdls in future. To add the more wsdls you need to drop the wsdl in either encoded-schmeas or schems in the drt/tests. The build file would generate all types from the wsdl iles before running the tests.

        Show
        daryoush mehrtash added a comment - This is the fix for this bug and also 781. The interfaces on the classes have been cleaned up by moving the parsing of the xml document out of the XMLBeanWSDLProcess and Schema classes and updated calling classes. The WSDL to xmlbean parsing has been moved to the org.apache.beehive.wsm.wsdl.Utilitites class. Also added two unit tests to verify the WSDL to OM logic. For the test I am using the current Google and Amazon wsdls. There is no need to update thse WSDLs as we are not really connecting to the service, rather just using the current version of their wsdl as a test data. We should add more real wsdls in future. To add the more wsdls you need to drop the wsdl in either encoded-schmeas or schems in the drt/tests. The build file would generate all types from the wsdl iles before running the tests.
        Hide
        Eddie O'Neil added a comment -

        This is fixed in SVN 190648.

        The streams should no longer be leaked.

        Show
        Eddie O'Neil added a comment - This is fixed in SVN 190648. The streams should no longer be leaked.
        Hide
        Eddie O'Neil added a comment -

        Setting fix version.

        Show
        Eddie O'Neil added a comment - Setting fix version.
        Hide
        Eddie O'Neil added a comment -

        I committed these changes a while ago. Closing.

        Show
        Eddie O'Neil added a comment - I committed these changes a while ago. Closing.

          People

          • Assignee:
            Eddie O'Neil
            Reporter:
            Eddie O'Neil
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development