15,957 questions
Advice
0
votes
1
replies
44
views
In which scenario the UsersRequestBuilder.get() from Microsoft Graph SDK will return null?
I am using the com.microsoft.graph.serviceclient.GraphServiceClient class to retrieve users:
UserCollectionResponse userCollectionResponse = graphClient.users().get(conf -> {
conf....
2
votes
4
answers
309
views
Why does the compareTo method throw an exception?
// File: Employee.java
public class Employee implements Comparable {
public Integer salary;
public int compareTo(Object e) {
Employee other = (Employee) e;
return Integer....
0
votes
0
answers
37
views
App crashes on startup after update due to FlutterCallbackInformation being null (WorkManager crash in DartExecutor)
I'm using the workmanager Flutter plugin (workmanager: ^0.8.0) to perform background tasks, and I'm encountering the following crash when the background task is triggered:
NullPointerException in `...
0
votes
1
answer
148
views
Mapstruct Mapper produces NullPointerException because autowired mapper is null
I would like to understand why my DateMapper is not working.
here's my mappers:
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING,
uses = {ProductMapper.class, TagMapper.class})
...
0
votes
1
answer
73
views
Print a big table on a PDF using ITextPdf7
I have an issue using ITextPdf-7.2.6.
I would like to print a big table on a PDF but I always have those two issues.
I have an infinite loop if I recreate the renderer or a NullPointerException if I ...
-2
votes
1
answer
149
views
NotNull for method return values [closed]
I am seeing a piece of code like this, im simplifying it for explaining ==
import org.jetbrains.annotations.NotNull;
public class TestClass {
@NotNull StringBuffer met1(Integer a) {
if ...
0
votes
0
answers
44
views
During the startup of a SpringBoot project, the value of the Apollo-injected variable is null
I encountered an issue where, when using Apollo to inject a static variable property, the variable is null during project startup. However, when the variable is modified via Apollo, its value is ...
0
votes
0
answers
52
views
How to solve getServletContext() returning null? [duplicate]
I am working on a small jakarta ee project for a software engineering course I am taking. I am to connect a database to store user input from a form into the database using a servlet. I removed the ...
2
votes
2
answers
51
views
How can I resolve the "NullPointerException" error in Java when accessing an object in a method?
How can I resolve the "NullPointerException" error in Java when accessing an object in a method?
2
votes
1
answer
96
views
ComboBox value is null if select same item with control key pressed
I have an issue with ComboBox when I select same item with control key pressed . This is what happens :
as you can see in the gif , combobox change values normally , but when control key is pressed , ...
0
votes
0
answers
43
views
Null pointer exception on camera click to capture image
I have an android app which is capturing the location. I have tried to check the permissions required on android 15 and also the context passed. Help me trace and fix the issue as it is occuring only ...
0
votes
0
answers
33
views
I don't know how to solve this NULL pointer exception while using pojo class with Pagefactory
I was using Pojo class in my project and i have used PageFactory.initElements to initialize the elements. But when i try to sendkeys or click the element it throws null poniter exception. Please help ...
3
votes
1
answer
94
views
Hilt injection order inconsistency leading to NullPointerExceptions in Compose ViewModel
I'm currently working on an application using Compose and Hilt, and occasionally (less than 10 times out of 1000 according to my automated tests), the order of calls to my ViewModel differs, leading ...
0
votes
0
answers
336
views
Getting KerberosAuthException: failure to login on spark submit in kubernetes cluster mode
I am getting below exception when submitting jar file using spark-submit command in cluster mode.
Exception in thread "main" org.apache.hadoop.security.KerberosAuthException: failure to ...
2
votes
2
answers
237
views
In Java, avoiding null dereferences when calling super(...) in constructor
I am using Java 21.
I have two classes:
abstract class MySuperClass {
private final Object mySuperField;
MySuperClass(Object myField) {
this.mySuperField = myField;
}
public ...
2
votes
1
answer
86
views
Can someone explain why this fix for a NullPointerException works?
My application parses .xml files and transforms them into Kotlin classes. It builds JavaClasses based on XSD files. One of the NonNull properties was null, which was causing an uncaught exception. So ...
1
vote
0
answers
76
views
I Face the Problem that "The <App Name> has Stopped"
whenever I try to open the app it keeps stopping. This issue also comes in many other project also.
Here is my MainActivity.kt file
package com.shahid.timerlivedata
import android.annotation....
0
votes
1
answer
36
views
Trying to retrieve data from a document in Firestore but it returns null when mapping to a Java object
Here is the code for the LessonGroup class:
public class LessonGroup implements Serializable {
//properties
private String studentId;
private String lessonGroupId;
private String ...
-1
votes
2
answers
94
views
Java - Null safety through generic function execution
When dealing with nested Objects in Java -
Something like:
// bad code
game.getPlayer().getState().getPositionInfo().getCurrent().getX();
, it is not clear if a nested reference would return null ...
-1
votes
4
answers
102
views
Why are we not adding Safe Call Operator(?.) instead of Not-Null Assertion(!!) in OkHttp Library Cache Interceptor?
Why are we not adding Safe Call Operator(?.) instead of Not-Null Assertion(!!) in the attached code in Cache Interceptor ? The source code is : https://github.com/square/okhttp/blob/...
0
votes
0
answers
72
views
Linux Kernel hash table iteration gives NULL pointer
I'm writing a kernel object that should keep a set of threads information and access them by tid.
For this purpose I'm using the hashtable data structure. Every time I get a thread info, I should ...
-1
votes
1
answer
448
views
Issue with ActionContext.getContext() returns null when migrating from Struts 2.5.33 to Struts 6.4.0
I am migrating from Struts 2.5.33 to Struts 6.4.0.
After following the guide at https://cwiki.apache.org/confluence/display/WW/Struts+2.5+to+6.0.0+migration, the app could not display the homepage ...
1
vote
1
answer
94
views
Constructor parameter is null until parent is not initialized
Look at the following code:
abstract class A {
init {
f()
}
abstract fun f()
}
class B(val p: () -> Unit) : A() {
override fun f() {
try {
p()
...
0
votes
0
answers
28
views
How do I fix this nullPointException exception in my program? [duplicate]
I'm trying to create a simple card game where the user faces against a computer (which is a class in my method that takes its turn automatically after the user), but I'm encountering a ...
0
votes
1
answer
72
views
NullPointerException Spark Scala when calling dataset in main from test class
I am trying to call a function that is defined in my Main Scala application from within a Test class. The function returns a Dataset of a class that is also defined in my Main app.
I want the data to ...