我使用Spring启动编写了一个Spring批处理应用程序.当我尝试在本地系统上使用命令行和类路径运行该应用程序时,它运行正常.但是,当我试图在Linux服务器上运行它时,它给了我以下异常
Unable to start web server; nested exception is
org.springframework.context.ApplicationContextException:
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
Run Code Online (Sandbox Code Playgroud)
以下是我运行它的方式:
java -cp jarFileName.jar; lib\* -Dlogging.level.org.springframework=DEBUG -Dspring.profiles.active=dev -Dspring.batch.job.names=abcBatchJob com.aa.bb.StartSpringBatch > somelogs.log
Run Code Online (Sandbox Code Playgroud) 我有一个弹簧启动应用程序。Docker 容器无权创建文件。
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ADD /build/libs/file-upload-service-2.0.0.jar app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Run Code Online (Sandbox Code Playgroud)
docker build -t file-upload-service .
Run Code Online (Sandbox Code Playgroud)
docker run -d --name file-upload-service -p 9104:9104 file-upload-service:latest
Run Code Online (Sandbox Code Playgroud)
sudo chown -R root:docker /home/storage/
sudo chmod -R 777 /home/storage/
Run Code Online (Sandbox Code Playgroud)
运行时java -jar,应用程序可以创建文件。
如何使用Java8流代码:
Specification<T> specification = specifications.getSpec(searchCriteria.getConditions().get(0));
for(int i = 1; i < searchCriteria.getConditions().size(); i++) {
specification = specification.and(getSpec(searchCriteria.getConditions().get(i)));
}
Run Code Online (Sandbox Code Playgroud)
使用Stream:
IntStream.range(1,searchCriteria.getConditions().size())
.mapToObj(index-> getSpec(searchCriteria.getConditions().get(index)))
.collect();//how to merge with calling and
Run Code Online (Sandbox Code Playgroud)
相关类&&方法:
@Getter
@Setter
public class SearchCriteria implements Serializable{
private static final long serialVersionUID = 1L;
private List<Condition> conditions;
private Integer limit;
private Integer offset;
@Getter
@Setter
public class Condition{
private String key;
private EConstant.OPERATION operation;
private String value;
}
}
public Specification<T> getSpec(SearchCriteria.Condition condition){
....
}
Run Code Online (Sandbox Code Playgroud) 我想知道如何从6000k+记录数据库中搜索单个记录。我已经为其编写了一个查询,但我面临的15s加载时间对于高效系统来说太长了,因此请帮助我以有效的方式进行搜索,以缩短搜索的响应时间。
$users = DB::select('select * from tablefour where Provider_Business_Mailing_Address_Fax_Number = ?', array($request['id']));
return $users;
Run Code Online (Sandbox Code Playgroud) 假设我有三个排序的数组
答:{ 4, 9 }
乙:{2, 11}
C : { 12, 14}
那么三元组 { x, y, z } 的数量,使得 x 属于 A,y 属于 B,z 属于 C,使得 x < y < z 是 -> 4
我知道 O( n ^3 ) 算法,但如何在 O(n) 中做到。其中 n 是数组的长度。
spring-boot ×3
algorithm ×1
c++11 ×1
docker ×1
dockerfile ×1
java ×1
java-8 ×1
laravel ×1
mysql ×1
sorting ×1
spring ×1
spring-batch ×1
sql ×1