我从 Maven Alfresco 原型生成了一个项目:
mvn archetype:generate -Dfilter=org.alfresco:
Run Code Online (Sandbox Code Playgroud)
当我尝试构建时失败:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Mehrdad/alfresco/alfresco-platform/src/main/java/com/mehr/alfresco/platformsample/HelloWorldWebScript.java:[20,49] cannot access org.springframework.extensions.webscripts.Cache
bad class file: C:\Users\mehrdad.s\.m2\repository\org\alfresco\surf\spring-webscripts\7.9\spring-webscripts-7.9.jar(org/springframework/extensions/webscripts/Cache.class)
class file has wrong version 55.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for AIO - SDK 4.0 1.0-SNAPSHOT:
[INFO]
[INFO] AIO - SDK 4.0 ...................................... SUCCESS [ 1.063 s]
[INFO] Alfresco Platform/Repository JAR Module …Run Code Online (Sandbox Code Playgroud) Spring WebFlux 支持 OAuth2 授权服务器吗?我的意思是可以在 Spring 中开发一个反应式 OAuth2 授权服务器吗?如果没有,什么时候会添加到框架中?
我正在开发一个 Spring 应用程序,我正在将 JPA 与 MariaDB 用于我的数据库。当应用程序启动时,它首先抛出一些关于不存在的表的异常,但它会创建它们。该应用程序不会在出现错误后终止。
难道我做错了什么?
更新:
当我改变
spring.jpa.hibernate.ddl-auto=create-drop
Run Code Online (Sandbox Code Playgroud)
到
spring.jpa.hibernate.ddl-auto=update
Run Code Online (Sandbox Code Playgroud)
休眠不再抛出异常。
为什么?
日志总结:
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "alter table roles_privileges drop foreign key FK5yjwxw2gvfyu76j3rgqwo685u" via JDBC Statement
...
Caused by: java.sql.SQLSyntaxErrorException: (conn=105) Table 'users.roles_privileges' doesn't exist
...
Caused by: java.sql.SQLException: Table 'users.roles_privileges' doesn't exist
...
2019-10-29 18:13:00.866 WARN 821 --- [ main] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL "alter table roles_privileges drop foreign key FK9h2vewsqh8luhfq71xokh4who" via JDBC Statement
...
Caused by: java.sql.SQLSyntaxErrorException: …Run Code Online (Sandbox Code Playgroud) 我想POST向休息端点发送请求。其余端点文档说:
创建一个节点并将其添加为节点nodeId 的主要子节点。
该端点支持JSON和multipart/form-data(文件上传)。
使用多部分/表单数据
使用filedata字段来表示要上传的内容,例如,以下curl命令将在测试用户的主文件夹中创建一个包含test.txt内容的节点。
curl -utest:测试 -X POST 主机:port/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children -F filedata=@test.txt
您可以使用名称字段为新文件指定替代名称。
您可以使用 nodeType 字段来创建特定类型。默认为 cm:内容
我设法通过以下代码向此端点发送正确的请求:
@Override
public ResponseEntity<byte[]> postNode(String nodeId, byte[] content) {
MultiValueMap<String, Object> bodyMap = new LinkedMultiValueMap<>();
ByteArrayResource contentsAsResource = new ByteArrayResource(content) {
@Override
public String getFilename() {
return "name22222";
}
};
bodyMap.add("filedata", contentsAsResource);
///bodyMap.add("filedata", content);// why this does not work??!
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(bodyMap, headers);
return restTemplate.exchange("/nodes/{nodeId}/children", HttpMethod.POST, requestEntity, byte[].class, nodeId); …Run Code Online (Sandbox Code Playgroud) 我正在使用@SpringBootTest注释来运行集成测试。但它突然停止工作了!它不再加载上下文,它只是作为单元测试运行,并且所有注入的 bean 均为 null。我不记得我做了什么改变。那么,什么会导致这个问题呢?
Spring Boot 版本是 2.3。
上下文是通过添加来加载的@RunWith(SpringRunner.class)。
刚刚在 CentOS 7.6 上安装了 MongoDB,但无法启动,错误代码为 14:
[mehrdad@MHRS ~]$ sudo service mongod status
Redirecting to /bin/systemctl status mongod.service
? mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-02-07 16:55:16 +0330; 6s ago
Docs: https://docs.mongodb.org/manual
Process: 16586 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=14)
Process: 16582 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 16578 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 16574 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
Feb 07 16:55:16 MHRS systemd[1]: Starting MongoDB Database Server...
Feb …Run Code Online (Sandbox Code Playgroud) spring ×4
java ×2
hibernate ×1
http ×1
jpa ×1
mongodb ×1
oauth-2.0 ×1
spring-boot ×1
spring-test ×1
web ×1