使用Java 8和Spring AOP 4.0.6我收到以下错误
java.lang.RuntimeException: Error scanning file MonitorAroundPerformance.class
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:705)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:821)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:531)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
at java.lang.Thread.run(Thread.java:745)
Caused by:
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:970)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:700)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:821)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:531)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
at java.lang.Thread.run(Thread.java:745)
Run Code Online (Sandbox Code Playgroud)
但是,当我将Java Source和target更改为1.7时,此错误就会消失.POM.xml设置 -
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.0.6.RELEASE</version> …Run Code Online (Sandbox Code Playgroud) 下面的视图由ajax呈现,并从控制器返回到JS,JS将视图放入正确的容器中:
$page = $this->renderAjax("view", [
"dataProvider" => $dataProvider
]) ;
Yii::$app->response->format = 'json';
return array("error"=>false,"page"=>$page);
Run Code Online (Sandbox Code Playgroud)
查看:
<?=
ListView::widget([
'id'=>'dataListId',
'dataProvider' => $dataProvider,
'itemOptions' => ['class' => 'item'],
'itemView' => '_dataItemView',
'summary'=>'',
'emptyText'=>$emptyPage
])
?>
<?=
$this->render("_activeFormPage")
?>
Run Code Online (Sandbox Code Playgroud)
messages?id = 1:950不赞成在主线程上使用同步XMLHttpRequest,因为它会对最终用户的体验产生不利影响。如需更多帮助,请访问https://xhr.spec.whatwg.org/。
但这在完全刷新时为同步XMLhttprequest在chrome中出现上述错误,其中我通过触发单击ajax并获取上述数据的按钮来模拟ajax。一旦渲染_activeFormPage的行被注释,错误就会消失。
我们如何摆脱同步ajax错误,因为在javascript中,从jquery进行ajax调用时,async已被保留为默认值
考虑具有主键的表作为columnd"id"
必须查询一系列id为[1,2,3,4 ......]
有2个选项 -
1)
Select * from Table where id = 1;
Select * from Table where id = 2;
Select * from Table where id = 3;
Select * from Table where id = 4;
Run Code Online (Sandbox Code Playgroud)
2)
Select * from Table where id in ( 1, 2, 3, 4 );
Run Code Online (Sandbox Code Playgroud)
对于Oracle而言,这两者中的哪一个在性能方面更好,并且使用Spring JDBC模板来实现持久性.假设数据集1,2,3,4将在java数据结构的限制范围内,请从应用程序的角度考虑内存约束.
它使用数据库连接池.
我见过像discourse这样的例子,其中关系数据库中的表没有外键。虽然 RDB 的其他租户仍在使用,如 CONSTRAINTS、INDEXES、FULLTEXTSEARCH 等,但根据 Rails Active record 指南,外键已被删除。
https://meta.discourse.org/t/foreign-key-constraints-in-db/2642
我们是否需要定期检查此类应用程序的一致性?在这种情况下,应该对每个请求-响应进行不存在无效外键的操作,并同时在应用层进行更正。
如果我们必须将ember-data及其save()和find()方法与postgrest样式的REST调用集成,那么ember-data本身就能理解json-api,我们需要在哪里进行更改?
我们是否需要在ember或某些服务器端逻辑中修改客户端,以便与ember-data要求进行映射.
因此,最后的REST api调用看起来像是从相关表格中获取电影及其标题和competition.name - >
http://localhost:3001/film?select=title,competition{name}
http://localhost:3001/users?select=email::text&id=eq.2&sign_in_count=eq.16
Run Code Online (Sandbox Code Playgroud) 使用下面的 API 和 input ,会消耗多部分/表单请求,但对于所有文件,键是静态“文件”,因为RequestPart("files") 但是所有字符串的键都是动态的,因为Map<String,String>。
@PostMapping(value = "/xyz", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> uploads(@RequestPart("files") MultipartFile[] outputFiles, @RequestParam Map<String, String> keyValues {
...
}
files - file_1_name
files - file_2_name
files - file_3_name
key1 - value1
key2 - value2
Run Code Online (Sandbox Code Playgroud)
然而下面的 API 并没有按预期工作。需要为上传的每个文件提供动态密钥,并且要上传的文件总数未知,因此使用 >Map<String, MultipartFile而不是MultipartFile[]。它仍然期望每个上传的文件都有静态密钥“outputFiles”。
@PostMapping(value = "/xyz", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> uploads(@RequestPart Map<String, MultipartFile> outputFiles, @RequestParam Map<String, String> keyValues {
...
}
Input
======
file_1_name …Run Code Online (Sandbox Code Playgroud) java ×3
spring ×2
ember-data ×1
ember.js ×1
jetty ×1
jquery ×1
oracle ×1
postgresql ×1
postgrest ×1
spring-aop ×1
spring-batch ×1
spring-boot ×1
spring-jdbc ×1
spring-mvc ×1
sql ×1
yii2 ×1