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

org.apache.openejb.config.WebModule constructor throws StringIndexOutOfBoundsException on windows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0, 3.0.1, 3.1, 3.1.1
    • 3.0.2, 3.1.1
    • container system
    • None
    • Windows XP

    Description

      org.apache.openejb.config.WebModule constructor has the following line:

      contextRoot = jarLocation.substring(jarLocation.lastIndexOf('/'));

      On windows, the jarLocation does not contain a "/" since the file separator is "\". This is resulting in StringIndexOutOfBoundsException. Stack trace is given below:

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1762)
      at java.lang.String.substring(String.java:1735)
      at org.apache.openejb.config.WebModule.<init>(WebModule.java:51)
      at org.apache.openejb.config.DeploymentLoader.createWebModule(DeploymentLoader.java:544)
      at org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoader.java:445)
      at org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:154)
      ...

      Attachments

        Activity

          People

            kevan Kevan Lee Miller
            vamsic Vamsavardhana Reddy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: