1

我正在使用 Windows 8.1 x64 瑞典语。我试图关注这个https://www.youtube.com/watch?v=GTrNkhVnJBU有关如何使 STS 进行热插拔的指南。我将 Eclipse 设置为自动构建,并且检查了类文件实际上是否已在目标目录中替换。我添加了 javaagent 参数。我还测试了使用我的 VM 参数从命令行(一个简单的 hello world)启动它,尽管我的用户名包含空格,但它会启动。我试图将 springloaded.jar 移动到不包含空格的文件夹中。仍然没有热插拔。为了测试它,我重建了我的命令行 hello world 或在 STS 中我改变了一个字符串并保存了文件。该类自动构建,但网页仍打印旧消息。STS 安装目录为 C:\dev\Apps\STS。.m2 存储库的路径中有空格。我试过 jdk 1.7.0_25、jdk 1.7.0_55 和 springloaded-1.1.5.RELEASE.jar、springloaded-1.2.0.RELEASE.jar

4

2 回答 2

0

当您启动附加了弹簧加载代理的应用程序时,您在 STS 的控制台视图中看到了什么?您是否注意到有关 springloaded-1.2.0.RELEASE.jar 未找到或无法打开的任何消息?您可以在此处粘贴您的启动配置 VM 参数吗?

修改代码并保存后,看起来成功的热交换应该会在控制台视图中产生如下所示的消息: [Loader@5cfab5b1] swsmmaRequestMappingHandlerMapping : Mapped "{[/greeting],methods=[],params=[ ],headers=[],consumes=[],produces=[],custom=[]}" 到公共 hello.Greeting hello.GreetingController.greeting(java.lang.String)

于 2014-05-01T20:18:49.673 回答
0
Lauch configuration arguments as requested:
-Dspring.liveBeansView.mbeanDomain
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=38900
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

Program arguments:
-javaagent:C:/Users/Anna\ Ohlsson/.m2/repository/org/springframework/springloaded/1.2.0.RELEASE/springloaded-1.2.0.RELEASE.jar -noverify

This is what the boot up messages look like. Someone requested to see them.
  .   ____          _            __ _ _                                                                         
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \                                                                           
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \                                                                          
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )                                                                        
  '  |____| .__|_| |_|_| |_\__, | / / / /                                                                         
 =========|_|==============|___/=/_/_/_/                                                                          
 :: Spring Boot ::        (v1.0.2.RELEASE)                                                                          

2014-05-03 16:11:42.407  INFO 7620 --- [           main] demo.Application                         : Starting Application on WindowsBurken with PID 7620 (C:\dev\STS_Workspace\demo\target\classes started by Anna Ohlsson in C:\dev\STS_Workspace\demo)
2014-05-03 16:11:42.447  INFO 7620 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@495d950b: startup date [Sat May 03 16:11:42 CEST 2014]; root of context hierarchy
2014-05-03 16:11:42.774  INFO 7620 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'org.springframework.boot.autoconfigure.AutoConfigurationPackages': replacing [Generic bean: class [org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
2014-05-03 16:11:43.530  INFO 7620 --- [           main] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 8080
2014-05-03 16:11:43.741  INFO 7620 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2014-05-03 16:11:43.742  INFO 7620 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/7.0.52
2014-05-03 16:11:43.851  INFO 7620 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2014-05-03 16:11:43.851  INFO 7620 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1407 ms
2014-05-03 16:11:44.290  INFO 7620 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean        : Mapping servlet: 'dispatcherServlet' to [/]
2014-05-03 16:11:44.293  INFO 7620 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2014-05-03 16:11:44.607  INFO 7620 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2014-05-03 16:11:44.680  INFO 7620 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto java.lang.String demo.SampleController.home()
2014-05-03 16:11:44.680  INFO 7620 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/greeting],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto java.lang.String demo.SampleController.greeting(java.lang.String)
2014-05-03 16:11:44.700  INFO 7620 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2014-05-03 16:11:44.701  INFO 7620 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2014-05-03 16:11:44.818  INFO 7620 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2014-05-03 16:11:44.841  INFO 7620 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080/http
2014-05-03 16:11:44.843  INFO 7620 --- [           main] demo.Application                         : Started Application in 2.745 seconds (JVM running for 3.163)
于 2014-05-03T14:13:41.373 回答