Search code examples
springspring-bootjhipsterjrebel

Hot Reload/Swap Jhipster


I try to create project using jhipster. Looks good, but how can I run the project on hot reload mode, so I don't need to restart my application server on every java changes.

I try to run jhipster project on jrebel, but I got this error. It looks like jrebel can not process spring boot Yaml

JRebel-SDK-CBP: ERROR Class 'org.springframework.boot.env.YamlPropertySourceLoader' could not be processed by org.zeroturnaround.javarebel.integration.spring.cbp.YamlPropertySourceLoaderCBP@org.apache.catalina.loader.WebappClassLoader@3413e5b7: org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] no such class: YamlPropertiesFactoryBean
at org.zeroturnaround.bundled.javassist.CtNewMethod.make(SourceFile:79)
at org.zeroturnaround.bundled.javassist.CtNewMethod.make(SourceFile:45)
at org.zeroturnaround.javarebel.integration.spring.cbp.YamlPropertySourceLoaderCBP.process(YamlPropertySourceLoaderCBP.java:35)
at org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor.process(SourceFile:66)
at com.zeroturnaround.javarebel.asT.a(SourceFile:257)
at com.zeroturnaround.javarebel.asT.a(SourceFile:246)
at com.zeroturnaround.javarebel.asT.a(SourceFile:230)
at com.zeroturnaround.javarebel.SDKIntegrationImpl.runBytecodeProcessors(SourceFile:30)
at com.zeroturnaround.javarebel.asa.transform(SourceFile:76)
at java.lang.ClassLoader.defineClass(ClassLoader.java)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2452)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:854)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1264)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1147)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:130)
at org.springframework.core.io.support.SpringFactoriesLoader.loadFactories(SpringFactoriesLoader.java:91)
at org.springframework.boot.env.PropertySourcesLoader.<init>(PropertySourcesLoader.java:64)
at org.springframework.boot.env.PropertySourcesLoader.<init>(PropertySourcesLoader.java:53)
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:300)
at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:173)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:144)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:137)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:126)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:59)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:286)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143)
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:89)
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:51)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5185)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: compile error: no such class: YamlPropertiesFactoryBean
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.searchImports(SourceFile:468)
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.lookupClass(SourceFile:412)
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.lookupClassByJvmName(SourceFile:319)
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.resolveJvmClassName(SourceFile:512)
at org.zeroturnaround.bundled.javassist.compiler.MemberCodeGen.resolveClassName(SourceFile:1145)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atDeclarator(SourceFile:712)
at org.zeroturnaround.bundled.javassist.compiler.ast.Declarator.accept(SourceFile:100)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(SourceFile:351)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(SourceFile:50)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(SourceFile:351)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(SourceFile:50)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atMethodBody(SourceFile:292)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atMethodDecl(SourceFile:274)
at org.zeroturnaround.bundled.javassist.compiler.ast.MethodDecl.accept(SourceFile:44)
at org.zeroturnaround.bundled.javassist.compiler.Javac.compileMethod(SourceFile:169)
at org.zeroturnaround.bundled.javassist.compiler.Javac.compile(SourceFile:95)
at org.zeroturnaround.bundled.javassist.CtNewMethod.make(SourceFile:74)

Solution

  • This error occurred when I use Jrebel to 6.0.0 after updating Jrebel version to 6.1.0, I got this error

    org.springframework.boot.context.embedded.tomcat.ServletContextInitializerLifecy‌​‌​cleListener - Error starting Tomcat context: org.springframework.beans.factory.BeanCreationException
    

    and I solve this by add -XX:MaxPermSize=512m at VM Arguments (eclipse)

    thanks to ZT (zeroturnaround) Support