[jitsi-dev] [libjitsi] Correctly load jitsi-defaults.properties when running under WebStart (#13)


#1

When running under WebStart, using ClassLoader.getSystemResourceAsStream(fileName) does not work at all.

You can merge this Pull Request by running:

  git pull https://github.com/dpocock/libjitsi webstart

Or you can view, comment on it, or merge it online at:

  https://github.com/jitsi/libjitsi/pull/13

-- Commit Summary --

  * Correctly load jitsi-defaults.properties when running under WebStart

-- File Changes --

    M src/org/jitsi/impl/configuration/ConfigurationServiceImpl.java (37)

-- Patch Links --

https://github.com/jitsi/libjitsi/pull/13.patch
https://github.com/jitsi/libjitsi/pull/13.diff

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/13


#2

                 fileStream = ClassLoader.getSystemResourceAsStream(fileName);
             }

+ if(fileStream == null)
+ {
+ logger.info("failed to find " + fileName + " with class loader, will continue without it.");

This line is too long, can you please wrap it at 80 chars?

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/13/files#r15734755


#3

@@ -1645,11 +1668,25 @@ private void loadDefaultProperties(String fileName)
                         = getClass().getClassLoader()
                                 .getResourceAsStream(fileName);
             }
+ else if(isLaunchedByWebStart())
+ {
+ logger.info("WebStart classloader");

This seems to noisy to me, debug or trace seems more appropriate (the statement about normal classloader as well).

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/13/files#r15734764


#4

@@ -1645,11 +1668,25 @@ private void loadDefaultProperties(String fileName)
                         = getClass().getClassLoader()
                                 .getResourceAsStream(fileName);
             }
+ else if(isLaunchedByWebStart())
+ {
+ logger.info("WebStart classloader");

This is actually quite useful for somebody troubleshooting WebStart and this code only executes once at startup. The code for detecting webstart is not 100% reliable, different people describe different techniques so it is really useful to know what type of environment Jitsi believes it is running in.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/13/files#r15735062


#5

                 fileStream = ClassLoader.getSystemResourceAsStream(fileName);
             }

+ if(fileStream == null)
+ {
+ logger.info("failed to find " + fileName + " with class loader, will continue without it.");

Done

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/13/files#r15735074


#6

@@ -1645,11 +1668,25 @@ private void loadDefaultProperties(String fileName)
                         = getClass().getClassLoader()
                                 .getResourceAsStream(fileName);
             }
+ else if(isLaunchedByWebStart())
+ {
+ logger.info("WebStart classloader");

Another thing to keep in mind: when somebody launches Jitsi over web start, there is no easy way they can tweak the logging configuration, if the threshold is info, then they are stuck with that unless they have a way to sign all the JARs again.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/13/files#r15735117


#7

Merged #13.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/13#event-149056232


#8

Note that libjitsi is not automatically updated in Jitsi, which I cannot do myself right now.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/13#issuecomment-51141239