Activity log for bug #1960350

Date Who What changed Old value New value Message
2022-02-08 18:41:22 RaiMan bug added bug
2022-02-08 18:41:45 RaiMan sikuli: importance Undecided High
2022-02-08 18:41:48 RaiMan sikuli: assignee RaiMan (raimund-hocke)
2022-02-08 18:41:51 RaiMan sikuli: milestone 2.0.6
2022-02-08 18:41:58 RaiMan sikuli: status New In Progress
2022-02-08 18:42:47 RaiMan description Hi , i tried to locate the image path using ("someClass/images"), but fail to add it in the image path. Only target/classes folder is added. the sub folder is not added... My Project Structure src -main --java --JarMainClass -resources --images ---app2 ----image1.png Code: public class JarMainClass { public static void main(String[] args) throws IOException, URISyntaxException, FindFailed { System.out.println("Hello!"); ImagePath.add("JarMainClass/images/app2"); System.out.println("1: "+ImagePath.getPaths()); } Console: [ERROR Commons] parameter(main: JarMainClass/images/app2, sub: null) [ERROR Commons] makeURL: file does not exist: C:\Users\winnie.choi\Documents\testproject\JarMainClass\images\app2 [ERROR Commons] parameter(main: file:/C:/Users/winnie.choi/Documents/testproject/target/classes/, sub: images/app2) [ERROR Commons] makeURL: URL protocol not implemented 1: [null, C:\Users\winnie.choi\Documents\testproject\target\classes] Environment sikulixapi: 2.0.5 java: 1.8 OS: Windows Server 2012 R2 Maven --------- I am able to add path by providing absolute path (e.g. src/main/resources/images/app2) or using ClassLoader.getSystemResource("images/app2").getPath() when running in the IDE. But i am unable to add the image path when running the exported jar. following is logged when trying to access the path by getResource() function [ERROR Commons] parameter(main: file:\C:\Users\winnie.choi\Documents\jar\jar-with-dependencies.jar!\images\app2, sub: null) [ERROR Commons] makeURL: mainFile.getCanonicalFile().toURI().toURL(): C:\Users\winnie.choi\Documents\jar\file:\C:\Users\winnie.choi\Documents\jar\jar-with-dependencies.jar!\images\app2 (The filename, directory name, or volume label syntax is incorrect) [ERROR Commons] parameter(main: file:\C:\Users\winnie.choi\Documents\jar\jar-with-dependencies.jar!\images\app2, sub: null) [ERROR Commons] makeURL: file does not exist: C:\Users\winnie.choi\Documents\jar\file:\C:\Users\winnie.choi\Documents\jar\jar-with-dependencies.jar!\images\app2 path:[null] tracked on Github: https://github.com/RaiMan/SikuliX1/issues/511 ----------------------------- Hi , i tried to locate the image path using ("someClass/images"), but fail to add it in the image path. Only target/classes folder is added. the sub folder is not added... My Project Structure src -main --java --JarMainClass -resources --images ---app2 ----image1.png Code: public class JarMainClass {     public static void main(String[] args) throws IOException, URISyntaxException, FindFailed {         System.out.println("Hello!");         ImagePath.add("JarMainClass/images/app2");         System.out.println("1: "+ImagePath.getPaths()); } Console: [ERROR Commons] parameter(main: JarMainClass/images/app2, sub: null) [ERROR Commons] makeURL: file does not exist: C:\Users\winnie.choi\Documents\testproject\JarMainClass\images\app2 [ERROR Commons] parameter(main: file:/C:/Users/winnie.choi/Documents/testproject/target/classes/, sub: images/app2) [ERROR Commons] makeURL: URL protocol not implemented 1: [null, C:\Users\winnie.choi\Documents\testproject\target\classes] Environment sikulixapi: 2.0.5 java: 1.8 OS: Windows Server 2012 R2 Maven --------- I am able to add path by providing absolute path (e.g. src/main/resources/images/app2) or using ClassLoader.getSystemResource("images/app2").getPath() when running in the IDE. But i am unable to add the image path when running the exported jar. following is logged when trying to access the path by getResource() function [ERROR Commons] parameter(main: file:\C:\Users\winnie.choi\Documents\jar\jar-with-dependencies.jar!\images\app2, sub: null) [ERROR Commons] makeURL: mainFile.getCanonicalFile().toURI().toURL(): C:\Users\winnie.choi\Documents\jar\file:\C:\Users\winnie.choi\Documents\jar\jar-with-dependencies.jar!\images\app2 (The filename, directory name, or volume label syntax is incorrect) [ERROR Commons] parameter(main: file:\C:\Users\winnie.choi\Documents\jar\jar-with-dependencies.jar!\images\app2, sub: null) [ERROR Commons] makeURL: file does not exist: C:\Users\winnie.choi\Documents\jar\file:\C:\Users\winnie.choi\Documents\jar\jar-with-dependencies.jar!\images\app2 path:[null]
2022-02-10 15:03:09 RaiMan sikuli: status In Progress Fix Committed
2022-02-10 15:03:12 RaiMan sikuli: importance High Critical
2022-02-10 15:03:29 RaiMan summary [2.0.5] ImagePath: using a class as folder reference does not work when running a jar containing the images [2.0.5] ImagePath: using a class as folder reference does not work when running a jar containing the images --- fixed in. 2.0.6