Why when I try to call ServiceImpl.class.getClassLoader().getResource("coopAccess_db") null is returned to me and you should put it in a folder and specify the corresponding getResource("db/coopAccess_db") normal url

  • What url is back? - Roman C
  • In the first case, null in the second file: / C: / Users / user / Documents / IntelijIdeaRes / IdeaProjects / CoopAccess_Server / target / classes / db / coopAccess_db - Clool Mear
  • Is there such a file? - Roman C
  • Of course, I threw the screen, but found the file only if it was dropped into an additional directory - Clool Mear
  • What is the name of the file? - Roman C

1 answer 1

Contact as follows:

  ServiceImpl.class.getResource("/coopAccess_db"); 
  • I also tried null - Clool Mear
  • Check that the file you are looking for is in the root of the jar file after building the project. If he is not there, he will not search like this - ezhov_da