boot

Spring boot convert web.xml listener

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to convert my project to Spring Boot project (executable jar file with Jetty embedded). All works with a standard example but I want migrate my old web.xml to Spring Boot. I migrated Servlet and Filters but I don't understand how migrate filters as this: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <listener> <listener-class>org.granite.config

Spring Boot - inject map from application.yml

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Spring Boot application with the following application.yml - taken basically from here : info: build: artifact: ${project.artifactId} name: ${project.name} description: ${project.description} version: ${project.version} I can inject particular values, e.g. @Value("${info.build.artifact}") String value I would like, however, to inject the whole map, i.e. something like this: @Value("${info}") Map info Is that (or something similar) possible? Obviously, I can load yaml directly, but was wondering if there's something already supported

Spring Boot配置文件详解

走远了吗. 提交于 2019-12-03 02:48:54
Spring Boot配置文件详解 导语: 相信很多⼈选择Spring Boot主要是考虑到它既能兼顾Spring的强⼤功能,还能实现快速开发的便捷。我们在Spring Boot使⽤过程中,最直观的感受就是没有了原来⾃⼰整合Spring应⽤时繁多的XML配置内容,替代它的是在 pom.xml 中引⼊模块化的 Starter POMs ,其中各个模块都有⾃⼰的默认配置,所以如果不是特殊应⽤场景,就只需要在 application.properties 中完成⼀些属性配置就能开启各模块的应⽤。 自定义属性与加载 我们在使⽤Spring Boot的时候,通常也需要定义⼀些⾃⼰使⽤的属性,我们可以如下⽅式直接定义: com.didispace.blog.name=didi com.didispace.blog.title=Spring Boot Learning 然后通过 @Value("${属性名}") 注解来加载对应的配置属性,具体如下: @Component @Data public class BlogProperties { @Value("${com.didispace.blog.name}") private String name; @Value("${com.didispace.blog.title}") private String title; } 按照惯例

Why does my Spring Boot App always shutdown immediately after starting?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is my first Spring Boot code. Unfortunately, it always shuts down. I was expecting it to run continuously so that my web client can get some data from the browser. package hello; import org.springframework.boot.*; import org.springframework.boot.autoconfigure.*; import org.springframework.stereotype.*; import org.springframework.web.bind.annotation.*; @Controller @EnableAutoConfiguration public class SampleController { @RequestMapping("/") @ResponseBody String home() { return "Hello World!"; } public static void main(String[] args)

Spring boot 报错java.lang.NullPointerException: null

半腔热情 提交于 2019-12-03 02:35:19
新学习 Spring boot 按照网上资料搭建(兼容jsp),成功启动,正常遇见 helloworld 但页面一直不让用EL表达式,报错如下: java.lang.NullPointerException: null at javax.el.CompositeELResolver.add(CompositeELResolver.java:117) ~[javaee-api-8.0.jar:na] at org.apache.jasper.el.ELContextImpl.<clinit>(ELContextImpl.java:87) ~[tomcat-embed-jasper-8.5.23.jar:8.5.23] at org.apache.jasper.compiler.Validator$ValidateVisitor.prepareExpression(Validator.java:1617) ~[tomcat-embed-jasper-8.5.23.jar:8.5.23] at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:750) ~[tomcat-embed-jasper-8.5.23.jar:8.5.23] at org.apache.jasper.compiler

Why does executing activator give ExceptionInInitializerError caused by: java.security.NoSuchAlgorithmException: SHA1 MessageDigest not available?

匿名 (未验证) 提交于 2019-12-03 02:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Upon executing activator from Typesafe Activator 1.2.12 on cygwin on Windows with Java 8 I'm getting the following exception: java.lang.ExceptionInInitializerError at xsbt.boot.Update.settings$lzycompute(Update.scala:79) at xsbt.boot.Update.settings(Update.scala:74) at xsbt.boot.Update.ivyLockFile$lzycompute(Update.scala:96) at xsbt.boot.Update.apply(Update.scala:103) at xsbt.boot.Launch.update(Launch.scala:355) at xsbt.boot.Launch.xsbt$boot$Launch$$retrieve$1(Launch.scala:210) at xsbt.boot.Launch$$anonfun$3.apply(Launch.scala:218) at scala

Spring framework unable to start embedded container

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm following Spring in Action 4th Edition Chapter 5, but I'm stuck at the very first example. Here is my Eclipse Luna project structure: If I run this project as Spring Boot App, then it throws exceptions: org . springframework . context . ApplicationContextException : Unable to start embedded container ; nested exception is org . springframework . context . ApplicationContextException : Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean . at org . springframework . boot . context .

Configure Spring Boot for SPA frontend

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have application where whole frontend part is laying in resource. I would like to separate things apart. And have separate server for UI, provided by gulp, for example. So that I assume that my server should return index.html for all requests that are rendered by client side. Eg: I have 'user/:id' rout that is managing by angular routing and doesn't need server for anything. How can I configure so that server will not reload or redirect me to anywhere? My security config is following(don't know if it responsible for such things):

How to handle &#039;Rejected bean name - no URL paths identified&#039; in Spring?

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Spring Boot Application and I get at launch time the following messages: 7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor': no URL paths identified 7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor': no URL paths identified 7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context

Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have updated my dependecies like you said in your comment and i have this now : org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext