Forum Discussion

bfourie's avatar
Occasional Contributor
10 years ago

Adding JAR extensions

I'm trying to build in JSON validation in my tests in SoapUI NG.

I found json-schema-validator-2.2.6.jar as was described in the SoapUI cookbook.

In this book it tells me to copy all of those files to <Install Folder>\Java\ext 

However, in ReadyAPI that folder does not exist. How do I then add plugins and extensions to ReadyAPI?


I really need to get Restful JSON validation working. I've got little less than a week remaining on trial, and company will only get the licence once I have this validation bits working.


Any help will be appreciated. Even if it is an alternate way to validate response against json schema or raml.


Kind Regards


  • Ok Problem solved.

    Stupid problem really.

    I was running ReadyAPI 1.1.0

    I then updated to 1.2.2. However the shortcut on my desktop was still pointing to 1.1.0. Hence the java libs was copied into 1.2.2 since it is the one I thought I was using. As a simple test I copied into 1.2.2 folder. Everything worked perfect :-)

    Wil update shortcut now to point to the correct place.


    Thanks for everyones input.


11 Replies

  • bfourie's avatar
    Occasional Contributor


    So I copied the files to C:\Program Files\SmartBear\ReadyAPI-1.2.2\bin\ext

    I then restarted Ready API.


    Yet, I'm not having any luck.

    It seems like thise libraries are not picked up.


    The Groovy Script that refrences those libs.

    import com.fasterxml.jackson.databind.JsonNode
    import com.fasterxml.jackson.databind.ObjectMapper
    import com.github.fge.jsonschema.main.JsonSchema
    import com.github.fge.jsonschema.main.JsonSchemaFactory
    def response = context.expand( '${GetUser#Response}' )
    ObjectMapper mapper = new ObjectMapper()
    JsonNode GetUserJSON = mapper.readTree(response)
    JsonNode GetUserSchemaJSON = mapper.readTree(new File("/schema/GetUser200.raml"))
    JsonSchemaFactory factory = JsonSchemaFactory.byDefault()
    JsonSchema GetUserSchema = factory.getJsonSchema(GetUserSchemaJSON)
    if (GetUserSchema.validInstance(GetUserJSON)) 
    	{"Response Validated!")


    And the result:


    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script3.groovy: 
    5: unable to resolve class com.github.fge.jsonschema.main.JsonSchemaFactory @ line 5, column 1. 
    import com.github.fge.jsonschema.main.JsonSchemaFactory ^ org.codehaus.groovy.syntax.SyntaxException: 
    unable to resolve class com.github.fge.jsonschema.main.JsonSchemaFactory @ line 5, column 1. 
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError( 
    at org.codehaus.groovy.control.ResolveVisitor.visitClass( 
    at org.codehaus.groovy.control.ResolveVisitor.startResolving( 
    at org.codehaus.groovy.control.CompilationUnit$ 
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits( 
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation( 
    at org.codehaus.groovy.control.CompilationUnit.compile( 
    at groovy.lang.GroovyClassLoader.doParseClass( 
    at groovy.lang.GroovyClassLoader.parseClass( 
    at groovy.lang.GroovyShell.parseClass( 
    at groovy.lang.GroovyShell.parse( 
    at groovy.lang.GroovyShell.parse( 
    at groovy.lang.GroovyShell.parse( 
    at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$ 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$ Source) 
    at Source)


    Any Ideas?


    • bfourie's avatar
      Occasional Contributor

      Ok got a bit further in understanding the problem...

      By looking at the current classpath def, it is not adding from the ext folder:


      set CLASSPATH=%READY_API_HOME%ready-api-ui-1.2.2.jar;%READY_API_HOME%..\lib\*;%READY_API_HOME%..\.install4j\*
      "%JAVA%" -cp "%CLASSPATH%" > %TEMP%\jfxrtpath
      set /P JFXRTPATH= < %TEMP%\jfxrtpath
      del %TEMP%\jfxrtpath


      • nmrao's avatar
        Champion Level 3

        Just a quick check! Have you restarted readyAPI tool after copying the jar files? If not, can you try that?