Uploaded image for project: 'Lucee Development'
  1. LDEV-1266

CreateObject( "java" ) fails when passing the path of the directory containing the jar

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.1.3.18
    • Fix Version/s: 5.2.2.54
    • Labels:
    • Environment:

      Windows 10/Java 1.8.

    • Sprint:
      May-June 2017 Sprint

      Description

      The docs state that the 3rd argument to CreateObject(), when the object type is java, should be the:

      classpath used to load the defined class, this can be a list of multiple paths (directories containing class files or jar files)

      In the current stable version of Lucee, while specifying the specific jar file paths works fine, e.g.

      javaInstance = CreateObject( "java", "simple", "simple.jar" );
      

      ...specifying "directories containing class files or jar files", e.g.

      javaInstance = CreateObject( "java", "simple", "./" );
      

      fails with a java.lang.ClassNotFoundException.

      I've tried various ways of specifying the containing directory path, but none work. See the attached test case.

      Workaround

      Use DirectoryList() to generate an array of the individual files in the directory:

      javaInstance = CreateObject( "java", "simple", DirectoryList( "./" ) );
      

        Attachments

          Activity

            People

            • Assignee:
              21solutions Igal Sapir
              Reporter:
              julianhalliwell Julian Halliwell
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: