我在Java 11 / Spring Boot 2.1迁移中遇到问题,项目可以在其中进行编译,但运行仅返回时:
Connected to the target VM, address: '127.0.0.1:5754', transport: 'socket'
The Class-Path manifest attribute in C:\Users\{user}\.m2\repository\xalan\serializer\2.7.2\serializer-2.7.2.jar referenced one or more files that do not exist:
file:/C:/Users/{user}/.m2/repository/xalan/serializer/2.7.2/xml-apis.jar
The Class-Path manifest attribute in C:\Users\{user}\.m2\repository\xalan\xalan\2.7.2\xalan-2.7.2.jar referenced one or more files that do not exist:
file:/C:/Users/{user}/.m2/repository/xalan/xalan/2.7.2/xercesImpl.jar,file:/C:/Users/{user}/.m2/repository/xalan/xalan/2.7.2/xml-apis.jar,file:/C:/Users/{user}/.m2/repository/xalan/xalan/2.7.2/serializer.jar
Disconnected from the target VM, address: '127.0.0.1:5754', transport: 'socket'
Process finished with exit code 1
Run Code Online (Sandbox Code Playgroud)
我试过更新Maven版本,Maven编译器版本等。
我该如何解决?
我在日期逻辑方面遇到了一些问题,我已将其与 JSON 序列化程序 Jackson 隔离。
在数据库和应用程序的调试点中,日期是正确的,并且所有内容都使用默认时区编写。但是,在序列化中增加了 4 个小时。我发现这可以通过专门告诉 Jackson 使用 EST(默认为 UTC)来解决。如下:
@JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss.SSSZ", timezone="America/New_York")
private Date startDate;
Run Code Online (Sandbox Code Playgroud)
但是,问题是只有本地使用 EST,而服务器将使用 UTC。我需要杰克逊使用系统默认值。
@JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss.SSSZ", timezone=JsonFormat.DEFAULT_TIMEZONE)
private Date startDate;
Run Code Online (Sandbox Code Playgroud)
然而,它不起作用!我也尝试过timezone='DEFAULT_TIMEZONE'其他各种方法,但在所有情况下,api 输出似乎仍然比数据库中的数字早 4 小时。
我尝试过的其他事情:
JsonFormat.DEFAULT_TIMEZONE返回##default。TimeZone.getDefault().getDisplayName()返回Eastern Standard Time。杰克逊版本是 2.9。
有什么建议?
amazonlinux:2018.03.0.20190212在bitbucket管道中的docker映像上构建R时遇到错误。奇怪的是,如果我运行EC2(Amazon Linux 2018),则可以运行完全相同的命令而不会出错。
有谁知道如何解决这个问题?
make[6]: Entering directory `/opt/R/src/library/graphics/src'
mkdir -p -- ../../../../library/graphics/libs
make[6]: Leaving directory `/opt/R/src/library/graphics/src'
make[5]: Leaving directory `/opt/R/src/library/graphics/src'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[4]: Entering directory `/opt/R/src/library/graphics'
byte-compiling package 'graphics'
Error : .onLoad failed in loadNamespace() for 'utils', details:
call: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE)
error: error in running command
Error: unable to load R code in package 'graphics'
Execution halted
Run Code Online (Sandbox Code Playgroud)
在EC2上手动进行:
make[6]: Leaving directory `/opt/R/src/library/graphics/src'
make[5]: Leaving directory `/opt/R/src/library/graphics/src'
make[4]: Leaving directory `/opt/R/src/library/graphics'
make[4]: …Run Code Online (Sandbox Code Playgroud) 我在使以下代码工作时遇到了一些麻烦:
界面:
public interface UOWProcessor {
public default Integer countUOW(Object args) {
return 1;
}
}
Run Code Online (Sandbox Code Playgroud)
执行:
public class ListUOWProcessor implements UOWProcessor {
private Integer total;
@Autowired
private UOWProcessor uowProcessor;
@Override
public Integer countUOW(List<?> args) {
for (Object arg : args) {
total += uowProcessor.countUOW(arg);
}
return total;
}
}
Run Code Online (Sandbox Code Playgroud)
编辑:添加第二个实现以阐明意图
public class MapUOWProcessor implements UOWProcessor {
private Integer total;
@Autowired
private UOWProcessor uowProcessor;
@Override
public Integer countUOW(Map<?, ?> args) {
for (Object item : args.values()) {
total += uowProcessor.countUOW(item); …Run Code Online (Sandbox Code Playgroud)