home Forums # Technical Support logging.properties problem

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2139
    Unknown
    Member

    Sorry for what is likely a newbie java/fuzzylite problem (trying to learn both at same time). Using Netbeans and starting by trying to get your sample SimpleDimmer application to build & run successfully. Builds fine. Fails on run with error:

    WARNING: Could not load default /logging.properties file
    java.lang.NullPointerException

    I can see the logging.properties file but can’t figure out how to configure app to see it/load it.

    Thanks,

    Steve

    #2143
    Unknown
    Member

    Was able to get it to run by making some changes to fuzzylite.java:

    static {
    FileInputStream inputStream = null;

    String configurationFile = “logging.properties”;
    // final InputStream inputStream = FuzzyLite.class.getResourceAsStream(configurationFile);
    try {
    inputStream = new FileInputStream(configurationFile);
    LogManager.getLogManager().readConfiguration(inputStream);
    } catch (Exception ex) {
    System.out.println(String.format(“WARNING: Could not load default %s file”, configurationFile));
    System.out.println(ex);
    }

    Had to make similar changes to Method2() in SimpleDimmer.java for it to read the engine config from SimpleDimmer.fll.

    So new to java that I am not entirely comfortable with these changes, but it works.

    Steve

    #2144

    Hi Steve,

    thank you for your post.

    If you look into FuzzyLite.java you will find very similar code to what you added. I am not sure why you are running into issues configuring the logger. Did you create your java project from the maven pom file? If not, you should try opening the jfuzzylite project as a Maven project by opening the pom.xml file in your IDE.

    Cheers.

    #2145
    Unknown
    Member

    Juan,

    Did not create the project using Maven. Just built it by hand & copy & paste from your example. Just tried opening the pom.xml file in the IDE. It opens but throws error when attempting to build.

    Failed to execute goal on project examples: Could not resolve dependencies for project com.fuzzylite:examples:jar:5.0: Failure to find com.fuzzylite:jfuzzylite:jar:5.0.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

    Truthfully, I know less about Maven than about java itself, so I’ll need to do a bit of studying.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.