Announcement Announcement Module
Collapse
No announcement yet.
ClassLoader.getResourceAsStream of resource in external JAR does not work Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassLoader.getResourceAsStream of resource in external JAR does not work

    Hi,

    I'm using DM 2.0.0 release.

    My application runs as web bundle and I'm trying to read resource from external JAR which was added to Bundle-Classpath and it does not work.

    I added to MANIFEST.MF:
    Code:
    Bundle-ClassPath: .,/tmp/client-config.jar
    The resource is a clientinit.0 file in client-config.jar.

    The in bundle code:
    Code:
    ClassLoader cl = this.getClass().getClassLoader();
    InputStream in = cl.getResourceAsStream("clientinit.0");
    in = cl.getResourceAsStream("/clientinit.0");
    I get null for 'in' variable.

    When debugging, I see that 'cl' has the /tmp/client-config.jar in its' classpath member.

    Please help !!!

    Thanks,
    Pavel

  • #2
    Found the solution.

    Since the JAR is external from bundle it should be surrounded with:
    external:$<filename/foldername>$

    Comment

    Working...
    X