【问题标题】:Hot Reload/Swap Jhipster热重载/交换 Jhipster
【发布时间】:2015-02-27 03:10:27
【问题描述】:

我尝试使用 jhipster 创建项目。看起来不错,但是如何在热重载模式下运行项目,所以我不需要在每次 java 更改时重新启动我的应用程序服务器。

我尝试在 jrebel 上运行 jhipster 项目,但出现此错误。看起来 jrebel 无法处理 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)

【问题讨论】:

  • 更新 Jrebel 版本到 6.1.0 后,我得到了这个错误 org.springframework.boot.context.embedded.tomcat.ServletContextInitializerLifecycleListener - Error started Tomcat context: org.springframework.beans.factory.BeanCreationException
  • 我很乐意帮助你,不幸的是 JRebel 不再为 OSS 项目提供许可证,所以我无法测试它!
  • 我在我的项目中使用嵌入式tomcat,我设置了没有服务器的Jrebel。但我总是得到那个错误。如果你遇到过这个错误?

标签: spring spring-boot jhipster jrebel


【解决方案1】:

这个错误意味着 JRebel 在 Spring 库中发现了一些意想不到的东西。在当前情况下,缺少类 YamlPropertiesFactoryBean。 该文件必须位于 spring-beans.jar 中。

如果您的项目中包含 spring-beans.jar 和 YamlPropertiesFactoryBean 类,请发送电子邮件至 support@zeroturnaround.com 以深入调查您的所有 Spring 框架库版本

【讨论】:

  • 将 Jrebel 版本更新到 6.1.0 后,我收到此错误 org.springframework.boot.context.embedded.tomcat.ServletContextInitializerLifecy‌​cleListener - 启动 Tomcat 上下文时出错:org.springframework.beans.factory。 BeanCreationException
  • 我的项目包含 spring-beans-4.1.2.RELEASE.jar
【解决方案2】:

当我使用 Jrebel 到 6.0.0 时出现此错误 将 Jrebel 版本更新到 6.1.0 后,出现此错误

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

我通过在 VM Arguments (eclipse) 中添加 -XX:MaxPermSize=512m 来解决这个问题

感谢 ZT(零周转)支持

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-04
    • 2019-07-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-30
    • 2011-04-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多