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

java.lang.NullPointerException after DeepfakeHTTP start #23

Open
jhrdt opened this issue Jan 25, 2022 · 1 comment
Open

java.lang.NullPointerException after DeepfakeHTTP start #23

jhrdt opened this issue Jan 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jhrdt
Copy link

jhrdt commented Jan 25, 2022

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": [
        "[email protected]",
        "[email protected]"
    ],
    "fname": "John",
    "id": 123,
    "lname": "Doe"
}
@xnbox xnbox added the bug Something isn't working label Jan 26, 2022
@bernd-wechner
Copy link

Ah, I was just going to report similar. I am using:

$ java --version
openjdk 17.0.2 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17.0.2+8-Ubuntu-120.04, mixed mode, sharing)
$ java -jar df-6.4.3.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)
	at org.tommy.common.JarRsrcLoaderMain.main(JarRsrcLoaderMain.java:56)
Caused by: java.lang.NullPointerException
	at java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
	at java.base/java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
	at java.base/java.util.Properties.put(Properties.java:1301)
	at java.base/java.util.Properties.setProperty(Properties.java:229)
	at java.base/java.lang.System.setProperty(System.java:999)
	at org.tommy.common.utils.ManifestUtils.extractBuildDataFromManifest(ManifestUtils.java:61)
	at org.tommy.main.Main.main(Main.java:112)
	... 6 more

Not the same issue, but a NullPointerException all the same, and my first thought was "I'm using OpenJDK and should try Java proper"? But I haven't done that yet ;-)

Alas, I'm not set up for Java development, or I'd drill down a bit to see if there was an obvious problem.

But I guess one thing to maybe include in the README is the know Java versions that are working (have been tested or are being used be devs). Because the first time it didn't work was because I have OpenJDK 11 I think. It complained that it was compiled with a later version of Java anyhow, so I upgraded to 17 which is the latest in the Ubuntu repos.

nodiscc added a commit to awesome-selfhosted/awesome-selfhosted-data that referenced this issue Sep 23, 2023
- reports that the application doesn't start: xnbox/DeepfakeHTTP#23
- missing instructions to build from source
- ref. #1
nodiscc added a commit to awesome-selfhosted/awesome-selfhosted-data that referenced this issue Sep 24, 2023
- reports that the application doesn't start: xnbox/DeepfakeHTTP#23
- missing instructions to build from source
- ref. #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants