我遇到以下设置问题:
摘自Maven依赖关系树
[INFO] +- org.springframework.data:spring-data-neo4j-rest:jar:2.3.1.RELEASE:compile
[INFO] | +- org.neo4j:neo4j-rest-graphdb:jar:1.9:compile
[INFO] | | \- org.neo4j:server-api:jar:1.9:compile
[INFO] | | +- org.neo4j.3rdparty.javax.ws.rs:jsr311-api:jar:1.1.2.r612:compile
[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | | \- commons-digester:commons-digester:jar:1.8.1:compile
[INFO] | | \- commons-beanutils:commons-beanutils:jar:1.8.0:compile
问题是:SDN的save API在部署到WebLogic时不起作用。尝试检索任何@NodeEntity
时,网络应用仍然没有问题。但是当应用程序尝试执行保存(我尝试过的API列表,下面)时,它总是会抛出错误。
我尝试了什么(两者产生相同的结果,错误):
repository.save(U entity);
neo4jTemplate.save(T entity);
我注意到的奇怪事情是:
GraphDatabaseFactory.databaseFor(url)
连接到Neo4j服务器时,我可以在Node
上运行保存(@NodeEntity
的SDN仍然无法正常工作。通过new SpringRestGraphDatabase(restUri)
连接后Node
和@NodeEntity
都不起作用。这两个API都返回org.neo4j.graphdb.GraphDatabaseService
堆栈跟踪:
]] Root cause of ServletException.
com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out
at com.sun.jersey.api.client.ClientResponse.close(ClientResponse.java:603)
at org.neo4j.rest.graphdb.RequestResult.extractFrom(RequestResult.java:83)
at org.neo4j.rest.graphdb.ExecutingRestRequest.put(ExecutingRestRequest.java:151)
at org.neo4j.rest.graphdb.ExecutingRestAPI.setPropertyOnEntity(ExecutingRestAPI.java:340)
at org.neo4j.rest.graphdb.RestAPIFacade.setPropertyOnEntity(RestAPIFacade.java:135)
Truncated. see log file for complete stacktrace
Caused By: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at weblogic.net.http.KeepAliveStream.close(KeepAliveStream.java:115)
Truncated. see log file for complete stacktrace
>
Tomcat(REST和嵌入式)都可以正常工作
嵌入式数据库中的一切工作正常(即使在WebLogic中)。
非常感谢任何帮助。
答案 0 :(得分:1)
该异常抛出com.sun.jersey.api.client.ClientResponse
/**
* Close the response.
* <p>
* The entity input stream is closed.
*
* @throws ClientHandlerException if there is an error closing the response.
*/
public void close() throws ClientHandlerException {
try {
entity.close();
} catch (IOException e) {
throw new ClientHandlerException(e);
}
}
此时Weblogic 12中的InputStream实现是weblogic.net.http.KeepAliveStream
代码204返回No Content,然后weblogic将其标记为未完整下载内容。
这里的解决方案是在启动你的weblogic时使用-DUseSunHttpHandler = true(bin / startWebLogic.cmd)
set JAVA_OPTIONS=%JAVA_OPTIONS% -DUseSunHttpHandler=true
的问候,
东