TRIRIGA

 View Only
  • 1.  Loading resource files in Custom Class Loader

    Posted 28 days ago

    Greetings,
    I'm trying to write a custom Class Loader that will be deployed as a Resource File. I wish to load a properties file will be stored in another Resource File record. I followed the directions here: https://www.ibm.com/docs/en/tap/4.4?topic=functions-adding-resource-files-class-loaders

    How do I write the Java code to access the properties file? For example TRIRIGAIntegration.jar has code that loads the files stored in TRIRIGAIntegration_Assets.zip. How is the Java code in TRIRIGAIntegration.jar written to access those files?



    ------------------------------
    Emerson David
    ------------------------------


  • 2.  RE: Loading resource files in Custom Class Loader

    Posted 21 days ago
    Edited by Edwin Premkumar David 21 days ago

    Hello - 

    Try below code to load the property file at the same level which is defined as a resource in the same class loader. 

    Properties properties = new Properties();
    properties.load(getClass().getClassLoader().getResourceAsStream("<YOUR_PROP_FILE>.properties"));



    ------------------------------
    Edwin Premkumar David
    ------------------------------



  • 3.  RE: Loading resource files in Custom Class Loader

    Posted 21 days ago

    I've created a report that runs just fine in the BIRT report designer, but when I run it from Tririga, I get the error, "There is an error in the report query loading, Can not retrieve data to generate the report." This seems to be similar to the problem discussed here (https://www.ibm.com/support/pages/apar/IV68911) but the suggested workaround is entirely specific to the poster's application and it's not clear how I could apply it to my situation.

    Has anyone else encountered and resolved this issue?






  • 4.  RE: Loading resource files in Custom Class Loader

    Posted 21 days ago

    Sorry, I should have mentioned that we're running platform version 3.5.2.

     






  • 5.  RE: Loading resource files in Custom Class Loader

    Posted 13 days ago

    Thanks Edwin!!! That did it.



    ------------------------------
    Emerson David
    ------------------------------