Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Embeddable UI input stream

Chronus
Joined
Jan 9, 2016
Messages
33
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:
java.util.concurrent.ExecutionException: java.lang.NullPointerException: inputStream is null.
 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
 at java.util.concurrent.FutureTask.get(FutureTask.java:192)
 at nul.iiiIIIiiiiiI.initialize(jna:88)
 at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
 at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
 at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
 at nul.iiiiiiiiiIii.byte(xh:156)
 at nul.iiiiiiiiiIii.byte(xh:209)
 at nul.iiiIIIiiiiiI.(jna:137)
 at nul.IIIiIIiiIiIi.byte(slb:1)
 at nul.iIiIiIiIIIii.byte(zsa:22)
 at nul.IiiIiIiiIIIi.byte(mqa:1046)
 at nul.IiiIiIiiIIIi.call(mqa:2269)
 at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: inputStream is null.
 at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2455)
 at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425)
 at com.crash.bots.agil_titan.ui.AgilFXGui.(AgilFXGui.java:42)
 at com.crash.bots.agil_titan.Agil_Titan.botInterfaceProperty(Agil_Titan.java:69)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 ... 1 more



AgilFXGui
Code:
public class AgilFXGui extends GridPane implements Initializable {

    @Override
    public void initialize(URL arg0, ResourceBundle arg1) {
        setVisible(true);
    }

    public AgilFXGui(Agil_Titan bot) {
       
        FXMLLoader loader = new FXMLLoader();
       
        Future<InputStream> stream = bot.getPlatform().invokeLater(() -> Resources.getAsStream("com/crash/bots/agil_titan/ui/AgilGui.fxml"));
       
        loader.setController(new AgilUIController(bot));
       
        loader.setRoot(this);

        try {
            loader.load(stream.get());
        } catch (IOException | InterruptedException | ExecutionException e) {
            System.err.println("Error loading GUI");
            e.printStackTrace();
        }

    }
}

Line 42 is : loader.load(stream.get());
 
Go check out new bots and give helpful feedback.
Joined
Jan 31, 2016
Messages
5,413
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?

Ex.
<resource>com/daugherty2016/bots/CookingDawg/CookingGui.fxml</resource>
<resource>com/daugherty2016/bots/CookingDawg/CookingInfoUI.fxml</resource>
 
Χ Ξ Σ
Joined
Apr 15, 2016
Messages
379
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.
 
Chronus
Joined
Jan 9, 2016
Messages
33
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?

Ex.
<resource>com/daugherty2016/bots/CookingDawg/CookingGui.fxml</resource>
<resource>com/daugherty2016/bots/CookingDawg/CookingInfoUI.fxml</resource>

Yeah all my resources are listed in the manifest. I made sure of that.

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.

^^ in manifest. IntelliJ committed all my fxml files, which is why I'm so confused/lost.
 
Go check out new bots and give helpful feedback.
Joined
Jan 31, 2016
Messages
5,413
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 cookingFxController.java as v

@FXML
private ComboBox Location_ComboBox;

@FXML
private Button Start_BT;
 
Chronus
Joined
Jan 9, 2016
Messages
33
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 cookingFxController.java as v

@FXML
private ComboBox Location_ComboBox;

@FXML
private Button Start_BT;

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?
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,772
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.
Please share the manifest resource element
 
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?
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
 
Go check out new bots and give helpful feedback.
Joined
Jan 31, 2016
Messages
5,413
show us
AgilGui.fxml
and AgilFxController.java Plz

Or go on teamviewer with one of us :p
 
Chronus
Joined
Jan 9, 2016
Messages
33
Please share the manifest resource element
 

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

Yeah the svn thing was definitely on my end, which is why I had to jump through so many hoops.

show us
AgilGui.fxml
and AgilFxController.java Plz

Or go on teamviewer with one of us :p


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?
 
Go check out new bots and give helpful feedback.
Joined
Jan 31, 2016
Messages
5,413
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?
You are thinking correct :D
 
Top