I think your problem is related with the lack of a @Component annotation in your BoardDao class. The component should have a @Component annotation to instantiate the singleton to be injected in your Service Layer.

@Component
public class BoardDao extends SqlSessionDaoSupport{

    @Autowired
    SqlSessionTemplate session;

    public List<BoardDto> listboard(BoardDto dto) {
        System.out.println("dao.");
        List<BoardDto> result = session.selectList("boarddate.listboard", dto);
        return result;
    }

}

If the problem persist, you may try with the @Repository annotation. Sadly I haven't used the class SqlSessionDaoSupport, so I don't know exactly the best annotation for that.

Answer from Oscar Navarrete on Stack Overflow
🌐
jMonkeyEngine Hub
hub.jmonkeyengine.org › troubleshooting › general help
[SOLVED] Cannot invoke because "contentMan" is null - General Help - jMonkeyEngine Hub
June 6, 2024 - I just started JME3 to learn after many many years. And I know only Unity Godot. I just love Java and JME3. I was running code and stuck in this error. Help and suggest me what to read to improve my JME3 code and skills. package mygame; import com.jme3.app.SimpleApplication; import ...
Discussions

Need some help debugging. Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because "this.items[i]" is null
items[size + 1] = value; Don't add 1 here, use: items[size] = value; Arrays are 0-indexed in java, so you want to fill in the 0'th element; if you start from 1 (as you do here), items[0] will always be null. You can actually use the postfix ++ here like this and combine this line with the next: items[size++] = value; This will set items[0] to value and then increment size to 1 the first time. More on reddit.com
🌐 r/javahelp
5
2
November 2, 2023
Property.get in ValueSource throws java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because "this.type" is null
java.lang.NullPointerException: Cannot invoke "java.lang.Class.isInstance(Object)" because "targetType" is null at org.gradle.api.internal.provider.Providers.fixedValue(Providers.java:39) at org.gradle.api.internal.provider.DefaultProperty.convention(DefaultProperty.java:125) at com.xenote... More on github.com
🌐 github.com
1
November 4, 2024
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.net.URL.toExternalForm()" because "location" is null
When you use getResource() (on a class or a classloader) the file is assumed to be located on the classpath, paths may be relative or absolute, but on the classpath. For example, MyClass.getClass().getResource("myfile"), will look for myfile in the same packege as MyClass (the file are assumed to be located in the same folder as "MyClass.class" when the program runs). You may read more about it at: https://www.baeldung.com/java-class-vs-classloader-getresource https://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html (it is old, but still relevant) More on reddit.com
🌐 r/javahelp
3
1
May 18, 2023
internal exception java.lang.nullpointerexception can not invoke "net.minecraft.nbt.compoundtag.m_128459_(string) | Forge 1.20.1 Server
Falling Leaves is a client only mod and should be removed from the mods on the server Better F3 is also client only You need to check that you don't have other mods that are client only. edit: Oh dear, you've got lots of client only mods - embeddium is another one Here's a list of all the mods you need to take off the server: ambientsounds Better F3 Chat heads Cumulus menus Embeddium Embeddium Extra Falling Leaves mousetweaks There's probably more, I lost patience. More on reddit.com
🌐 r/ModdedMC
86
38
April 17, 2024
🌐
OneUptime
oneuptime.com › home › blog › how to handle 'cannot invoke method on null' errors
How to Handle 'Cannot invoke method on null' Errors
December 22, 2025 - NullPointerException is preventable with defensive coding practices. Use Optional for values that might not exist, validate inputs at boundaries, use constructor injection with required dependencies, and return empty collections instead of null. Modern Java's helpful NPE messages make debugging easier, but prevention is better than cure.
🌐
Coderanch
coderanch.com › t › 750685 › engineering › Null-Pointer-exception-Unit-Test
Null Pointer exception in Unit Test (Testing forum at Coderanch)
java.lang.NullPointerException: Cannot invoke "com.example.onlinehotelbookingsystem.service.RoomService.findByHotelId(java.lang.Long)" because "this.roomService" is null at com.example.onlinehotelbookingsystem.service.impl.AccommodationServiceImpl.lambda$findById$0(AccommodationServiceImpl.java:56) at java.base/java.util.Optional.map(Optional.java:260) at com.example.onlinehotelbookingsystem.service.impl.AccommodationServiceImpl.findById(AccommodationServiceImpl.java:52) at com.example.onlinehotelbookingsystem.service.impl.AccommodationServiceImplTest.whenFindById_verifyThatIsNotNull(Accommoda
🌐
Reddit
reddit.com › r/javahelp › need some help debugging. exception in thread "main" java.lang.nullpointerexception: cannot invoke "object.equals(object)" because "this.items[i]" is null
Cannot invoke "Object.equals(Object)" because "this.items ...
November 2, 2023 -
public class ArraySet<T> {
    private T[] items;
    private int size;

    public ArraySet() {
        items = (T[]) new Object[100];
        size = 0;
    }

    public void add(T value) {
        for (int i = 0; i < size; i++) {
            if (items[i] == value) {
                return;
            }
        }
        items[size + 1] = value;
        size ++;
    }

    public boolean contains(T x) {
        for (int i = 0; i < size; i++) {
            if (items[i].equals(x)) {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        ArraySet<String> s = new ArraySet<>();
        // test add function
        s.add("horse");
        System.out.println(s.size);
        s.add("fish");
        System.out.println(s.size);
        // test contains function
        System.out.println(s.contains("horse"));
    }
}

I self create an Arrayset class to store strings with add function and contains function, but the contains function goes wrong. I try to modify my add function but it doesn't works.

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because "this.items[i]" is null

🌐
Sentry
sentry.io › sentry answers › java › what is a nullpointerexception, and how do i fix it?
What is a NullPointerException, and how do I fix it? | Sentry
A NullPointerException in Java is one of the most common errors. It means that you are trying to access a part of something that doesn’t exist. For example, in the code below we call .length() on myString, which would usually return the length of the string. In this case, the string doesn’t exist (we set it to null), and so this throws a NullPointerException.
Find elsewhere
🌐
GitHub
github.com › gradle › gradle › issues › 31123
Property.get in ValueSource throws java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because "this.type" is null · Issue #31123 · gradle/gradle
November 4, 2024 - Property.get in ValueSource throws java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because "this.type" is null#31123
Author: gradle
🌐
Reddit
reddit.com › r/javahelp › exception in thread "main" java.lang.nullpointerexception: cannot invoke "java.net.url.toexternalform()" because "location" is null
Exception in thread "main" java.lang.NullPointerException: ...
May 18, 2023 -

https://pastebin.com/vtcMwSRn

So I am currently going crazy trying to get images to load when you export it to a .jar file. Before I was just using, "new imageicon("picturepath")"

As you can see from lines 30-34.

Then I found out that doesn't carry over when you make the project into a .jar file, okay cool. So I found out that you want to use, "getResource" okay cool got it. Try that and now I get the error in the title. when that location isn't fucking null so that's horse shit. I've tried every variation of that path. I have tried moving my images folder all over the project; from inside the src folder, where it is now, to just in the main project folder, etc. I don't know why it isn't happy.

Exception in thread "main" java.lang.NullPointerException: Cannot invoke 
"java.net.URL.toExternalForm()" because "location" is null
at java.desktop/javax.swing.ImageIcon.<init>(ImageIcon.java:234)
at LaunchPage.<init>(LaunchPage.java:25)
at Main.main(Main.java:5)
Top answer
1 of 2
3
When you use getResource() (on a class or a classloader) the file is assumed to be located on the classpath, paths may be relative or absolute, but on the classpath. For example, MyClass.getClass().getResource("myfile"), will look for myfile in the same packege as MyClass (the file are assumed to be located in the same folder as "MyClass.class" when the program runs). You may read more about it at: https://www.baeldung.com/java-class-vs-classloader-getresource https://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html (it is old, but still relevant)
2 of 2
1
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
🌐
Reddit
reddit.com › r/moddedmc › internal exception java.lang.nullpointerexception can not invoke "net.minecraft.nbt.compoundtag.m_128459_(string) | forge 1.20.1 server
internal exception java.lang.nullpointerexception can not ...
April 17, 2024 -

when people try to connect to my server, they receive this error message
internal exception java.lang.nullpointerexception can not invoke "net.minecraft.nbt.compoundtag.m_128459_(string)

i also received this error message as well but during this test for some reason it let me join the server, i've tested this out on singleplayer as well and the world works fine nothing seems to be corrupted it just doesn't work for the server.
we've also made multiple worlds for this specific pack i've made and they all have had this problem, randomly sometimes people will be able to join and play normally but other times they get this error and they cant play.
friends latest.log: https://mclo.gs/mHmks83
servers lastest.log: https://mclo.gs/si9AJk2

🌐
GitHub
github.com › CompEvol › beast2 › issues › 1208
java.lang.NullPointerException: Cannot invoke "Object. ...
November 9, 2025 - java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "<local3>" is null#1208 · Copy link · genesandbones · opened · on Nov 9, 2025 · Issue body actions · Hello, I apologize that this issue has been listed before but I could not find a resolution that was useful for my scenario.
Author: CompEvol
🌐
Aspose
forum.aspose.com › aspose.words product family
Error: ava.lang.NullPointerException: Cannot invoke "com ...
March 26, 2025 - Hi there, I’m getting the following ...extSibling()” because “parameter2” is null This happens when creating the same document multiple times concurrently via a REST Service....
🌐
GitHub
github.com › quarkusio › quarkus › issues › 30254
java.lang.NullPointerException: Cannot invoke "org.jboss. ...
January 9, 2023 - java.lang.NullPointerException: Cannot invoke "org.jboss.jandex.ClassInfo.classAnnotations()" because "classInfo" is null#30254
Author: quarkusio
🌐
Hypixel Forums
hypixel.net › home › forums › hypixel server › community help forum
java.lang.nullpointerexception cannot invoke...
May 23, 2023 - I just got the message java.lang.nullpointerexception cannot invoke java.util.UUID.toStrring() because value is null when I try to join the game never happened before what do I do? I tried updating java and reinstalling the game
🌐
SmartBear Community
community.smartbear.com › smartbear community › soapui open source › soapui open source questions
Getting error :- java.lang.NullPointerException:Cannot invoked method run() on null object error | SmartBear Community
September 5, 2018 - Getting error :- java.lang.NullPointerException:Cannot invoked method run() on null object error · def project = testRunner.testCase.testSuite.project · def suite = context.testCase.testSuite.project.testSuites ['TestSuite2'] suite.run (null, true) Reply ·
🌐
Katalon
forum.katalon.com › api testing
Cannot Invoke a method because tc is null - API Testing - Katalon Community
November 14, 2024 - Hello folks, I am having trouble saving the test suites/running the test suites because of a method…
🌐
Syntx Scenarios
syntaxscenarios.com › home › java › how to fix nullpointerexception in java (5 causes & fixes)
How to Fix NullPointerException in Java (5 Causes & Fixes)
March 14, 2026 - Since there is no object to invoke the method on, it results in a NullPointerException. In this example, str is null, so calling str.length() results in Exception in thread "main" java.lang.NullPointerException. However even if you declare a reference variable and assign it to nothing, still, it will cause NullPointerException because the default value of a reference variable in Java is null.