Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-2117

Missing WSDL file in classpath ends in NullPointerException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: (not version related)
    • Fix Version/s: None
    • Component/s: container system
    • Labels:
      None

      Description

      I use the annotation @WebService(wsdlLocation=…) in my service implementation to specify a wsdl file in my class path.
      And I'm using TomEE with OpenEJB 4.7.2.

      If my wsdl file is not in the class path I would expect an error message
      but I have get a NullPointerException.

      Caused by: java.lang.NullPointerException
      at org.apache.openejb.config.WsDeployer.readWsdl(WsDeployer.java:451)
      at org.apache.openejb.config.WsDeployer.getWsdl(WsDeployer.java:427)
      at org.apache.openejb.config.WsDeployer.processPorts(WsDeployer.java:209)

      In class org.apache.openejb.config.WsDeployer
      at line 425 the wsdl url is created with
      final URL wsdlUrl = module.getClassLoader().getResource()
      Attention: wsdlUrl is null if the resource is missing!
      So readWsdl(wsdlUrl = null) at line 427 does not work!
      The error handling routine at line 451 calls url.toExternalForm().
      This results in a NullPointerException because url is null.

      Please give a valid ErrorMessage if getResource() returns null and don't throw a NullPonterException.

      Best regards
      Martin Both

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              maboth Martin Both
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: