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
🌐
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 (NPE) with the message "Cannot invoke method on null" is one of the most common runtime errors in Java. It occurs when you try to call a method or access a property on a null reference.
🌐
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.
Discussions

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
spring boot - java.lang.NullPointerException: Cannot invoke because the return value of is null - Stack Overflow
@Query(value = """ INSERT INTO ... profile.getId(), profile.getCustomerId(), Optional.of(profile.getTitle().name()).orElse(null) profile.getLocale()) ... java.lang.NullPointerException: Cannot invoke "com.entity.Title.name()" because the return value of "com.entity.Profile.getTitle()" ... More on stackoverflow.com
🌐 stackoverflow.com
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
jenkins - java.lang.NullPointerException: Cannot invoke method get() on null object - Stack Overflow
But everytime I get java.lang.NullPointerException: Cannot invoke method get() on null object error. More on stackoverflow.com
🌐 stackoverflow.com
🌐
Reddit
reddit.com › r/javahelp › exception in thread "main" java.lang.nullpointerexception: cannot invoke "java.net.url.toexternalform()" because "location" is null
r/javahelp on Reddit: Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.net.URL.toExternalForm()" because "location" is null
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.
🌐
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
🌐
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 - This can happen when calling a method, accessing a field, or using an array that was never initialized. To fix this issue, developers usually initialize objects properly or check whether a variable is null before using it.
Find elsewhere
🌐
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
r/ModdedMC on Reddit: internal exception java.lang.nullpointerexception can not invoke "net.minecraft.nbt.compoundtag.m_128459_(string) | Forge 1.20.1 Server
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

🌐
Hypixel Forums
hypixel.net › home › forums › hypixel server › community help forum
java.lang.nullpointerexception cannot invoke java.util.UUID ...
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
Author: quarkusio
🌐
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
r/javahelp on Reddit: Need some help debugging. Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because "this.items[i]" is null
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

🌐
JetBrains
youtrack.jetbrains.com › issue › IDEA-297028 › java.lang.NullPointerException-Cannot-invoke-java.util.List.getint-because-path-is-null
Cannot invoke "java.util.List.get(int)" because "path" is null
Our website uses some cookies and records your IP address for the purposes of accessibility, security, and managing your access to the telecommunication network. You can disable data collection and cookies by changing your browser settings, but it may affect how this website functions.
🌐
Coderanch
coderanch.com › t › 772079 › java › java-lang-NullPointerException-invoke-String
java.lang.NullPointerException: Cannot invoke String.trim() because in is null (Servlets forum at Coderanch)
April 23, 2023 - Or use logging in the Java code to trace the execution. Verify that the parameter is null, and then if that's the case, backtrack to find out why. [Asking smart questions] [About Bear] [Books by Bear] ... Bear Bibeault wrote:OK, you need to debug line 31. Most likely, the value of the parameter is null causing the parse to fail.
🌐
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 ...
🌐
GitHub
github.com › quarkusio › quarkus › issues › 37690
Regression in 3.6.2: ConfigDiagnostic `NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "s" is null` · Issue #37690 · quarkusio/quarkus
December 12, 2023 - ) at org.apache.maven.lifecycl...onfigGenerationBuildStep#unknownConfigFiles threw an exception: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "s" is null at java.base/java.lang.String.contains(String.java:2856) at io.quarkus.ru...
Author: quarkusio
🌐
Javatpoint
javatpoint.com › how-to-avoid-null-pointer-exception-in-java
How to avoid null pointer exception in Java - Javatpoint
How to avoid null pointer exception in Java with java tutorial, features, history, variables, object, programs, operators, oops concept, array, string, map, math, methods, examples etc.
🌐
Aspose
forum.aspose.com › aspose.words product family
java.lang.NullPointerException: Cannot invoke "com.aspose.words.Node.getNodeType()" because "this.zzYCU" is null - Free Support Forum - aspose.com
December 11, 2023 - Hi, We develop a service in my enterprise, MGDIS, which uses Aspose Words Java. We have just upgraded from version 14.4 to version 23.11 of Aspose Words Java and we have an exception with word templates that works in version 14.4. The exception is “java.lang.NullPointerException: Cannot invoke “com.aspose.words.Node.getNodeType()” because “this.zzYCU” is null” I have create a GitHub project for present this problem : https://github.com/SamyLegal/aspose-words-report-bugs For reproduce the p...
🌐
Hubitat
community.hubitat.com › developers
MakerAPI: java.lang.NullPointerException: Cannot invoke method getAt() on null object on line 465 (method sendDeviceCommandSecondary) - Developers - Hubitat
September 7, 2023 - I've been seeing this Exception in the logs for MakerAPI and was wondering what it means. I have the full http request that was made on one of these failures: http://192.168.0.201/apps/api/38/devices/578/setLocation/{"acc":4.431383,"bat":100,"lat":25.0000000,"lng":-80.0000000,"p":0,"w":1}&access_token=ACCESS_TOKEN without the URL encoding which makes this a pain to read the command looks like this: setLocation/{"acc":4.431383,"bat":100,"lat":...