The problem of null pointer exception in springboot service?

problem description:
if the request method private ModelAndView articleList (Map < String, Object > map) adds an access control annotation @ PreAuthorize and uses private , it will report an error: java.lang.NullPointerException: null , where null refers to articleService as null. On the surface, it may be the class method permission problem caused by modifiers. Why can you access it without annotating @ PreAuthorize , but not if you add it? Please explain it in depth.

...
@Autowired
private ArticleService articleService;
...

@GetMapping("/articles")
@PreAuthorize("hasAnyAuthority("admin")")
public  ModelAndView articleList(Map<String, Object> map){
    List<ArticleDTO> articleListDTO = articleService.articleInfoList();
    map.put("articleList", articleListDTO);
    return new ModelAndView("article/article_list", map);
}
Mar.23,2021

I also encountered this question and asked for a great answer

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a6c3-2c21e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a6c3-2c21e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?