Springboot getResourceAsStream Returns NULL

tags: SpringBoot Debug  java

  1. For readingsrc/main/resources/levelBelowSampleGame.skb,must uselevel/SampleGame.skb
    If used/level/SampleGame.skbBe usedin = null,Unable to read.
  2. IfSampleGame.skbPut them directlysrc/main/resources/Next, the corresponding should begetResourceAsStream("SampleGame.skb");
    void loadDefaultSaveFile(Stage primaryStage) {
        this.primaryStage = primaryStage;
        InputStream in = getClass().getClassLoader().getResourceAsStream("level/SampleGame.skb");
        System.out.println(in);
        initializeGame(in);
        setEventFilter();
    }

Intelligent Recommendation

Springboot Returns the processing of JSON data to NULL values

Springboot Returns the processing of JSON data to NULL values Reference website: https://mp.weixin.qq.com/s/y7RXiF9ENxYnLWN_jdWbRg Spring boot Returns JSON Data and Data Package I have been included i...

SpringBoot Process Returns NULL attribute in JSON

SpringBoot Process Returns NULL attribute in JSON Add in the physical class @JsonInclude(JsonInclude.Include.NON_EMPTY) annotation...

Springboot returns to the NULL attribute value in JSon, not transferred

Method 1, using @jsoninclude (jsoninclude.include.non_null) 1. If the property is placed, the serialization is not participated if the property is NULL; 2. If placed on the class, the all attributes o...

Springboot interface Returns NULL Response 404

Hello,I’m Shendi When my interface is maliciously accessed, I want to return to 404 to achieve the purpose of making it does not exist. Article catalog Implementation Allow scanning servlet anno...

SpringBoot returns results if NULL or empty value is not displayed

You need to configure this tool class. I have seen other sharing and said that these two only need one, but I tried it and found that it can be configured at the same time. If you are interested, you ...

More Recommendation

SpringBoot control returns null value is replaced with a null string

SpringBoot control returns null value is replaced with a null string  ...

Springboot + mybtisplus Returns NULL All Elements Are Null in LIST

Problem: There is a NULL in the list What is this reason? Emergency, I can't find a few posts. I finally analyze SQL carefully and found that it was connected to it. Hey, After the revision is followe...

Solve the null problem with getResourceAsStream in IntelliJ IDEA

To solve this problem is very simple: windows version press the shortcut key alt + shift + ctrl + s mac:command + ; Enter the module configuration, select the module you are using, click sources, crea...

Record that the content of the json file obtained with getResourceAsStream is null

Yesterday I wanted to use getResourceAsStream to get the content of the json file in the resources, and found that it was always null Finally, I changed the uppercase of the first letter of the file n...

GetresourceASSTREAM in Java Return to NULL problem processing

GetresourceASSTREAM in Java Return to NULL problem processing: The main reason for this problem is the setting of the source: ​ In our commonly used IDEA, the input stream returned with GetResourceASS...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top