Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties is not loaded from classpath when use "common" predicate (only for Windows!) #51

Open
dmytro-lazebnyi opened this issue Apr 20, 2018 · 0 comments
Labels

Comments

@dmytro-lazebnyi
Copy link
Member

Properties are not loaded from classpath source if predicate matches with files from classpath that cannot be loaded (e.g. property files from jre jars)

Let's imagine we have following example:

Predicate<Path> propsPredicate = path -> path.toString().endsWith(".properties");
ConfigRegistry configRegistry = ConfigRegistry.create(
    ConfigRegistrySettings.builder()
        .addLastSource("classpath", new ClassPathConfigSource(propsPredicate))
        .addListener(new Slf4JConfigEventListener())
        .build());
StringConfigProperty myProp = configRegistry.stringProperty("myProp");
System.out.println("myProp=" + myProp.value().get());

In runtime FilteredPathConfigSource tries to load, for example, com/sun/javafx/scene/control/skin/resources/controls-nt.properties as it is matched with predicate, but can't do it because of java.io.FileNotFoundException: C:\Program%20Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar (The system cannot find the path specified)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant