我总是得到错误:
interface Item {
id: number;
messages: {
item1: string;
item2: string;
}[];
}
let typed: Item[] = json;
for (const item of typed) {
console.log(item.id);
if(!item.messages) continue;
for(const message of item.messages){
console.log(`${message.item1} - ${message.item2}`)
}
}
我在正在运行的日志中打印了加载库:
[2018-02-05T09:04:14.682+0000] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=26 _ThreadName=http-listener-1(1)] [timeMillis: 1517821454682] [levelValue: 900] [[
StandardWrapperValve[AddToOrderServlet]: Servlet.service() for servlet AddToOrderServlet threw exception
java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.partitions.PartitionsLoader
at com.amazonaws.regions.RegionMetadataFactory.create(RegionMetadataFactory.java:30)
at com.amazonaws.regions.RegionUtils.initialize(RegionUtils.java:64)
at com.amazonaws.regions.RegionUtils.getRegionMetadata(RegionUtils.java:52)
at com.amazonaws.regions.RegionUtils.getRegion(RegionUtils.java:105)
at com.amazonaws.client.builder.AwsClientBuilder.withRegion(AwsClientBuilder.java:239)
at AddToOrderServlet.doPost(AddToOrderServlet.java:201)
似乎我的lib是aws-java-sdk-1.11.268.jar,我甚至检查是否存在类PartitionsLoader。 运行环境是:glassfish4.1和我的jdk_version是:1.8.0_162。 谢谢你的帮助。