Question Embeddable UI input stream

Discussion in 'Developer Support' started by Crash, Jul 1, 2016.

  1. I've asked about this on the developers chat, but only got one response that didn't work. So I'll post it here.
    I've implemented an embeddable ui and when I run my bot on my system through intellij it works fine, but when I run it from the bot store I receive the error because of a null pointer from the input stream. I assume it means it can't find the resource, but I honestly do not know why. Any and all help is greatly appreciated. Thanks in advance.

    Null Pointer
    Code (Text):
    1. java.util.concurrent.ExecutionException: java.lang.NullPointerException: inputStream is null.
    2.  at
    3.  at java.util.concurrent.FutureTask.get(
    4.  at nul.iiiIIIiiiiiI.initialize(jna:88)
    5.  at javafx.fxml.FXMLLoader.loadImpl(
    6.  at javafx.fxml.FXMLLoader.loadImpl(
    7.  at javafx.fxml.FXMLLoader.load(
    8.  at nul.iiiiiiiiiIii.byte(xh:156)
    9.  at nul.iiiiiiiiiIii.byte(xh:209)
    10.  at nul.iiiIIIiiiiiI.(jna:137)
    11.  at nul.IIIiIIiiIiIi.byte(slb:1)
    12.  at nul.iIiIiIiIIIii.byte(zsa:22)
    13.  at nul.IiiIiIiiIIIi.byte(mqa:1046)
    14.  at
    15.  at javafx.concurrent.Task$
    16.  at
    17.  at
    18. Caused by: java.lang.NullPointerException: inputStream is null.
    19.  at javafx.fxml.FXMLLoader.loadImpl(
    20.  at javafx.fxml.FXMLLoader.load(
    21.  at com.crash.bots.agil_titan.ui.AgilFXGui.(
    22.  at com.crash.bots.agil_titan.Agil_Titan.botInterfaceProperty(
    23.  at
    24.  at java.util.concurrent.ThreadPoolExecutor.runWorker(
    25.  at java.util.concurrent.ThreadPoolExecutor$
    26.  ... 1 more

    Code (Text):
    1. public class AgilFXGui extends GridPane implements Initializable {
    3.     @Override
    4.     public void initialize(URL arg0, ResourceBundle arg1) {
    5.         setVisible(true);
    6.     }
    8.     public AgilFXGui(Agil_Titan bot) {
    10.         FXMLLoader loader = new FXMLLoader();
    12.         Future<InputStream> stream = bot.getPlatform().invokeLater(() -> Resources.getAsStream("com/crash/bots/agil_titan/ui/AgilGui.fxml"));
    14.         loader.setController(new AgilUIController(bot));
    16.         loader.setRoot(this);
    18.         try {
    19.             loader.load(stream.get());
    20.         } catch (IOException | InterruptedException | ExecutionException e) {
    21.             System.err.println("Error loading GUI");
    22.             e.printStackTrace();
    23.         }
    25.     }
    26. }
    Line 42 is : loader.load(stream.get());
  2. Did you make sure that all the files are committed to the svn and that each of the .fxml files are resources in your manifest?

    AlexH666 likes this.
  3. Yes make sure it's set as a resource in manifest.
    Also last time, intellij for some reason did not commit the fxml files by itself until I forced it.
    awesome123man likes this.
  4. Yeah all my resources are listed in the manifest. I made sure of that.

    ^^ in manifest. IntelliJ committed all my fxml files, which is why I'm so confused/lost.
  5. You must have not declared all your fx:id things in your fxml files. In each controller you need to make sure you at least declare all of them :D

    These are the two items i gave fx:id's in my cookingfxGui.fxml
    which i declare in my as v

    private ComboBox Location_ComboBox;

    private Button Start_BT;
  6. Nope, I just double checked and they're all declared. :(
    I'm convinced RuneMate/Spectre hates me. You don't even want to know what I had to go through just to be able to successfully set up the svn. It was hell and involved me reformatting my hard drive. It's a long story.
    Any other ideas?
  7. Please share the manifest resource element
    --- Double Post Merged, Jul 1, 2016, Original Post Date: Jul 1, 2016 ---
    Sounds like an issue on your end because it's never been that difficult for anyone. It's as simple as opening intellij and checking out from your svn url
  8. show us
    and Plz

    Or go on teamviewer with one of us :p
  9. Yeah the svn thing was definitely on my end, which is why I had to jump through so many hoops.

    Okay guys, I feel like an idiot because I just looked at the manifest for both bots. Each bot uses 2 fxml files, but I forgot to list one for each bot. On top of that, for the agil bot I referenced the completely wrong main fxml file. I'm thinking this is most certainly the issue?
  10. You are thinking correct :D

Share This Page