草庐IT

java - Gradle 无法解析 org.springframework.boot :spring-boot-gradle-plugin:1. 4.2.RELEASE (repo1.maven.org: Nome o servizio sconosciuto)

我在Jenkins上运行gradle构建时遇到问题:Gradle版本是https://services.gradle.org/distributions/gradle-2.14.1-bin.zipFAILURE:Buildfailedwithanexception.*Whatwentwrong:Aproblemoccurredconfiguringrootproject'myApp'.>Couldnotresolvealldependenciesforconfiguration':classpath'.>Couldnotresolveorg.springframework.boot:s

java - 如何防止嵌入式netty服务器从spring-boot-starter-webflux启动?

我想使用Springs新的响应式webflux扩展在客户端和服务器应用程序之间建立通信。对于依赖管理,我使用gradle。我在服务器端以及客户端的build.gradle文件基本上是:buildscript{repositories{mavenCentral()maven{url"https://repo.spring.io/snapshot"}}dependencies{classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.0.BUILD-SNAPSHOT")}}repositories{mavenCent

java - 如何防止嵌入式netty服务器从spring-boot-starter-webflux启动?

我想使用Springs新的响应式webflux扩展在客户端和服务器应用程序之间建立通信。对于依赖管理,我使用gradle。我在服务器端以及客户端的build.gradle文件基本上是:buildscript{repositories{mavenCentral()maven{url"https://repo.spring.io/snapshot"}}dependencies{classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.0.BUILD-SNAPSHOT")}}repositories{mavenCent

spring - 从 Spring Boot 应用程序访问 SessionFactory

我正在尝试访问Hibernatesession工厂,但在提到的行出现以下错误。NoCurrentSessionContextconfigured!代码@Service@TransactionalpublicclassGenericSearchImplimplementsGenericSearch{@AutowiredprivateEntityManagerFactoryentityManagerFactory;@Override@SuppressWarnings("unchecked")publicListsearch(finalClasstype,finalString[]crite

spring - 从 Spring Boot 应用程序访问 SessionFactory

我正在尝试访问Hibernatesession工厂,但在提到的行出现以下错误。NoCurrentSessionContextconfigured!代码@Service@TransactionalpublicclassGenericSearchImplimplementsGenericSearch{@AutowiredprivateEntityManagerFactoryentityManagerFactory;@Override@SuppressWarnings("unchecked")publicListsearch(finalClasstype,finalString[]crite

java - Spring boot ComponentScan excludeFIlters 不排除

我正在进行SimpleTest:@RunWith(SpringRunner.class)@SpringBootTest(classes=SimpleTestConfig.class)publicclassSimpleTest{@Testpublicvoidtest(){assertThat(true);}}以及此测试的配置:@SpringBootApplication@ComponentScan(basePackageClasses={SimpleTestConfig.class,Application.class},excludeFilters=@ComponentScan.Filt

java - Spring boot ComponentScan excludeFIlters 不排除

我正在进行SimpleTest:@RunWith(SpringRunner.class)@SpringBootTest(classes=SimpleTestConfig.class)publicclassSimpleTest{@Testpublicvoidtest(){assertThat(true);}}以及此测试的配置:@SpringBootApplication@ComponentScan(basePackageClasses={SimpleTestConfig.class,Application.class},excludeFilters=@ComponentScan.Filt

java - 带有嵌入式tomcat的spring-boot不会将请求分派(dispatch)给 Controller

我有一个使用spring-boot和嵌入式Tomcat容器的应用程序。据我所知,我的代码与spring-bootsampleproject相同.但是,当我运行测试时,我得到的是404而不是200(在我尝试发布而不是获取的情况下,我收到405,这与Tomcat设置不正确一致):Failedtests:UserControllerTest.testMethod:45Statusexpected:butwas:我的基于Java的配置(省略了一些配置类):@Configuration@ComponentScan@EnableAutoConfiguration@Import({ServiceCo

java - 带有嵌入式tomcat的spring-boot不会将请求分派(dispatch)给 Controller

我有一个使用spring-boot和嵌入式Tomcat容器的应用程序。据我所知,我的代码与spring-bootsampleproject相同.但是,当我运行测试时,我得到的是404而不是200(在我尝试发布而不是获取的情况下,我收到405,这与Tomcat设置不正确一致):Failedtests:UserControllerTest.testMethod:45Statusexpected:butwas:我的基于Java的配置(省略了一些配置类):@Configuration@ComponentScan@EnableAutoConfiguration@Import({ServiceCo

spring - 如果我使用 Spring Boot 将 web 应用程序开发为 war ,为什么我需要 main 方法?

我正在使用SpringBoot开发Web应用程序。我的典型部署是生成war并将其放在Tomcat目录下的webapps文件夹中。我注意到SpringBoot,我需要一个main方法。我想知道为什么需要这样做。如果有办法避免它,那会是什么?@SpringBootApplicationpublicclassApplicationextendsSpringBootServletInitializer{@OverrideprotectedSpringApplicationBuilderconfigure(SpringApplicationBuilderapplication){returnap