Most voted "nullpointerexception" questions
Use this tag when the question refers to some information or problem relating exclusively to Nullpointerexception. An exception of type Nullpointerexception, is thrown by Java when an application tries to access an object but its reference is null.
Learn more…201 questions
Sort by count of
-
0
votes1
answer708
viewsTreating null Pointer Exception
I’m getting, in my back end, a json object from the screen this way: { "pessoa": { "nome": "aa", "nomeSocial": "aa", "tipoPessoa": "F", "nomePai":"", "dataNascimento": "15/06/1983", "nomeMae": "a"…
-
0
votes1
answer518
viewsError: java.lang.Nullpointerexception in project using JDBC
Could help me with the error below, it is a, I have error in lines 14 of the class Testalista and error in line 32 of the class ContatoDao. Exception in thread "main" java.lang.NullPointerException…
-
0
votes2
answers182
viewsNullpointerexception when obtaining latitude and longitude
I am developing a mobile application with Android Studio that aims to get the information of latitude and longitude and use the service of Google Geocoder to return the address of the geographical…
-
0
votes1
answer54
viewsNull Context when Generating PDF
I’m starting my studies on Android programming and I’m having a hard time understanding how to fix the error presented when debugging the app to generate PDF. E/Androidruntime: FATAL EXCEPTION: main…
-
0
votes1
answer62
viewsNullpointer Exception when entering data into a Foreign key
I am facing some problems with entering data in my clients table. Specifically with foreign keys fk_telefone_fisico and fk_telefone_juridico. When I register the user ee gives me a…
-
0
votes1
answer89
viewsJava.lang.Nullpoinerexception when trying to insert database data into a Jcombobox
Today my team and I came across a problem trying to do something seemingly simple: display a clerk’s surname in a Jcombobox. The problem is that when opening the screen we receive a…
-
0
votes2
answers65
viewsNullpointerexception error on execution
Hello. Once again I’m having Nullpointerexception error. I can’t identify why. The activity is as follows : Create a Java app to control the weekly menu of Nutrition Clinic patients. You should…
-
0
votes1
answer54
viewsUnchanging collection adding strings
I’m starting java programming and I’m having a problem creating an immutable collection. Below is what I created: package br.com.estudos; import java.util.Collection; public class…
-
0
votes0
answers68
viewsjava.lang.Nullpointerexception - Having to add a user to the database but points out this exception
Follow the code of the connection to the database, the user class and the code already in jframe: /* * To change this license header, choose License Headers in Project Properties. * To change this…
-
0
votes0
answers63
viewsError in Android Nullpointerexception application
I’m trying to create an android application that generates buttons dynamically on the screen, but I’m getting an error NullPointerException and I don’t know how to treat him. Someone who has the…
-
0
votes1
answer552
viewsError: The object reference was not defined as an instance of a C#object
I wanted to make a table in console but all ran the program appears error in the method AlunoLista(), I’ve tried to make changes but I can’t get there. static void Main(string[] args) { var client =…
-
0
votes0
answers58
viewsI’m trying to list a client’s orders but there’s an error in the DAO that I can’t identify
Button calling the page listing requests: <p:commandButton value="Avançar" id="avancar" action="#{clienteMB.avancarPedido(pedido)}" styleClass="ui-priority-primary" ajax="false"/> Method…
-
0
votes1
answer1190
viewsUnity Object Reference not set to an instance of an Object
I’m doing a quiz in Unity and I have an error that I can’t solve, I’ve researched similar errors but I can’t identify, this message appears when I’m running the quiz Nullreferenceexception: Object…
-
0
votes1
answer115
viewsUndefined object reference for an object instance. Array
Hi, My problem is in the array following this code: mesh meshCube; string[] file = File.ReadAllLines("object.mind"); foreach (string filetext in file) { if (filetext.Contains("v")) { string ext =…
-
0
votes1
answer32
viewsAsynctask and Adapter for Listview in conflict
I’m creating a chat app using socket and after developing all the layout I decided to enter the connection part... the problem is that when I receive messages the app closes and presents some…
-
0
votes0
answers23
viewsNullpointerexception
I have a button that takes 2 text fields and sends to Mysql by MVC standard only it is giving a java.lang.Nullpointerexception q do not know how to solve The code of the button private void…
-
0
votes1
answer59
views(Java) Read TXT (input) and generate TXT (output) with organized information
I need to make the following logic: 1- Read a txt with several lines, each line has an activity EX: Walk 10min, Study 30min... (each activity in a row). 2- Half day lunch time. 3- Organize the…
-
0
votes1
answer259
viewsHow to test Controller with Junit?
I’m testing the URL like this package br.com.aluguel.de.carros.unidade.usuario; import br.com.aluguel.de.carros.endereco.Endereco; import br.com.aluguel.de.carros.usuario.Usuario; import…
-
0
votes0
answers135
viewsObject Reference not set to an instance of an Object - Does not display error message
My system (WEBFORMS VB.NET) has presented a null object exception(Object Reference not set to an instance of an Object), which happens only on the production server after an indefinite period of…
-
0
votes1
answer822
viewsHow to resolve error C# "Nullreferenceexception: Object Reference not set to an instance of an Object."?
I’m trying to finish a project only that is showing error on the foreach part, and in VSCODE does not report any problem. I’m learning C# now and I can’t figure it out on my own. this is…
-
0
votes0
answers47
viewsError calling endpoint: Exception has occurred: CLR/System.Nullreferenceexception C#
Guys, I’m trying to generate a spreadsheet filled with the data I have from SQL server, I can get that information right but when I call a method responsible for taking that information and…
-
0
votes1
answer57
viewsNullreferenceexception with Unity
I am having this error when trying to implement a theme search system in the database. The chronological order of events is as follows: A screen is shown for the user to enter the desired questions,…
-
0
votes0
answers8
viewsPage.Loadcontrol does not load the controls
I am using the Page.Loadcontrol() method to initialize an instance of a control by sending a parameter in the constructor. The instance is created, but the controls present in the file . ascx are…
-
-1
votes1
answer516
viewsNullpointerexception at java.io.File. <init>(Unknown Source) in Java with Lucene
I’m getting the following error in my Java code Exception in thread "Thread-2" java.lang.NullPointerException at java.io.File.<init>(Unknown Source) at…
-
-1
votes2
answers318
viewsjava.lang.nullPointerException Error
I’m doing an exercise in Java and it requires me to create a product note sold, containing random numbers plus the first three letters of the customer as product code, but when I try to generate the…
-
-1
votes2
answers112
viewsHelp in Nullpointer Exception
Before the data goes to the bank I’m with a nullpointer that already debugged and I can’t find where the problem is. Down with my classes: package br.com.pokemax.controle; import…
-
-1
votes1
answer430
viewsHow to resolve Nullpointerexception error in android studio 2.3?
I am with android studio 2.3, and since I updated it has been giving this error: would like to know how to revolve this. Android studio is not affected...continues working normal, but this is very…
-
-1
votes1
answer193
viewsError entering database data into Jtable
I’m having a problem loading the data into a Jtable, use BD Derby, the database connection works more when trying to open the Jframe Cad_usuarios appears the error below: Exception in thread…
-
-1
votes1
answer118
viewsHelp with Java Pointer Error
I’m doing a Bank Queue project with priority, I did everything the way I learned, but this giving some null pointer error that I’m not able to understand, could someone please help me understand…
-
-1
votes1
answer261
viewsjava.lang.Nullpointerexception error
I have this mistake and I can’t find the problem. Exception in thread "AWT-Eventqueue-0" java.lang.Nullpointerexception at windows.TelaPrincipal.getUserList(Telaprincipal.java:53) at…
-
-1
votes1
answer40
viewsProblem calling a method on a jlabel
Good am trying to make an application in 2 screens the first to set the values and the second screen to exit the values the first is working normal Code: /* * To change this license header, choose…
-
-1
votes3
answers377
viewsProblem with array in Java
I am trying to create a calendar of contacts in java, I am using some classes that were requested in the exercise. the main class: import java.util.Scanner; public class Lista15Q03 { public static…
-
-1
votes1
answer111
viewsJava code error read GSON: java.lang.Nullpointerexception
I’m trying to read this file but when I run it shows this error: Exception in thread "main" java.lang.NullPointerException at principa.Main.main(Main.java:61) but I do not know what this null public…
-
-1
votes1
answer1242
viewsjava.lang.Nullpointerexception: Attempt to invoke virtual method 'java.lang.String java.lang.String.toString()' on a null Object Reference
I have a problem on line 141, where it says that the string is null and points out the error on this line JSONObject jsonObject = new JSONObject(response.body().toString()); However I am not able to…
-
-1
votes1
answer46
viewsJava Nullpointerexception error in construction
main java. package projeto; import java.sql.*; import javax.swing.JOptionPane; import java.sql.Connection; import java.sql.Statement; import java.sql.DriverManager; import java.sql.ResultSet; import…
-
-1
votes1
answer47
viewsI cannot compile my program because I have an error that says "Nullpointerexception"
I’m trying to build a Java project according to the concepts of object-oriented programming. However the compiler(ECLIPSE) accuses an error in the line of my liigar function. It says it has a…
-
-1
votes1
answer63
viewsTransition of activities with serializable classes (getIntent problem)
I have a problem while passing a serializable class. I insert it into the Bundle as follows. public void voltarMain(View view) { Intent myIntent = new Intent(getApplicationContext(),…
android android-activity nullpointerexception serialization android-intentasked 5 years ago Filipe Torres 1 -
-1
votes1
answer45
viewsjava.lang.Nullpointerexception error even with instantiated and initialized object
Good afternoon, In the code below I have already entered the Supplier class within the main Product and even so continues the error below, Can someone help me fix and explain why it’s wrong so…
java classes nullpointerexception instantiate-object initializationasked 4 years, 6 months ago Deivson Bezerra 149 -
-1
votes1
answer46
viewsAndroid Studio Error: Unable to start Activity
I’m doing a basic CRUD with Realmdb. I made a list, and when some item of this list is selected, it is to open an Update Activity, where you can change the selected data. The problem is that the…
android-studio android-activity nullpointerexception realmdbasked 4 years, 2 months ago Vinicius Sergio 11 -
-1
votes1
answer12
viewsError Inserting icon in Jmenu
Good Morning to all, I’m with a java project using Netbeans IDE 12.0, when trying to insert images as icon in the Item Menu and running the form introduces me to Exception nullpointerexception,…
-
-2
votes2
answers187
viewsNullpointerexception JPA with springboot
I have a problem that I believe is simple, but I’m having a hard time. To be more clear, I will summarize the idea of the project: I have a Client class and an Update class. The update class has as…
-
-2
votes2
answers183
viewsjava.lang.Nullpointerexception
Main class presenting problem in the call of the method createNew: case 1: cliente = new Cliente(); cliente.setNome(JOptionPane.showInputDialog("Nome: ")); cliente.setCpf(Long.parseLong(JOptionPane…
-
-2
votes1
answer4784
viewsException error in thread "main" java.lang.Nullpointerexception
So I’m trying to make a program that adds 2 vectors via Thread, but he makes the following mistake: Exception in thread "main" java.lang.Nullpointerexception At Soma. (Main.java:37) At…
-
-2
votes3
answers323
viewsHow to prevent a System.Nullreferenceexception within an if
I’m developing a web application where a photographer does upload of an image. After uploading the image, I will scan the entire Metadata in order to capture some information from directories (Exif,…
-
-2
votes1
answer32
viewsProblems when registering at the bank
Friends, I have a system to control productivity of each analyst, I am a beginner and I am starting with JSP and SERVLET + JPA and I have the following scenario: I am trying to register an analyst…
-
-2
votes2
answers145
viewsWhat are the disadvantages of protecting a string of objects from a nullPointerException using the optional map?
For example: public static void main(String[] args) { Cidade cidade = new Cidade(); Estado estado = new Estado(cidade); Endereco endereco = new Endereco(estado); Loja loja = new Loja(endereco);…
-
-3
votes3
answers149
viewsCheck two denials in an if expression
I’m putting this on: if(!teste.trim().equals("") || (!(teste == null))){ // ...faz algo sem NullPointerException... } But the second clause is not working, the one that tests if it is not null. I…
-
-3
votes1
answer186
viewsNullpointerexception - Genetic Algorithm
package chapter2; public class AllOnesGA { public static void main(String[] args) { //Cria instância da classe "GeneticAlgorithm" GeneticAlgorithm ga = new GeneticAlgorithm(100, 0.01, 0.95, 0);…
-
-3
votes1
answer213
viewsJava Attempt to invoke virtual method error 'android.view.Window$Callback android.view.Window.getCallback()' on a null Object Reference
Folks need a help with an error in a method of my code. Basically I have a Framelayout that loads two Fragments. When starting the APP it loads the first Fragment with 3 Textedits and a button. When…
-
-3
votes1
answer37
viewsProblems with Nullpointerexception in a class
I have this code below that throws me the exception of NullPointerException. Besides, oddly enough he’s not "printing" anything,? import java.io.BufferedReader; import java.io.File; import…