Forum Discussion

larkking's avatar
larkking
New Contributor
8 years ago

Upgraded to ReadyAPI 2.2 Now my FileNameFinder call does not work in Groovy step script

For lines:

def pathToResults = context.('${#Project#jenkinsWorkspace}') + "\\" + jenkinsName + "\\" + "LarkStuff\\"

//find the file result*.xml
def xmlResultFiles = new FileNameFinder().getFileNames(pathToResults, 'result_*.xml')

 

I am getting the following error:

 

TestStep Result: Step [Calc Status and Time] ran with assertion status [FAILED] java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildLogger

 

I wrote this code when using ReadyAPI 1.8.5 and it worked then....

Do I need to add something?  Thanks In Advance.

  • larkking's avatar
    larkking
    8 years ago

    Did more research and found that FileNameFinder.class is in groovy.util package.  A pretty basic package - and it is present in 

    C:\Program Files\SmartBear\ReadyAPI-2.2.0\lib\groovy-all-2.4.4.jar\groovy\util\ - and same in ReadyAPI 1.8.5. (using 7zip to view the jar file)

     

    What i found out from some team members though - we have to install the ant jars into the ReadyAPI/lib directory:

    ant.jar

    ant-jsch.jar

    ant-launcher.jar

    jsch-0.1.50.jar

     

    So you were right on....Thanks!

     

     

     

     

     

  • StevenColon's avatar
    StevenColon
    SmartBear Alumni (Retired)

    Thank you for posting to our Community Forum.

     

    I tried using FileNameFinder() in both ReadyAPI 1.8.5 and 2.2, getting the same

    java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildLogger

     

     

    This indicates that you added an external jar file to 1.8.5 to get that class. Please check <ReadyAPI-1.8.5 Installation>/bin/ext for any external jar files and move them to <ReadyAPI-2.2.0 Installation>/bin/ext.

     

    Have a great day!

     

    • larkking's avatar
      larkking
      New Contributor

      Did more research and found that FileNameFinder.class is in groovy.util package.  A pretty basic package - and it is present in 

      C:\Program Files\SmartBear\ReadyAPI-2.2.0\lib\groovy-all-2.4.4.jar\groovy\util\ - and same in ReadyAPI 1.8.5. (using 7zip to view the jar file)

       

      What i found out from some team members though - we have to install the ant jars into the ReadyAPI/lib directory:

      ant.jar

      ant-jsch.jar

      ant-launcher.jar

      jsch-0.1.50.jar

       

      So you were right on....Thanks!