home › Forums › # Technical Support › logging.properties problem
Tagged: Java, java.IO, logging.properties, SimpleDimmer
- This topic has 3 replies, 2 voices, and was last updated 7 years, 7 months ago by
Unknown.
-
AuthorPosts
-
May 2, 2016 at 06:41 #2139
Unknown
MemberSorry 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.NullPointerExceptionI can see the logging.properties file but can’t figure out how to configure app to see it/load it.
Thanks,
Steve
May 3, 2016 at 12:08 #2143Unknown
MemberWas 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
May 5, 2016 at 08:03 #2144Juan Rada-Vilela (admin)
KeymasterHi 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.
May 5, 2016 at 08:40 #2145Unknown
MemberJuan,
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.
-
AuthorPosts
- You must be logged in to reply to this topic.