Skip navigation
Currently Being Moderated

Reading property file from within Component's jar file- LiveCycle Classloader problem

Jul 16, 2008 10:36 PM


I have made component that uses libraries and properties files. I packaged it in jar and deployed it successfully into the LiveCycle server (Jboss Turnkey installation) using workbench.I made process,forms and get my form to invoke my component's service successfully. Everything is working fine except that I am getting problem when my service is reading the property file that I include at root of the jar file of component.
I am using following code to read the property file which is not working:

b Thread.currentThread().getContextClassLoader().getResourceAsStream(PR OPERTIES_FILE);

However When I use following code then it get worked:

b this.getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE) ;

I think there this is due to the reason that LiveCycle ClassLoader might have different classpath.

I am stuck at this error as I am using third party APIs like hibernate that uses the first one methodology and I don't want to make changes into third party source codes to just make them run.

I would very thankful to you if you could provide help.

Thanks and Regards
Imam Raza
Senior Architect
Folio3 pvt Ltd
  • Currently Being Moderated
    Apr 16, 2009 11:48 PM   in reply to (Imam_Raza)

    Same problem , can't load hibernate.cfg.xml in component.jar

    Mark as:
  • Jaroslav Pavlicek
    85 posts
    May 2, 2006
    Currently Being Moderated
    Sep 15, 2011 9:26 AM   in reply to (Imam_Raza)



    Use full class name, following syntax works well:


    InputStream is = cz.livecycle.MyClass.class.getResourceAsStream("/") ;


    --- Jaroslav

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)