- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在本地运行没有问题的同一 war 文件失败,并出现以下循环错误:
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through field 'customSuccessHandler': Error creating bean with name 'customSuccessHandler': Unsatisfied dependency expressed through field 'engineerService': Error creating bean with name 'engineerServiceImpl': Unsatisfied dependency expressed through field 'engineerRepository': Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'engineerServiceImpl': Unsatisfied dependency expressed through field 'engineerRepository': Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customSuccessHandler': Unsatisfied dependency expressed through field 'engineerService': Error creating bean with name 'engineerServiceImpl': Unsatisfied dependency expressed through field 'engineerRepository': Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'engineerServiceImpl': Unsatisfied dependency expressed through field 'engineerRepository': Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535) ~[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369) ~[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313) ~[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:150) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:130) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169) [spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) [catalina.jar:8.0.43]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) [catalina.jar:8.0.43]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753) [catalina.jar:8.0.43]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729) [catalina.jar:8.0.43]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) [catalina.jar:8.0.43]
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092) [catalina.jar:8.0.43]
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834) [catalina.jar:8.0.43]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through field 'customSuccessHandler': Error creating bean with name 'customSuccessHandler': Unsatisfied dependency expressed through field 'engineerService': Error creating bean with name 'engineerServiceImpl': Unsatisfied dependency expressed through field 'engineerRepository': Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'engineerServiceImpl': Unsatisfied dependency expressed through field 'engineerRepository': Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customSuccessHandler': Unsatisfied dependency expressed through field 'engineerService': Error creating bean with name 'engineerServiceImpl': Unsatisfied dependency expressed through field 'engineerRepository': Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'engineerServiceImpl': Unsatisfied dependency expressed through field 'engineerRepository': Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engineerRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class mvc.domain.Engineer
看起来像我们的 CustomSuccessHandler -> Autowiring @Service -> 它又连接由 JPA 实体组成的存储库。它似乎不喜欢 JPA 实体。我遇到的问题是,在本地运行时,相同的 war 文件将加载而不会出现错误。
过去我已经能够在 pom 中切换依赖项版本,它将解决该问题。这非常不稳定,我似乎找不到可重复的模式
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.astontech.timecards</groupId>
<artifactId>com.astontech.timecards</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<!--<relativePath />-->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- ===================================================== -->
<!-- SPRING BOOT MODULES [DATA, WEB, SECURITY, TEST, REST] -->
<!-- ===================================================== -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<!--<scope>test</scope>-->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<!-- ============================================== -->
<!-- ============================================== -->
<!-- DATABASE DEPENDENCIES -->
<!-- ============================================== -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- ============================================== -->
<!-- ============================================== -->
<!-- TAG LIBRARIES [JSTL, JASPER, SPRING SECURITY] -->
<!-- ============================================== -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.security</groupId>-->
<!--<artifactId>spring-security-taglibs</artifactId>-->
<!--<version>4.0.3.RELEASE</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.springframework.security</groupId>-->
<!--<artifactId>spring-security-ldap</artifactId>-->
<!--<version>4.0.3.RELEASE</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<version>1.0.2.RELEASE</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.slf4j</groupId>-->
<!--<artifactId>slf4j-log4j12</artifactId>-->
<!--<version>1.6.3</version>-->
<!--<scope>compile</scope>-->
<!--</dependency>-->
<!-- ============================================== -->
<!-- ============================================== -->
<!-- WEB JARS [BOOTSTRAP CSS, JQUERY] -->
<!-- ============================================== -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery-ui</artifactId>
<version>1.10.3</version>
</dependency>
<!-- ============================================== -->
<!--Quartz is a batch scheduler-->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-jobs</artifactId>
<version>2.2.1</version>
</dependency>
<!-- ============================================== -->
<!-- SWAGGER API DOCUMENTATION -->
<!-- ============================================== -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.4.0</version>
</dependency>
<!-- ============================================== -->
<!-- CRM INTEGRATION-->
<!-- ============================================== -->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>oauth2-oidc-sdk</artifactId>
<version>4.5</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.astontech.global.notification</groupId>
<artifactId>global.notification</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.astontech.global.integration.crm</groupId>
<artifactId>global.integration.crm</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</repository>
<repository>
<id>org.jboss.repository.releases</id>
<name>JBoss Maven Release Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>central</id>
<name>artifactory.astontech.com-releases</name>
<url>http://artifactory.astontech.com:8081/artifactory/libs-release-local</url>
</repository>
</distributionManagement>
应用程序.java
package mvc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
public class Application extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main(String[] args)
{
SpringApplication.run(Application.class, args);
}
}
CustomSuccessHandler.java
package mvc.configuration;
import mvc.common.LogHelper;
import mvc.domain.Engineer;
import mvc.services.EngineerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.web.DefaultRedirectStrategy;
import org.springframework.security.web.RedirectStrategy;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@Component
public class CustomSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
@Autowired
EngineerService engineerService;
private RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
@Override
protected void handle(HttpServletRequest request, HttpServletResponse response,
Authentication authentication)
throws IOException {
HttpSession session = request.getSession();
System.out.println("CustomSuccessHandler - handle()");
String targetUrl = determineTargetUrl(authentication, session);
if (response.isCommitted()) {
System.out.println("Can't redirect");
return;
}
redirectStrategy.sendRedirect(request, response, targetUrl);
}
/*
This method extracts the roles of the currently logged-in user and returns
appropriate URL according to their role
ROLES: Timecard Admin
Timecard Billing
Timecard Engineer
Timecard Superuser
*/
protected String determineTargetUrl(Authentication authentication, HttpSession session) throws IOException{
String url = "";
Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();
List<String> roles = new ArrayList<String>();
for (GrantedAuthority grantedAuthority : authorities) {
roles.add(grantedAuthority.getAuthority());
}
LogHelper.viewMaster(true, false, "USER ROLES", roles);
if (isTimecardAdmin(roles)) {
LogHelper.viewMaster(true, "User has role: PAYROLL", "i");
session.setAttribute("userRole", "PAYROLL");
session.setAttribute("username", authentication.getName());
url = "/payroll";
}
else if (isTimecardBilling(roles)) {
LogHelper.viewMaster(true, "User has role: BILLING", "i");
url = "/billing";
}
else if (isTimecardEngineer(roles)) {
// ADD GENERAL ROLE OF "ENGINEER"
LogHelper.viewMaster(true, "User has role: ENGINEER", "i");
session.setAttribute("userRole", "ENGINEER");
// RETRIEVE ENGINEER DETAILS FROM DB & CRM
setCrmEngineer(session, authentication);
// REDIRECT
url = "/engineer";
}
else if (isTimecardSuperuser(roles)) {
LogHelper.viewMaster(true, "User has role: SUPER USER", "i");
session.setAttribute("userRole", "SUPER_USER");
url = "/super_user";
}
else {
url = "/accessDenied"; //todo: create an "/accessDenied" controller/view
}
return url;
}
private boolean isTimecardAdmin(List<String> roles) {
return (roles.contains("Timecard Admin") ||
roles.contains("ROLE_Timecard Admin") ||
roles.contains("ROLE_PAYROLL"));
}
private boolean isTimecardBilling(List<String> roles) {
return (roles.contains("Timecard Billing"));
}
private boolean isTimecardEngineer(List<String> roles) {
return (roles.contains("Field Engineer - Cisco") ||
roles.contains("Field Engineer - Dev") ||
roles.contains("ROLE_Field Engineer - Dev"));
}
private boolean isTimecardSuperuser(List<String> roles) {
return (roles.contains("Timecard Superuser") || roles.contains("ROLE_SUPER_USER"));
}
private void setCrmEngineer(HttpSession session, Authentication authentication) throws IOException{
//GET USERNAME BASED ON SPRING SECURITY METHOD
String username = authentication.getName();
LogHelper.viewMaster(true, true, "CRM ENGINEER:", username);
//SET USERNAME IN SESSION
session.setAttribute("username", username);
// CALL ENGINEER SERVICE TO RETRIEVE ENGINEER
Engineer loggedInEngineer = engineerService.getLoggedInEngineer(username);
// SET THAT INTO SESSION "loggedInEngineer"
session.setAttribute("loggedInEngineer", loggedInEngineer);
}
}
工程师服务和具体实现有点广泛,如果需要的话我可以发布它们。
EngineerRepository.java
package mvc.repositories;
import mvc.domain.Engineer;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
public interface EngineerRepository extends CrudRepository<Engineer, Integer> {
@Query("SELECT a from Engineer a where a.username = ?1")
Engineer findByUsername(String username);
@Query("SELECT COUNT(u) FROM Timecard u WHERE u.engineer.id=?1 AND u.isOnTime =false ")
int findTimeCardLateCount(Integer engineerId);
@Query("select a from Engineer a where a.isTrainee = ?1")
Iterable<Engineer> findByIsTrainee(boolean isTrainee);
}
工程师.java
package mvc.domain;
import javax.persistence.*;
@Entity
public class Engineer {
//region PROPERTIES
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@Version
private Integer version;
Boolean isOverTimeEligible = false;
Boolean isPtoEligible = false;
Boolean isTrainee = false;
private String adpId;
private String technology;
private String username;
@OneToOne (cascade = CascadeType.ALL, fetch = FetchType.EAGER)
CrmEngineer crmEngineer;
//region CONSTRUCTORS
public Engineer() {}
public Engineer(CrmEngineer crmEngineer) {
this.crmEngineer = crmEngineer;
this.username = crmEngineer.getAston_astonemailaddress().split("@")[0];
}
//endregion
public Engineer(String username) {
this.username = username;
}
public String getAdpId() {
return adpId;
}
public void setAdpId(String adpId) {
this.adpId = adpId;
}
public String getTechnology() {
return technology;
}
public void setTechnology(String technology) {
this.technology = technology;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public Boolean getIsOverTimeEligible() {
return isOverTimeEligible;
}
public void setIsOverTimeEligible(Boolean isOverTimeEligible) {
this.isOverTimeEligible = isOverTimeEligible;
}
public Boolean getIsPtoEligible() {
return isPtoEligible;
}
public void setIsPtoEligible(Boolean isPtoEligible) {
this.isPtoEligible = isPtoEligible;
}
public CrmEngineer getCrmEngineer() {
return crmEngineer;
}
public void setCrmEngineer(CrmEngineer crmEngineer) {
this.crmEngineer = crmEngineer;
}
public Boolean getIsTrainee() {
return isTrainee;
}
public void setIsTrainee(Boolean isTrainee) {
this.isTrainee = isTrainee;
}
}
最佳答案
我能够使用以下方法一致地重现这一点:
$ eb 部署
但是,如果我转到 GUI Web 控制台并从应用程序版本重新部署相同的 war,我就可以毫无问题地加载相同的 war 文件。
我猜测这是通过 python eb cli 工具部署 war 时 Elastic Beanstalk 代理出现的某种错误。
Elastic Beanstalk 版本:
运行 Tomcat 8 Java 8 的 64 位 Amazon Linux 2017.03 v2.6.1
eb cli 版本:
EB CLI 3.10.1 (Python 3.6.0)
当我部署时,我将通过网络 GUI 继续摇动 handle ,并认为这个问题已经解决。但是,如果其他人遇到过这个问题并且有更好的解决方法,我很想听听。
-干杯
关于java - Spring Boot war 在 Elastic Beanstalk 中启动时失败,但在本地运行时正确启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44770033/
有人可以解释一下 spring-boot-parent 和 spring-boot-starter-parent 之间的区别吗,正如我在下面附加的 GIT HUB 代码链接之一中看到的,他们为 spr
我有与 jersey 框架集成的 Spring Boot 应用程序。 现在,当我尝试运行该应用程序时,它只是停留在 Spring 启动徽标上,之后没有任何 react 。 我也尝试添加 -X ,但徽标
我指的是 Spring Boot 关于 的文档自动配置 和 执行器 模块: 自动配置: Spring Boot AutoConfiguration attempts to automatically
我正在尝试将 apache log4j 集成到我的 Spring boot 应用程序中。这是我的 build.gradle 文件: build.gradle buildscript { rep
使用 Spring Boot Maven 插件的以下命令在生产中启动 Spring Boot 应用程序是否是一个好主意或实践? mvn spring-boot:run 最佳答案 不,这是个坏主意。 您
据我所知,spring boot 和 spring session 为我们提供了一站式自动配置,但是当我的应用程序使用 session redis 和应用程序缓存 redis 时,不是同一个 redi
我希望使用Spring Boot创建一个新的Web应用程序。不幸的是,我的服务器在技术堆栈方面相当有限。它安装了Java 5。 谁能告诉我spring boot是否可以在Java 1.5上运行以及什么
我有3个实体 CarWash(设置Wash) Wash(car_wash_id FK到CarWash) WashComment(wash_id FK到Wash) 有什么办法可以写这个查询 @Qu
我一直在关注this文章。 我正在尝试在Spring-boot应用程序中优雅地处理gRPC错误,的主要目标是能够在gRPC客户端中获取错误状态。 在上面的文章之后,我坚持为异常添加拦截器。如何在Spr
我有一个要使用的自定义log4j布局插件。在IntelliJ中运行或与./gradlew bootRun一起运行时,插件可以正常工作。不使用./gradlew bootJar构建启动jar。 启用-D
我想在给定范围 (5001-5100) 的随机端口上启动 Spring Cloud 应用程序(Spring Boot 1.5.14,Spring Cloud Edgware.SR4)。我知道我们可以使
任何人都可以向我展示或指出不使用 spring boot gradle 插件的 spring boot gradle 项目。 我正在寻找类似不使用 gradle 插件的 spring boot sta
我当时尝试包含上述依赖项之一,但找不到任何区别: spring boot starter web:我可以看到 Flux 和 Mono 类并制作一个响应式(Reactive)休息 Controller
我们一直在为我们的应用程序使用 Springboot 1.X。 现在准备开始一些新的应用程序,想知道我们是应该使用 SpringBoot2.0 还是坚持使用 SpringBoot 1.X? 对一种方式
我希望记录应用程序正在加载 application-profile.propeties 或 application.yml。怎么做。在哪种方法中,我可以听取它并检测它是成功加载还是失败。 最佳答案 您
当我在 pom.xml 中添加简单的 spring-boot-starter-data-jpa 依赖项时,在 pom.xml 文件中出现错误。如果我删除该依赖项,则不会再有错误。我不确定为什么会发生这
我希望记录应用程序正在加载 application-profile.propeties 或 application.yml。怎么做。在哪种方法中,我可以听取它并检测它是成功加载还是失败。 最佳答案 您
我在网上看了很多关于 spring-boot-devtools 的文章和问题,但仍然无法弄清楚为什么它对我不起作用。每次运行我的应用程序时,我都会得到以下信息: 17:54:28.057 [main]
我正在尝试将现有的 Spring 应用程序移植到 Spring Boot。我不使用 spring-boot-starter-data-solr 启动器,但是我的类路径上有 apache solrj (
(这主要是一个历史问题。Pivotal 建议所有论坛讨论都在 StackOverflow 上进行,这就是我在这里问它的原因。) Spring Boot 项目用来证明将应用程序的类和依赖项从可执行 ja
我是一名优秀的程序员,十分优秀!