TRIRIGA

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

    Posted Mon November 11, 2024 11:35 AM

    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 Sun November 17, 2024 10:28 PM
    Edited by Edwin Premkumar David Sun November 17, 2024 10:28 PM

    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 Mon November 18, 2024 01:40 PM

    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 Mon November 18, 2024 01:45 PM

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

     






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

    Posted Mon November 25, 2024 07:41 PM

    Thanks Edwin!!! That did it.



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