classloader - Spring Boot 1.4 custom bootstrapper -


i have project uses custom bootstrapper startup spring boot application. bootstrapper used provide built in update mechanism. therefore spring boot application stored in predefined folder. in case of update new version stored in same directory. next application start bootstrapper start latest version based on version number of files.

now want update spring boot application latest spring boot version 1.4.0. application not starting anymore when using custom bootstrapper cannot find included ssl certificate (packaged in spring boot application). when starting application without custom bootstrapper working fine.

i guess has classloader path included certificate wrong (! after classes):

caused by: java.io.filenotfoundexception: jar entry boot-inf/classes!/default-server-ssl.p12 not found in  

the relevant part of bootstrapper following:

initializeenvironment(); ensuretempdirexists();  //get latest application version file agentapplicationfile = applicationversionlookup.getlatestversion(); url agentfileurl = agentapplicationfile.touri().tourl();  //add spring boot application classpath , run spring boot application classloader loader = new urlclassloader(new url[]{agentfileurl}, thread.currentthread().getcontextclassloader()); class<?> clazz = loader.loadclass("org.springframework.boot.loader.jarlauncher");  method main = clazz.getmethod("main", string[].class);  main.invoke(null, new object[]{new string[0]}); 

with spring boot 1.3.6 worked well. help.


Comments