Forum Discussion

aksanoop's avatar
aksanoop
Occasional Contributor
11 years ago

Urgent: How to resolve Error Grabbin Grabes

Hi Members,

I am stuck with one potential issue in Load UI. I am using groovy script to run Load ui for Load testing.
Output table says:
java.lan.NullPointerException: Cannot set property 'binding' on null object.
System log says:
startup failed:

General error during conversion: Error grabbing Grapes -- [unresolved dependency: org.apache.httpcomponents#httpclient;4.3.1: not found]
java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.apache.httpcomponents#httpclient;4.3.1: not found]

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

Even i tried with some other httpClient version but it didn't work. I am using Load Ui version 2.6.8.

Please let me know the solution as it is very urgent for me.

Thanks & regards,
Anoop.

6 Replies

  • Hello there!

    Sounds like there's something going on with grabbing grapes on your system.
    Usually pretty hard to see exactly why. It could be that your system is behind some proxy which makes it impossible to download it.
    It might be that you have some version mismatch, and in that case i strongly recommend you to move your $USER_HOME/.groovy/grapes folder somewhere and let LoadUI download all the grapes anew.

    Check it out, and get back if it worked out or broke down.

    Best regards,
    Mikael
  • aksanoop's avatar
    aksanoop
    Occasional Contributor
    Hi Mikael,

    Thanks for your mail.
    i followed your instructions and installed load ui on a pc which didn't had groovy installed previously. I also ensured that the firewall doesn't block any download.
    Now I am getting slightly different error in system log...
    JavaFX2 bundle started, is Headless mode ? false

    Loading workspace from file: C:\Documents and Settings\Administrator\.loadui\workspace.xml

    Verifying URL: file:/C:/Program%20Files/SmartBear/loadUI-Pro-2.6.8/bundle/loadui-pro-licensing-2.6.8.jar

    Workspace 'WorkspaceItemImpl[label=null]' loaded successfully

    Initializing ProjectView

    startup failed:

    General error during conversion: Error grabbing Grapes -- [download failed: org.apache.httpcomponents#httpclient;4.3.2!httpclient.jar]



    java.lang.RuntimeException: Error grabbing Grapes -- [download failed: org.apache.httpcomponents#httpclient;4.3.2!httpclient.jar]

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

    at java.lang.reflect.Constructor.newInstance(Unknown Source)

    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
    ----
    The error in output table remains the same. Just wanted to let you know that i am using LoadUi 2.6.8 and script contains grab command like this...
    @Grab(group='org.apache.httpcomponents', module='httpclient', version='4.3.2')

    Please let me what is going wrong?
    It will be a great help.

    Thanks & regards,
    Anoop.
  • Hi Annop,

    I haven't been able to reproduce this issue.
    Several things could be going wrong for you, but I think the first thing to do would be to try and change the version of httpclient you're using from 4.3.2 to 4.3. The reason is that LoadUI actually comes with this version already provided, so Grapes doesn't have to download it.

    Once you confirm you can use this version, we can try to figure out why you can't download using Grapes.

    Can you write this script in the Groovy console and see if it correctly downloads the httpclient library:

    @Grab(group='org.apache.httpcomponents', module='httpclient', version='4.3.2')

    import org.apache.http.*

    println Consts


    If this works, then LoadUI should also have worked.

    Please let us know whether the above works for you.

    By the way, if this did work, you can work-around the problem for now by copying this library's folders from the default grapes directory (~/.groovy/grapes) to the LoadUI grapes (~/.loadui/.groovy/grapes).

    Regards,

    Renato
    SmartBear Software
  • aksanoop's avatar
    aksanoop
    Occasional Contributor
    Hi Renato,

    Thanks for your mail.
    I changed 4.3.2 httpclient version to 4.3 but it didn't work.
    Then i worked on your next work around of copying grapes libraries into load ui grapes and it worked for me.
    But now i am getting error of unresolved class...it says

    startup failed:

    13org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

    Script7.groovy: 18: unable to resolve class org.apache.http.entity.mime.content.FileBody
    @ line 18, column 1.

    import org.apache.http.entity.mime.content.FileBody;

    ^
    Script7.groovy: 17: unable to resolve class org.apache.http.entity.mime.MultipartEntity
    @ line 17, column 1.

    import org.apache.http.entity.mime.MultipartEntity;

    ^
    Script7.groovy: 20: unable to resolve class org.codehaus.groovy.grails.web.json.JSONObject
    @ line 20, column 1.

    import org.codehaus.groovy.grails.web.json.JSONObject

    ^

    Script7.groovy: 19: unable to resolve class org.apache.http.entity.mime.content.StringBody
    @ line 19, column 1.

    import org.apache.http.entity.mime.content.StringBody;

    ^
    4 errors

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)

    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:858)

    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)

    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)

    Could you please help me on how to fix these issues? Which libraries i need to copy ?

    Thanks & regards,
    Anoop.
  • Hi again,

    It looks like you need quite a few other libraries for your script to work.
    Can I ask you how you're using LoadUI? You are trying to write your own component?

    Looks like you need the httpmime library and some grails libraries as well.

    Have you ever got this script running, even outside LoadUI? If you did, you probably should have access to all the libraries which are required.... you may add all library jars to the 'ext' folder inside your LoadUI installation. This way, you won't even need to use Grapes to get them.

    I should also mention that if you are a LoadUI Pro customer, we can provide more detailed support if you use our support channel:

    http://www.loadui.org/Support/support.html

    Regards,

    Renato
    SmartBear Software
  • aksanoop's avatar
    aksanoop
    Occasional Contributor
    Hi Renato,

    Thanks a lot.....its working for me now.
    Copying all the required libraries and jars in 'ext' folder under Load Ui installation solved all issues.

    Great help. Thanks for the proper guidance.

    Thanks & regards,
    Anoop.