CTP : How to configure JAVA class file in CTP

I have a Virtual Asset which has a extensiontool chained using Java Language to send response back to client.
I also have the java project inside the same SOAtest project. I added the classPath to the system properties and class loader , it works fine.

But when i deployed the asset to SOAVirtualizeServer , I could not find the extensiontool. However, i added extensiontool from CTP itself and added class file (VirtualAssets/SystemJars/Test.class) under the systemjars.

Now, when i selected Language as JAVA and provided the class file as (Test.class) since it is under system jars. But am getting error saying "ClassFileNotFound"

Can someone please help me how do I use JAVA class file in CTP ?

Best Answer

Answers

  • bsaikrishna84bsaikrishna84 Posts: 61

    We need this very quick for a project. Can someone please help on this ?

  • humphreyhumphrey Posts: 4

    1.) *Inside CTP - First make sure that you use the fully qualified name for the class in the text field. For example if you were going to use String you would enter "java.lang.String".

    2.) Inside SOAVirt desktop client - If part one doesn't work make sure that under Preferences > Parasoft > System Properties that the class folder is specified by clicking add folder and choosing the folder that contains the class. If the class has any external dependencies be sure to also load those as well. Last make sure to click the reload button to make sure everything under System properties is synced

  • bsaikrishna84bsaikrishna84 Posts: 61
    edited July 21

    Thanks @humphrey

    I did tried in SOAVirtand it worked fine. But I faced issues while using the class file jn CTP.
    For the 1st point you mentioned, yes now I used the full class path and now am able to see methods.
    However , am not getring return value though i chained a textdatabank and mapped the variable in my responder response.
    The same structure works jn SOAVirt.

    Can you please tell me how do I capture from extension tool to responder response using Java class file inside CTP?

  • humphreyhumphrey Posts: 4

    One thing we noticed is that the path you mentioned is wrong it should be /VirtualAssets/system_jars/
    see https://docs.parasoft.com/pages/viewpage.action?pageId=73223405#AdditionalPreferenceSettings-systemPropertiesSystemPropertiesSettings

  • bsaikrishna84bsaikrishna84 Posts: 61
    edited July 23

    @humphrey
    Yes mentioned correct path and able to see java methods from the dropdown.
    But when I deployed to CTP and tried to invoke the responder, i am not getting any response. It is returning only blank response.

    I am wondering how the same setup is working in SOATest Tool and not working in CTP :(

    Can you please suggest ?

  • bsaikrishna84bsaikrishna84 Posts: 61

    @OmarR
    Yes, now am able to see and got the response. Actually , when we deploy the jar file to CTP under system_jars it seems like virtual server needs a restart and only then methods are visible.

    But however, this helped me a lot. Thank you so much :smile:

  • OmarROmarR Posts: 226 admin

    Glad you got it to work. Restarting the tool will reload the jars and make the methods available. Alternatively, you can make a REST API call to the SOAVirt server to reload the jars without having to restart the server.

    POST - http://[soavirt_server_host]:[soavirt_server_port]/soavirt/api/v5/preferences/systemProperties/reload

    You can access the API documentation using the following URL:
    http://[soavirt_server_host]:[soavirt_server_port]/soavirt/api#/preferences/preferencesPOST_systemProperties_reload

Sign In or Register to comment.