Service Virtualization

  • 1.  | Trapped Exception: org/json/simple/parser/JSONParser | Trapped Message:   java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser

    Posted Aug 07, 2018 09:32 AM

    Hi All,

     

    I have created a custom jar file to read json object from json file and delete one of array and update the file. It is running fine when tested using dynamic java test execution step . 

     

    p.s - I have tried by exporting java code with referenced libraries and also adding explicilty json jars. but none of the ways are worked.

     

    DevTest Version - 10

     

    But when using this jar in vsm , getting parser exception error after deploying it on vse.

     

    stacktrace

     

    ============================================================================
    | Exception:
    ============================================================================
    | Step: DeleteID2 main
    ----------------------------------------------------------------------------
    | Message: Invocation Exception on Dynamic Call/Ctor java.lang.String delete( java.lang.String[] args )
    ----------------------------------------------------------------------------
    | Trapped Exception: org/json/simple/parser/JSONParser
    | Trapped Message: java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser
    ----------------------------------------------------------------------------
    STACK TRACE
    java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser
    at DeleteInteractionID.delete(DeleteInteractionID.java:35)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorIm_TRUNCATED_

     

     

    Also , a weird behavior is observed. I am able to send the request to virtual service when it is deployed on vse. But when I ran it in ITR no request is captured at listen step and getting 404 not found exception.

     

     

    Thanks



  • 2.  Re: | Trapped Exception: org/json/simple/parser/JSONParser | Trapped Message:   java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser

    Broadcom Employee
    Posted Aug 07, 2018 10:15 AM

    I would also apply the custom jar to the hotDeploy of where your VSE is you deployed the VSM to.



  • 3.  Re: | Trapped Exception: org/json/simple/parser/JSONParser | Trapped Message:   java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser

    Posted Aug 08, 2018 05:44 AM

    Hi Marcy,

     

    can you please elaborate a little more?



  • 4.  Re: | Trapped Exception: org/json/simple/parser/JSONParser | Trapped Message:   java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser

    Broadcom Employee
    Posted Aug 08, 2018 05:22 PM

    Trapped Message: java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser

     

     

    Do you have all of your dependencies in the jar?

     

    Your application looks to be missing a class that is needed at runtime.



  • 5.  Re: | Trapped Exception: org/json/simple/parser/JSONParser | Trapped Message:   java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser

    Posted Aug 09, 2018 02:55 AM

    Yes I have , even tried by explicitly placing all the required jars in hot deploy folder as well , but nothing works.

     

    Also , a weird behavior is observed. I am able to send the request to virtual service when it is deployed on vse. But when I ran it in ITR no request is captured at listen step and getting 404 not found exception.



  • 6.  Re: | Trapped Exception: org/json/simple/parser/JSONParser | Trapped Message:   java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser

    Broadcom Employee
    Posted Aug 10, 2018 11:11 AM

    How are you submitting your request when you run in ITR?