The layout of the application on the filesystem is often different in various scenarios. To reference a location consistently I usually get the base path at run time (in production this is usually set in application.conf). Ex,
String pathPrefix = com.mendix.core.conf.Configuration.getBasePath().getAbsolutePath(); System.out.println("Path prefix : " + pathPrefix);
Secondly, the path separator for file locations is different between Windows and unix environments ("'\" and "/", resp). When using paths, make sure to use the appropriate slash.
String separator = System.getProperty("file.separator");
Combining these two should give you valid paths in both development and production.
StringBuilder sb = new StringBuilder(); sb.append(com.mendix.core.conf.Configuration.getBasePath().getAbsolutePath()); sb.append("WEB-INF"); sb.append(System.getProperty("file.separator")); sb.append("filename.xsd"); String fullPath = sb.toString(); System.out.println(fullPath);
(Be sure to check the resulting file path on the console, I haven't actually tested this code).