Vinicius Souza

Ranch Hand
+ Follow
since May 18, 2011
Vinicius likes ...
Netbeans IDE Chrome Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vinicius Souza

A long time ago, Marco Cognolato published a bat script that allow you to include jar libs into your jar. I use this script since I saw it in that post. But now I need a linux version of it. I am trying to convert it myself but I got some issues in the "for" command it uses a 'dir /b' etc... Well, did you know if anyone has converted this script to linux ? Thank you all and thanks Marco for share!
Hello my friends! I am very happy to announce : I found the problem!
It was really dumb mistake.... for those who want to know the problem was that I forgot to instanciate my array of object. See:
This is the old code:

This is the new fixed code:

Guys Im sorry for this dumb error, but thank you for all support!


4 years ago
Thank you I will, and I have more information:

This is what I get:

28/07/19 08:23:52: -> Titulo      : Titulo
28/07/19 08:23:52: -> Len         : 3
28/07/19 08:23:52: -> descricao   : 3
As you can see, the last line t.descricao[0].toString() doesnt execute. Null pointer.
But the length of the array descricao is 3 !!!
I never got an error like that, this is crazy! I will edit with the stack trace, thanks!


This is the stack trace:


This line is where the error occurs:
4 years ago

Knute Snortum wrote:That image is the top of a window.  What's the window?


This is the window of running the app in debug mode, since there's no config file the app runs without error bacause no object are created.
4 years ago
Ok, "t" is not null, I checked a lot.
If "t" is not null "t.descricao[i]" should not be null because:
"t" class is "Tabela" this is the Tabela second constructor:

"codigos.length" is 3, checked :-(
4 years ago
Well I use debug->Debug project or Ctrl+F5
In the image you can see where the debug runs:

The number changes every run in debug mode.
4 years ago

Returns an "Elemento" object previously created.
This is the class:

I use public beacause I am not using any design pattern, this code just works, or well worked.
4 years ago
I changed that line too:

The "lbl" is created correctly.
The error persists in the next line...
4 years ago
This is what Netbeans says:

Product Version: NetBeans IDE 8.2 (Build 201609300101)
Updates: Updates available to version NetBeans 8.2 Patch 2
Java: 1.8.0_171; Java HotSpot(TM) 64-Bit Server VM 25.171-b11
Runtime: Java(TM) SE Runtime Environment 1.8.0_171-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\user\AppData\Roaming\NetBeans\8.2
Cache directory: C:\Users\user\AppData\Local\NetBeans\Cache\8.2

4 years ago

Knute Snortum wrote:Please tell us a lot more about the project.  Did you use a wizard?  Which one?  Is this a Maven, Gradle, or ant project?  How are you running the project?  etc.


When I created this project, I have used "New JavaFX project", I think this uses Maven.
Lets me explain some things:
-This project is about create a eletronic display.
-This project were working since 2017.
Then I changed some objects yesterday and I starting get null point error. I uses java a lot to my project, but I am not an expert but not so beginner.
This project uses a lot of images that need to be read in the start, and a configuration file that configures the way that images are shown.
This project has a lot of threads, one verify if the file changed and reload the config file, another receiveis files from the network using TCP/IP, and others.
This is the why I need this files in the same place where the app runs, like I use java -jar appp.jar to run. But in the Play button doesnt work because the debugger creates another folder and put the jar inside.
In this post I want to know how to run the debugger in a Folder that I select. In another post I am questioning about the error itself.
https://coderanch.com/t/713580/java/error-drive-mad-null-pointer#3340998
Please, I need help because I need to put this software to work.... :-( if you dont mind I can send you the entire project if you want.
Thank you a lot!
4 years ago
Yes, null are crazy guys, but what is weird is that in the constructor of the "Tabela" class I initialize everithing.
See:


I really dont know whats going on.


See this is Tabela constructor. This code makes the array of "Elemento" object and set it to "descricao". The split returns an array of String. Checked.
"descricao" is an array of "Elemento" class:
I already printed all values.
-"t" objectr is defined. checked
- "i" has the value 0 checked
- "produto.getDescricao()" returns the produtc name. Checked
- "lbl" is a field if "Elemento" class. In the constructor is seted with null
- new Label() should return a new instance of "Label" class.
Omg, everithing is ok, and the error still. There are some other classes too but I think not to do with this error.
Its seems that new Label() is giviing the error.

4 years ago
Hello my friends, please help me with this error, I am since yesterday tyring to figure out what is causing the error but the code was corretc and started to give null pointer error. See the code:
* The line with the error is 276

Stack trace:
java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
       at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
       at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
       at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$154(LauncherImpl.java:182)
       at java.lang.Thread.run(Unknown Source)
Caused by: javafx.fxml.LoadException:
file:/C:/Sync/Criacoes%20Netsoft/NSDisplay/NSDisplay.jar!/br/com/netsoft/nsdisplay/main_fxml.fxml

       at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
       at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2579)
       at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
       at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
       at br.com.netsoft.nsdisplay.NSDisplay.start(NSDisplay.java:51)
       at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
       at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
       at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
       at java.security.AccessController.doPrivileged(Native Method)
       at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
       at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
       at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
       at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
       ... 1 more
Caused by: java.lang.NullPointerException
       at br.com.netsoft.nsdisplay.MainController.configuraTabelas(MainController.java:273)
       at br.com.netsoft.nsdisplay.MainController.lambda$inicializaTudo$1(MainController.java:96)
       at br.com.netsoft.nsdisplay.MainController.run(MainController.java:742)
       at br.com.netsoft.nsdisplay.MainController.inicializaTudo(MainController.java:95)
       at br.com.netsoft.nsdisplay.MainController.initialize(MainController.java:64)
       at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
       ... 12 more
Exception running application br.com.netsoft.nsdisplay.NSDisplay



The "conf" var is already populated. The Class "Tabela" is:


and the class "Elemento" is:


I still trying here to fix the problem but without sucess.



4 years ago

Randy Tong wrote:Can you show us how you read the file? And  where you place the file ?


My application is a JavaFX application and it uses a inifile to setup some configurations and load some image files too. These files are placed in the same place where the  applications runs. My problem is that I need to find a bug then I need to be able to run my app inside the Netbeans but the files I need to run are not there because Netbeans creates a Runxxxxx folder each time.
4 years ago
Hello friends!, When I runs my application inside Netbeans using Play button Netbeans create a folder inside dist folder with a random name. But my application need some especific files to run, so when I need to debug the app I cannot use the Netbeans debugger because I dont know what folder to put that files. Any solution for this issue ?
4 years ago
Hello my fellow friends!  I´m creating a JSF application using MySQL as DBMS and I´m troubled about char encoding. I want to use UTF-8 but there´s a lot of options. For what I want is that case insensitive searchings and international characters like ÁÇ etc.. What type of UTF8 should I use ?
5 years ago
JSF