ICode9

精准搜索请尝试: 精确搜索
  • 如何使用Spring Boot和@FeignClient发送Bearer授权令牌2019-07-24 10:29:43

    我使用Spring Boot编写一个与HTTP rest服务器交互的应用程序.我正在连接的服务器之一(Wit.ai)使用beaerer授权令牌.产生成功响应的curl请求如下所示: GET /message?q=sample message HTTP/1.1 Host: api.wit.ai Authorization: Bearer XXXXXXXXXXXXX Cache-Control: no-cache Postm

  • 任务’执行失败’:common:compileJava’. > java.lang.ExceptionInInitializerError2019-07-24 10:29:23

    每当添加lombok 1.16.20或gradle任务运行完美时都会出现错误,这里是构建脚本,但是它在intelliJ上运行但不能使用gradle clean构建. Erro堆栈是: 任务’执行失败’:common:compileJava‘. &GT java.lang.ExceptionInInitializerError buildscript { repositories { mavenCentral()

  • 扩展弹簧启动装载机2019-07-23 01:19:40

    我不理解spring-boot-loader的README文件中提供的信息 https://github.com/spring-projects/spring-boot/tree/master/spring-boot-tools/spring-boot-loader 除了弹簧启动内部用于创建嵌入式服务器jar文件之外,spring boot loader的目的究竟是什么.我们可以利用这个过程并从文件路

  • 使用自定义ErrorAttributes测试Spring Boot应用程序?2019-07-22 18:20:38

    我正在尝试测试应该使用自定义错误属性的Spring Boot RestController. @Bean public ErrorAttributes errorAttributes() { return new DefaultErrorAttributes() { @Override public Map<String, Object> getErrorAttributes( RequestA

  • 如何创建依赖于Spring Bean的自定义Spring PropertySource2019-07-22 18:20:18

    我正在尝试将spring-cloud堆栈用于将使用Zuul的项目.在我的组织中,我们有一个基于xml的自定义配置堆栈,并进行属性组合和分层覆盖.由于处理这种配置的方式,我一直在努力为它创建一个PropertySource. 我的自定义PropertySource必须使用我的Config bean,但是因为在Spring Boot引导期

  • java – spring requestmapping文件扩展名的错误4062019-07-22 18:01:24

    我创建了这个REST映射,以便它可以接受URI末尾的文件名… @RequestMapping(value="/effectrequest/{name}/{imagename:[a-zA-Z0-9%\\.]*}", headers="Accept=*/*", method=RequestMethod.GET, produces = "application/json") public @ResponseBo

  • 不在Spring引导,Thymeleaf和AngularJs应用程序中加载静态资源2019-07-22 17:18:36

    我有一个Spring Boot项目,必须启动角度水疗.资源文件夹的结构如下: 在templates / src文件夹中有我从控制器开始的index.html文件: @RequestMapping("/") String index() { return "src/index"; } 通过这种方式,我成功启动了index.html,但所有的反应都在: > bower_components >

  • 如何使用注释在spring批处理中运行多个作业2019-07-22 15:20:34

    我正在使用Spring Boot Spring Batch(注释),遇到了我必须运行2个作业的场景. 我有需要使用spring批处理更新的Employee和Salary记录.我按照本教程spring-batch getting started tutorial为Employee和Salary对象配置了BatchConiguration类,分别命名为BatchConfigurationEmployee& Ba

  • java – FlatFileParseException解析错误 – Spring Batch2019-07-22 15:20:14

    我遵循这个tutorial,我得到FlatFileParseException错误: org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 1 in resource=[class path resource [country.csv]], input=[AA,Aruba] country.csv AA,Aruba BB,Baruba 这是我的ItemRead

  • spring – 405不允许POST的方法2019-07-22 15:19:57

    我有一个非常简单的spring启动应用程序,它由以下代码保护: http.authorizeRequests() .antMatchers("/admin/**").access("hasRole('ROLE_ADMIN')") .and() .formLogin().loginPage("/login").failureUrl("/login?error&quo

  • java – 如何使用Spring Boot连接H2作为远程数据库而不是嵌入模式?2019-07-22 15:02:57

    对于我的小型Spring Boot应用程序,我在src / main / resources下有这个配置: server.port = 8090 spring.datasource.driverClassName = org.h2.Driver spring.datasource.url = jdbc:h2:file:~/stapler 我知道此配置已正确选取,因为应用程序启动日志中有有效的端口号8090.还有一

  • java – 关闭应用程序后删除的Spring JPA数据2019-07-22 13:19:54

    我有一个基于Spring引导的应用程序,使用HSQL数据库上的JPA存储库. 问题是,当应用程序运行时,我创建了一个实体,并且它正确地保存到数据库(可以在数据库管理器中看到).但是从eclipse关闭应用程序后,所有数据都被删除了; 保存是这样执行的 @Service public class NotificationServic

  • java – 在Spring Boot中使用@TestPropertySource覆盖@PropertySource2019-07-22 13:19:34

    我有我的Spring Boot主类: @SpringBootApplication @PropertySource("file:/my/file/properties") public class Application extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder build

  • Spring Boot Thymeleaf没有找到消息属性2019-07-22 13:19:13

    我正在尝试使用Spring Boot和Thymeleaf创建一个Web应用程序,并且无法使模板使用属性文件中定义的消息.而不是在属性文件中定义的消息,而是显示?? form.welcome_en_GB ??控制台未记录任何错误. 项目结构是这样的 ──┬

  • 如何将swagger与jersey spring-boot集成2019-07-22 13:01:49

    我正在使用springboot jersey进行web restful实现.现在我要将swagger整合到我们的应用程序中.我做了以下. @Configuration @EnableSwagger2 public class JerseyConfiguration extends ResourceConfig { public JerseyConfiguration(){ register(HelloworldAPI.class

  • java – Spring安全绕过URL或过滤器2019-07-22 13:01:14

    我有一个只暴露REST API的Spring Boot应用程序.我需要保护它并且我使用基于令牌的方法 – 特别是JWT. 到目前为止,这是我实施的: // // The Spring Security configuration class @EnableGlobalAuthentication public class SecurityConfig extends WebSecurityConfigurerAdapter {

  • Spring Boot – 多个模板位置2019-07-22 12:19:15

    我希望Spring在不同的位置寻找模板,而不仅仅是在src / main / resource / templates /中. 我在这里 @Configuration public class WebConfig{ @Autowired private SpringTemplateEngine templateEngine; @PostConstruct public void clientTemplate(){

  • 如何在spring数据jpa中抛出搜索方法的异常2019-07-22 11:19:09

    我正在使用spring-data-jpa存储库进行数据库操作.如果数据库中的对象不存在于我的存储库中的所有方法,我想抛出异常.例如,在OrderRepository中考虑以下方法 findByCustomerAndPayment(Customer customer, Payment payment); 我想基于customerId和paymentId查询所有订单.这些对象

  • java – Spring Boot Actuator:如何在自定义HealthIndicator中获取指标正常运行时间?2019-07-22 11:02:34

    我想做一个取决于应用程序正常运行时间的自定义HealthIndicator. @Component public class HealthActuator implements HealthIndicator { private final MetricsEndpoint metricsEndpoint; @Autowired public HealthActuator(MetricsEndpoint metricsEndpoint) {

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有