There is a class that pulls configurations from the .properties file in the initPaths() method marked with @PostConstruct . Development is conducted under Mac OS and everything is stable here. But when I started to deploy the application on Windows Server 2012 it turned out that in knocking with Windiws the initPaths() method is not called at all.
@Value("${traned.data}") private String tranedData; @PostConstruct void initPaths() { log.debug("Init Path Call"); isWindows = System.getProperty("os.name").toLowerCase().indexOf("win") > 0; root = new File(".").getAbsolutePath(); ...дальше просто преобразования со строками... } How it happens: I take the same jar archive, run it on a Mac, everything works and Init Path Call written to the log, and on Windows, the log is not there, and the program crashes without this data.
isWindowsandrootvariables calculated? - Sergey Gornostaev@PostConstructwhy java 9.0.1 + 11 does not pick it up ((((@PostConstructcan not be called only in one case - if the bin has not been instantiated. And this, if we exclude lazy initialization, can only be the case - the program has fallen before. - Sergey Gornostaev