logpai / AutoLog

AutoLog: A Log Sequence Synthesis Framework for Anomaly Detection [ASE'23]
MIT License
36 stars 2 forks source link

SLF4J Error and Null Pointer Exception in LogStatGen.java #4

Closed alishan2040 closed 9 months ago

alishan2040 commented 11 months ago

Hi, thanks for providing the implementation. I was facing an issue while running the tool on my system. The issue is given below:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Start processing the log statement
Exception in thread "main" java.lang.NullPointerException
at LogStatGen.createCSVFile(LogStatGen.java:180)
at LogStatGen.main(LogStatGen.java:112)

The corresponding command I used: java -jar LogStatGen.jar -j ../hadoop-mapreduce-client-jobclient-2.6.4.jar -o log_methods.txt -m 'log' Although the above command was unsuccessful, I can still see non-empty files (_labelling.csv, logMethods.json)

Moving to the step 4 ( for getting logEP for log-related methods): I faced another issue (shown below) with the command java -jar LogEPGen.jar -j ../hadoop-mapreduce-client-jobclient-2.6.4.jar -l log_methods.txt -o log_file.json -m 'log':

 -h,--help          Print usage
 -j,--jarName       Jar file to contain the Log Statements
 -l,--LogMethods    LogMethods to analyze
 -m,--matcher       Matcher for Log API
 -o,--Output        Output file

I understand that log_methods.txt should be produced after step 1 (but here the exception is not about the missing log_methods.txt file.

Thanks

YichenLi00 commented 11 months ago

Issue received. Could please provide the corresponding file and jdk version to me? I will help with issue in coming days.

alishan2040 commented 11 months ago

By corresponding file, did you mean the jar file I used? (if so I downloaded it from here: https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-mapreduce-client-jobclient/2.6.4/hadoop-mapreduce-client-jobclient-2.6.4.jar)

Here is the jdk version:

openjdk version "11.0.20.1" 2023-08-24
OpenJDK Runtime Environment (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

If you need other output files (e.g., _labelling.csv, logMethods.json), let me know and I'll share the link to those files.

Thanks for looking into the issue.

YichenLi00 commented 11 months ago

@alishan2040 Cloud you please rerun the updated tool which just been merged in our new bug fixing PR? I hope the updated version can solve your problem. Looking forward to your update.

alishan2040 commented 11 months ago

Hi @YichenLi00, the issue is gone for the first command, I can see the file log_methods.txt now.

However, I'm facing the following error while running the 2nd command java -jar javacg-0.1-SNAPSHOT-static.jar hadoop-mapreduce-client-jobclient-2.6.4.jar ... > cg.txt (the path to jar file is correct and the file exists).

Jar file ... does not exist
java.nio.file.NoSuchFileException: ...
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
    at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
    at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
    at java.base/java.nio.file.Files.readAttributes(Files.java:1764)
    at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1414)
    at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:742)
    at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:859)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:257)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:186)
    at java.base/java.util.jar.JarFile.<init>(JarFile.java:348)
    at java.base/java.util.jar.JarFile.<init>(JarFile.java:319)
    at java.base/java.util.jar.JarFile.<init>(JarFile.java:285)
    at gr.gousiosg.javacg.stat.JCallGraph.main(JCallGraph.java:72)

Is it okay to neglect this error as the cf.txt already produced?

And, at step 4, the issue still persists while running the command java -jar LogEPGen.jar --jarName ../hadoop-mapreduce-client-jobclient-2.6.4.jar --LogMethods log_methods.txt --Output log_file.json

usage: OptionsUsage
 -h,--help          Print usage
 -j,--jarName       Jar file to contain the Log Statements
 -l,--LogMethods    LogMethods to analyze
 -m,--matcher       Matcher for Log API
 -o,--Output        Output file

Let me know if you need more information.

YichenLi00 commented 9 months ago

Sorry I can not reproduce your bugs.. Could you please share the jar file you use? I will help you with that.

alishan2040 commented 9 months ago

Hi, the jar file I used is taken from here: https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-mapreduce-client-jobclient/2.6.4/hadoop-mapreduce-client-jobclient-2.6.4.jar

YichenLi00 commented 9 months ago

Hi, the jar file I used is taken from here: https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-mapreduce-client-jobclient/2.6.4/hadoop-mapreduce-client-jobclient-2.6.4.jar

Working on it..

YichenLi00 commented 9 months ago

Hi @alishan2040 , I still can not reproduce your issue. It seems a bug/path error with JavaCG, you can check the usage of this tool from https://github.com/gousiosg/java-callgraph. I hope this could help you well.