yamcs / quickstart

Get started with Yamcs
https://yamcs.org
22 stars 22 forks source link

Could not start Yamcs: java.lang.NullPointerException in WebFileDeployer.java #26

Closed altsv closed 4 months ago

altsv commented 4 months ago

Hello,

I'm running into the following error when attempting to run the quickstart: Yamcs: java.lang.NullPointerException in WebFileDeployer.java This error occurs starting with 030698d4fd7bb3918ff207a298b52eb6d6cfb9d7. 33239f52c starts up YAMCS as expected.

Full error log:

PS C:\Users\Simon\Desktop\Projects\yamcs-quickstart> ./mvnw yamcs:run
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< com.example:myproject >------------------------
[INFO] Building My Project 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> yamcs-maven-plugin:1.3.0:run (default-cli) > process-classes @ myproject >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Simon\Desktop\Projects\yamcs-quickstart\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) @ myproject ---
[INFO] Nothing to compile - all classes are up to date.
[INFO]
[INFO] --- yamcs-maven-plugin:1.3.0:detect (default) @ myproject ---
[INFO] 
[INFO] <<< yamcs-maven-plugin:1.3.0:run (default-cli) < process-classes @ myproject <<<
[INFO]
[INFO] 
[INFO] --- yamcs-maven-plugin:1.3.0:run (default-cli) @ myproject ---
[INFO] Creating configuration at C:\Users\Simon\Desktop\Projects\yamcs-quickstart\target\yamcs
10:22:57.297 _global [1] YamcsServer Loading service HttpServer
10:22:57.531 _global [1] RdbStorageEngine Creating or loading tablespace _global
10:22:57.587 _global [1] Tablespace [_global] Opened tablespace database yamcs-data\_global.rdb
10:22:57.587 _global [1] Tablespace [_global] Records: ~3, metadata records: ~14, maxTbsIndex: 8
10:22:57.626 _global [1] Tablespace [_global] Loaded 3 tables for instance _global
10:22:57.996 _global [1] YamcsServer Loading online instance 'myproject'
10:22:58.118 _global [1] MdbFactory Loaded XTCE DB from C:\Users\Simon\Desktop\Projects\yamcs-quickstart\target\yamcs\cache\FCCE5FBF364C921513F636407D5EE5227B3BECE4.serialized with 3 containers, 40 parameters and 5 commands
10:22:58.118 _global [1] RdbStorageEngine Creating or loading tablespace myproject
10:22:58.165 _global [1] Tablespace [myproject] Opened tablespace database yamcs-data\myproject.rdb
10:22:58.165 _global [1] Tablespace [myproject] Records: ~14, metadata records: ~122, maxTbsIndex: 116
10:22:58.186 _global [1] Tablespace [myproject] Loaded 15 tables for instance myproject
10:22:58.195 myproject [1] YamcsServerInstance Loading service XtceTmRecorder
10:22:58.198 myproject [1] YamcsServerInstance Loading service ParameterRecorder
10:22:58.199 myproject [1] YamcsServerInstance Loading service AlarmRecorder
10:22:58.200 myproject [1] YamcsServerInstance Loading service EventRecorder
10:22:58.201 myproject [1] YamcsServerInstance Loading service ReplayServer
10:22:58.201 myproject [1] YamcsServerInstance Loading service SystemParametersService
10:22:58.204 myproject [1] YamcsServerInstance Loading service ProcessorCreatorService
10:22:58.204 myproject [1] YamcsServerInstance Loading service CommandHistoryRecorder
10:22:58.206 myproject [1] YamcsServerInstance Loading service ParameterArchive
10:22:58.212 myproject [1] YamcsServerInstance Loading service ParameterListService
10:22:58.213 myproject [1] YamcsServerInstance Loading service TimelineService
10:22:58.610 myproject [1] ProcessorFactory [realtime] Loading processor service StreamTmPacketProvider
10:22:58.612 myproject [1] ProcessorFactory [realtime] Loading processor service StreamTcCommandReleaser
10:22:58.613 myproject [1] ProcessorFactory [realtime] Loading processor service StreamParameterProvider
10:22:58.614 myproject [1] ProcessorFactory [realtime] Loading processor service AlgorithmManager
10:22:58.624 myproject [1] ProcessorFactory [realtime] Loading processor service LocalParameterManager
10:22:58.626 myproject [1] Processor Creating new processor 'realtime' of type 'realtime'
10:22:58.722 _global [1] YamcsServer Yamcs 5.9.6, build b7544c20d2fae5353cf95b3e344067e7aa63bdbe
10:22:58.835 _global [1] YamcsServer Could not start Yamcs: java.lang.NullPointerException
        java.base/java.util.Objects.requireNonNull(Objects.java:209)
        java.base/java.nio.file.Files.copy(Files.java:3128)
        org.yamcs.web.WebFileDeployer.deployWebsiteFromClasspath(WebFileDeployer.java:158)
        org.yamcs.web.WebFileDeployer.<init>(WebFileDeployer.java:113)
        org.yamcs.web.WebPlugin.onLoad(WebPlugin.java:62)
        org.yamcs.PluginManager.loadPlugins(PluginManager.java:136)
        org.yamcs.YamcsServer.start(YamcsServer.java:1245)
        org.yamcs.YamcsServer.main(YamcsServer.java:1013)

10:22:58.836 _global [27] YamcsServer Yamcs is shutting down
10:22:58.839 _global [27] YamcsServer Stopped instance 'myproject'
10:22:58.839 _global [27] YamcsServer Awaiting termination of service HttpServer
10:22:58.851 _global [27] YamcsServer Yamcs stopped in 14ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.306 s
[INFO] Finished at: 2024-06-20T10:22:58-07:00
[INFO] ------------------------------------------------------------------------

Maven Version:

PS C:\Users\Simon\Desktop\Projects\yamcs-quickstart> mvn -v
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: C:\Program Files\Maven\apache-maven-3.9.6
Java version: 17.0.11, vendor: Microsoft, runtime: C:\Program Files\Microsoft\jdk-17.0.11.9-hotspot
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Please let me know if this is a problem on my end. Thank you!

fqqb commented 4 months ago

The exception comes from not being able to locate the website in the JAR files, which is a little weird.

My first guess would be that maybe you're using a self-compiled version of Yamcs 5.9.6, and did not compile the webapp (?).

Can you check contents of ~/.m2/repository/org/yamcs/yamcs-web/5.9.6/yamcs-web-5.9.6.jar.sha1 ? It should show: 1f739ab6de068486ce7f362a1f50228115ce3456, same as https://repo.maven.apache.org/maven2/org/yamcs/yamcs-web/5.9.6/yamcs-web-5.9.6.jar.sha1

altsv commented 4 months ago

@fqqb Thanks so much for the quick reply!

Here is what my quickstart directory looks like: image

I apologize if I am misinterpreting the question since I am new to Java/Docker, but there does not appear to be any .jar files or .sha1 hash files when I search my quickstart directory. All I am doing is running ./mvnw yamcs:run. I also tried running ./mvnw compile then ./mvnw yamcs:run to no avail.

Should I be looking somewhere else? Or are there any other commands I should run?

fqqb commented 4 months ago

The path I gave is in your home directory, there should be a .m2 there. That's where maven saves downloaded (or self-compiled) JARs.

altsv commented 4 months ago

@fqqb I deleted that folder to reset, re-cloned and recompiled, and now it seems to have fixed itself. Thank you for the help!