Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

CTP : How to configure JAVA class file in CTP

bsaikrishna84
bsaikrishna84 Posts: 66

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

  • bsaikrishna84
    bsaikrishna84 Posts: 66

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

  • humphrey
    humphrey 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

  • bsaikrishna84
    bsaikrishna84 Posts: 66
    edited July 2020

    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?

  • humphrey
    humphrey 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

  • bsaikrishna84
    bsaikrishna84 Posts: 66
    edited July 2020

    @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 ?

  • bsaikrishna84
    bsaikrishna84 Posts: 66

    @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:

  • OmarR
    OmarR Posts: 235 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

  • OmarR
    OmarR Posts: 235 admin

    As of CTP 2020.2, jar files and classes are now reloaded from a user-initiated server refresh in CTP. There is no need to restart the soavirt server to view the latest methods for jars added under /VirtualAssets/system_jars.