Home>
Why when I try to call ServiceImpl.class.getClassLoader (). getResource ("coopAccess_db")
null is returned to me and it is worth putting it in a folder and specifying the appropriate path getResource ("db /coopAccess_db")
a normal url is returned
In the first case, null in the second file: /C: /Users /user /Documents /IntelijIdeaRes /IdeaProjects /CoopAccess_Server /target /classes /db /coopAccess_db
Clool Mear2021-02-23 05:03:54Is there such a file?
Roman C2021-02-23 05:03:54of course, I threw the screen, but it finds the file only if it is also thrown into an additional directory
Clool Mear2021-02-23 05:03:54What is the name of the file?
Roman C2021-02-23 05:03:54-
Answer # 1
Contact like this:
ServiceImpl.class.getResource ("/coopAccess_db");
tried null too
Clool Mear2021-02-23 05:03:54Make sure that the file you are looking for is in the root of the jar file after building the project. If it is not there, it will not look like that.
ezhov_da2021-02-23 05:03:54
Trends
What url is returned?
Roman C2021-02-23 05:03:54