title: Cannot invoke "" because "" is null
body: <p>i finally find it question tab.
  why this error is 'boom'?????
  i didn't understand spend two days.....</p>
  <pre><code>    **java.lang.NullPointerException: Cannot invoke 
      &quot;com.board.dao.BoardDao.listboard(com.board.dto.BoardDto)&quot; because &quot;this.bDao&quot; is null**
      at com.board.service.BoardService.listboard(BoardService.java:19)
      at com.board.controller.BoardController.boardlist(BoardController.java:25)
      at com.board.controller.BoardController.boardlist(BoardController.java:26)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1626)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.base/java.lang.Thread.run(Unknown Source)
  </code></pre>
  <p>controller</p>
  <pre><code>@Controller
  public class BoardController {
      
      @Autowired
      BoardService service;
      
      
      @RequestMapping(&quot;/board&quot;)
      public ModelAndView boardlist (ModelAndView mv ,BoardDto dto) {
          System.out.println(&quot;boardlist &quot;);
          
          System.out.println(dto+&quot;dto&quot;);
          List&lt;BoardDto&gt; dtolist = service.listboard(dto);
          mv.addObject(&quot;boardlist&quot;, dtolist);
          mv.setViewName(&quot;boardlist&quot;);
          return mv;
      }
  }
  </code></pre>
  <p>controller is fine.. i think..</p>
  <p>service</p>
  <pre><code>@Service
  public class BoardService {
      
      @Autowired
      BoardDao bDao;
  
      public List&lt;BoardDto&gt; listboard(BoardDto dto) {
          System.out.println(&quot;boardservice&quot;);
          List&lt;BoardDto&gt; result = bDao.listboard(dto);
          return result ;
      }
  
  }
  
  </code></pre>
  <p>this position is error why?? T.T</p>
  <p>i think this method is error position but i don't know understand. why???</p>
  <p>dao</p>
  <pre><code>public class BoardDao extends SqlSessionDaoSupport{
      
      @Autowired
      SqlSessionTemplate session;
  
      public List&lt;BoardDto&gt; listboard(BoardDto dto) {
          System.out.println(&quot;dao.&quot;);
          List&lt;BoardDto&gt; result = session.selectList(&quot;boarddate.listboard&quot;, dto);
          return result;
      }
  
  }
  </code></pre>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
      xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd&quot;&gt;
      
      &lt;!-- Root Context: defines shared resources visible to all other web components --&gt;
  
  
      &lt;bean id=&quot;dataSource&quot; 
          class=&quot;org.springframework.jdbc.datasource.DriverManagerDataSource&quot;&gt;
          &lt;property name=&quot;driverClassName&quot; value=&quot;oracle.jdbc.driver.OracleDriver&quot;/&gt;
          &lt;property name=&quot;url&quot; value=&quot;jdbc:oracle:thin:@localhost:1521:orcl&quot;/&gt;
          &lt;property name=&quot;username&quot; value=&quot;board&quot;/&gt;
          &lt;property name=&quot;password&quot; value=&quot;1234&quot;/&gt;
      &lt;/bean&gt; 
  
  
      &lt;bean id=&quot;sqlSessionFactory&quot; class=&quot;org.mybatis.spring.SqlSessionFactoryBean&quot;&gt;
          &lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot; /&gt;
          &lt;!-- classpath: -&gt; src/main/resources --&gt;
          &lt;property name=&quot;configLocation&quot; value=&quot;classpath:myBatis/myBatis-config.xml&quot;/&gt;  
      &lt;/bean&gt;
  
  
  
      &lt;bean id=&quot;sqlSession&quot; class=&quot;org.mybatis.spring.SqlSessionTemplate&quot;&gt;
          &lt;constructor-arg name=&quot;sqlSessionFactory&quot; ref=&quot;sqlSessionFactory&quot;/&gt;
      &lt;/bean&gt;
      &lt;!-- DI  --&gt;
      &lt;bean class=&quot;com.board.service.BoardService&quot;&gt;&lt;/bean&gt;
      &lt;bean class=&quot;com.board.dao.BoardDao&quot;&gt;
          &lt;property name=&quot;sqlSessionTemplate&quot; ref=&quot;sqlSession&quot;/&gt;
      &lt;/bean&gt;
      
  &lt;/beans&gt;
  </code></pre>
  <p>root-context.xml</p>
  <p>why error is 'boom'? i didn't understand.... T.T</p>
  <p>--&gt; edit more infomation to error</p>