Open
Description
Hi,
my startup gives me the following response. Everything works fine, but I am curious about the java.lang.NullPointerException
after the DeepfakeHTTP start.
Using Ubuntu's openjdk-17-jdk-headless
package.
❯ java -jar df-6.4.2.jar --dump dump.txt
2022-01-25 13:13:46 INFO Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
2022-01-25 13:13:46 INFO Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
2022-01-25 13:13:46 INFO Server version name: Apache Tomcat/10.0.10
2022-01-25 13:13:46 INFO Server built: Jul 30 2021 09:51:27 UTC
2022-01-25 13:13:46 INFO Server version number: 10.0.10.0
2022-01-25 13:13:46 INFO OS Name: Linux
2022-01-25 13:13:46 INFO OS Version: 5.13.0-27-generic
2022-01-25 13:13:46 INFO Architecture: amd64
2022-01-25 13:13:46 INFO Java Home: /usr/lib/jvm/java-17-openjdk-amd64
2022-01-25 13:13:46 INFO JVM Version: 17.0.1+12-Ubuntu-120.04
2022-01-25 13:13:46 INFO JVM Vendor: Private Build
2022-01-25 13:13:46 INFO CATALINA_BASE: /tmp/catalina_base-9622103583921507216
2022-01-25 13:13:46 INFO CATALINA_HOME: /tmp/catalina_home-17115209648337543168
2022-01-25 13:13:46 INFO The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
2022-01-25 13:13:47 INFO Initializing ProtocolHandler ["http-nio-8080"]
2022-01-25 13:13:47 INFO Server initialization in [1493] milliseconds
2022-01-25 13:13:47 WARNING A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
2022-01-25 13:13:47 INFO Starting service [Catalina]
2022-01-25 13:13:47 INFO Starting Servlet engine: [Apache Tomcat/10.0.10]
2022-01-25 13:13:48 INFO Unknown class loader [jdk.internal.loader.ClassLoaders$PlatformClassLoader@6009e3f5] of class [class jdk.internal.loader.ClassLoaders$PlatformClassLoader]
2022-01-25 13:13:53 INFO At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2022-01-25 13:13:53 INFO DeepfakeHTTP Logger: HELLO!
2022-01-25 13:13:53 INFO File: "dump.txt" found 1 entries.
2022-01-25 13:13:53 INFO 1 file(s) processed. 1 entries found.
2022-01-25 13:13:53 INFO 1 dump file(s) loaded.
2022-01-25 13:13:53 INFO 0 JavaScript file(s) loaded.
2022-01-25 13:13:53 INFO Data file loaded.
DeepfakeHTTP started.
java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.register(java.nio.file.WatchService, java.nio.file.WatchEvent$Kind[])" because "this.dirPath" is null
at org.deepfake_http.common.dir_watcher.DirectoryWatcher.run(DirectoryWatcher.java:53)
at java.base/java.lang.Thread.run(Thread.java:833)
Starting ProtocolHandler ["http-nio-8080"]
Tommy started.
Test:
❯ http http://localhost:8080/api/customer/123
HTTP/1.1 200
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: *
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 117
Content-Type: application/json
Date: Tue, 25 Jan 2022 12:18:48 GMT
ETag: "f97ade2e"
Keep-Alive: timeout=20
Server: DeepfakeHTTP v6.4.2 (2022-01-23 14:42:00)
{
"email": [
"john@example.com",
"johndoe@example.com"
],
"fname": "John",
"id": 123,
"lname": "Doe"
}