boot

NoSuchMethodError: org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute

匿名 (未验证) 提交于 2019-12-03 00:58:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use spring-data-redis in a spring-boot application to work with redis. I am creating JedisConnectionFactory as follows: RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(); configuration.setHostName("localhost"); configuration.setPort(6379); JedisConnectionFactory connectionFactory = new JedisConnectionFactory(configuration); It throws the exception: Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute(Ljava

Exception in thread “main” java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am facing the following error. Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : org.springframework.boot.autoconfigure.SharedMetadataReaderFactoryContextInitializer at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:414) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:394) at org.springframework.boot.SpringApplication

springframework.security package not found with starter-security dependency?

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using spring boot and spring starter dependencies for my project. I tried with spring starter security dependency in Gradle , but only security packages are not found in project. IDE is IntelliJ IDEA My build.gradle file : buildscript { ext { springBootVersion = '1.2.7.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") classpath('io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE') classpath("org.springframework:springloaded:1.2.4.RELEASE

Could not find method springBoot() for arguments - Spring Boot using Kotlin

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I try to create the very first Spring Boot application with Kotlin. So, maybe I made some obvious errors or something like that. My gradle.build is: buildscript { ext.kotlin_version = '1.0.5-2' ext.spring_boot_version = '1.4.2.RELEASE' repositories { jcenter() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_version" } } apply plugin: 'idea' apply plugin: 'kotlin' apply plugin: 'application' jar { baseName = 'rest-voter' version =

Springboot logback configuration

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tryng to configure my springboot app to log in one file for day so I configure my logback.xml just like this: <?xml version="1.0" encoding="UTF-8"?> <configuration> <include resource="org/springframework/boot/logging/logback/base.xml"/> <appender name="ROLLIN" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOG_FILE}</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover --> <fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.log</fileNamePattern> </rollingPolicy> </appender> <root

I used composer to upgrade to Laravel 5.3, which broke it

匿名 (未验证) 提交于 2019-12-03 00:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here's the exception I get now when I try to run my page. I've tried removing and recreating the bootstrap/cache based on some recommendations I've seen online. I've tried removing the arguments in the ServiceProvider files for the boot method. Nothing works. ErrorException in EventServiceProvider.php line 9: Declaration of App\Providers\EventServiceProvider::boot() should be compatible with Illuminate\Foundation\Support\Providers\EventServiceProvider::boot() in EventServiceProvider.php line 9 at HandleExceptions->handleError('2048',

Spring boot Test fails saying, Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Test Class:- @RunWith(SpringRunner.class) @SpringBootTest(classes = { WebsocketSourceConfiguration.class, WebSocketSourceIntegrationTests.class }, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "websocket.path=/some_websocket_path", "websocket.allowedOrigins=*", "spring.cloud.stream.default-binder=kafka" }) public class WebSocketSourceIntegrationTests { private String port = "8080"; @Test public void testWebSocketStreamSource() throws IOException, InterruptedException { StandardWebSocketClient webSocketClient =

spring-boot-starter-tomcat vs spring-boot-starter-web

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to learn Spring boot and I notice there are two options. spring-boot-starter-web - which according to the docs gives support for full-stack web development, including Tomcat and web-mvc spring-boot-starter-tomcat Since #1 supports Tomcat why would one want to use #2? What are the differences? Thanks 回答1: Since #1 supports Tomcat why would one want to use #2? spring-boot-starter-web contains spring-boot-starter-tomcat . spring-boot-starter-tomcat could potentially be used on its own if spring mvc isn't needed (contained in spring

Spring boot 集成 Redis

匿名 (未验证) 提交于 2019-12-03 00:44:02
Spring boot 集成 Redis 定义(摘自百度百科 https://baike.baidu.com/item/Redis/6549233): 步骤: 1.在pom.xml中配置相关的jar依赖 <!-- sping boot redis --> <dependency> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-starter-data-redis </artifactId> </dependency> 2.在spring boot核心配置文件application.properties中配置redis连接信息 # redis spring.redis.port = 6379 spring.redis.host = localhost spring.redis.password = 123456 3.配置了上面的步骤,spring boot将自动配置Redis Template,在需要操作redis的类中注入redis Template 文章来源: Spring boot 集成 Redis

为什么学习 Spring Boot?

匿名 (未验证) 提交于 2019-12-03 00:43:02
我们知道,从 2002 年开始,Spring 一直在飞速的发展,如今已经成为了在Java EE(Java Enterprise Edition)开发中真正意义上的标准,但是随着技术的发展,Java EE使用 Spring 逐渐变得笨重起来,大量的 XML 文件存在于项目之中。繁琐的配置,整合第三方框架的配置问题,导致了开发和部署效率的降低。 2012 年 10 月,Mike Youngstrom 在 Spring jira 中创建了一个功能请求,要求在 Spring 框架中支持无容器 Web 应用程序体系结构。他谈到了在主容器引导 spring 容器内配置 Web 容器服务。这是 jira 请求的摘录: 我认为 Spring 的 Web 应用体系结构可以大大简化,如果它提供了从上到下利用 Spring 组件和配置模型的工具和参考体系结构。在简单的 main() 方法引导的 Spring 容器内嵌入和统一这些常用Web 容器服务的配置。 这一要求促使了 2013 年初开始的 Spring Boot 项目的研发,到今天,Spring Boot 的版本已经到了 2.0.3 RELEASE。Spring Boot 并不是用来替代 Spring 的解决方案,而是和 Spring 框架紧密结合用于提升 Spring 开发者体验的工具。同时它集成了大量常用的第三方库配置,Spring