我正在尝试使用该mvn deploy命令将一个大型 zip 文件 (305 MB) 部署到 artifactory ,但我遇到了管道损坏错误。我尝试通过浏览器的“部署”按钮上传相同的文件,并且工作正常。
是否有设置可用于增加套接字超时,或强制 maven/artifactory 等待包上传?
任何有关如何解决此问题的帮助表示赞赏。以下是日志条目和堆栈跟踪:
May 09, 2016 11:16:32 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://mvnrepo.dev.xyz.myorg.net:8080
May 09, 2016 11:17:02 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://mvnrepo.dev.xyz.myorg.net:8080: Broken pipe
May 09, 2016 11:17:02 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://mvnrepo.dev.xyz.myorg.net:8080
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.myorg.xyz.myapp:my-app-package:zip:0.1-svc20160509.151532-7 from/to xyz-service-snapshots (http://mvnrepo.dev.xyz.myorg.net:8080/artifactory/xyz-service-local): Broken pipe
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
... …Run Code Online (Sandbox Code Playgroud) 我在Spring引导应用程序中将RestTemplateBuilder与@ContextConfiguration一起使用时遇到问题(我尝试添加@ SpringBootTest,@ RunWith(SpringRunner.class)批注,但没有任何运气)。
任何帮助表示赞赏。这是背景:
我已经按照以下方式注释了我的课程:
@ContextConfiguration(classes = {
JsonNodeList.class,
JsonNodeUtils.class,
MyService.class,
RestClient.class,
RestTemplateBuilder.class}, loader = SpringBootContextLoader.class)
public class StepsDefinition {
Run Code Online (Sandbox Code Playgroud)
RestClient类的RestTemplateBuilder自动绑定为:
@Autowired
public RestClient(final RestTemplateBuilder restTemplateBuilder) {
this.restTemplate = configureRestTemplate(restTemplateBuilder);
}
Run Code Online (Sandbox Code Playgroud)
MyService类自动连接RestClient。当我尝试使用加载应用程序@ContextConfiguration有SpringBootContextLoader,我收到以下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restTemplateBuilder': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.client.RestTemplateBuilder]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.boot.web.client.RestTemplateBuilder.<init>()
Run Code Online (Sandbox Code Playgroud) integration-testing spring-test resttemplate spring-boot context-configuration
我有一个对象,例如Response.java,看起来像以下内容:
class Response
{
private User user; // has firstName, lastName, age etc.
private Address address; // has city, state, country etc.
private OrderInfo orderInfo; // has orderNumber, orderDate etc.
// constuctors, getters/setters follow
}
Run Code Online (Sandbox Code Playgroud)
我需要将这些对象的列表转换为csv,所以我的最终目标是:
firstName, lastName, age, city, state, country, latitude, orderNumber, orderDate
john, doe, 25, dallas, tx, usa, somelat, 101, 08/17/2015
jane, doe, 21, atlant, ga, usa, somelat, 102, 08/15/2015
Run Code Online (Sandbox Code Playgroud)
我尝试使用两个库-杰克逊(csv数据格式),org.json(JsonArray),但是我无法获得所需的结果。
这是我的杰克逊csv代码:
Response response = getResponse();
final CsvMapper mapper = new CsvMapper();
final CsvSchema schema = mapper.schemaFor(Response.class); …Run Code Online (Sandbox Code Playgroud) @Nullable
public String[] getX() {
return x;
}
public void setX(@Nullable final String[] x) {
this.x= x;
}
Run Code Online (Sandbox Code Playgroud)
上面的代码给出了PMD安全警告 - "安全 - 方法返回内部数组:返回'x'可以为getter公开内部数组,为setter提供类似的数组.
解决这个问题的一种方法是.clone()数组.由于这些是可空的,我将不得不进行空检查.我们有办法使用谷歌的番石榴库吗?
谢谢
我在本地机器上设置了一个 mongodb 副本集,并在名为“adaptive-db”的数据库中创建了几个集合。在 mongo shell 中,当我连接到主服务器并运行 show dbs 时,我可以查看和查询我的数据库“adaptive-db”。
然后我切换到次要,并运行 rs.slaveOk() 期望看到在主要中创建的“自适应数据库”也出现在次要中,但我没有看到它。
这是我运行的命令:
shell:bin user1$ ./mongo localhost:27017
MongoDB shell version: 3.0.2
connecting to: localhost:27017/test
rs0:PRIMARY> show dbs
adaptive-db 0.125GB
local 0.281GB
rs0:PRIMARY> use adaptive-db
switched to db adaptive-db
rs0:PRIMARY> show collections
people
student
system.indexes
rs0:PRIMARY> db.people.find().count()
6003
rs0:PRIMARY> exit
bye
shell:bin user1$ ./mongo localhost:27018
MongoDB shell version: 3.0.2
connecting to: localhost:27018/test
rs0:SECONDARY> show dbs
2015-06-25T11:16:40.751-0400 E QUERY Error: listDatabases failed:{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用nodejs 和express 创建一个简单的hello world azure 函数应用程序。但是,我收到以下错误:
Exception while executing function: Functions.httpexpressapp. mscorlib: Unable to determine function entry point. If multiple functions are exported, you must indicate the entry point, either by naming it 'run' or 'index', or by naming it explicitly via the 'entryPoint' metadata property.
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
函数.json
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req"
},
{
"type": "http",
"direction": "out",
"name": "res"
}
],
"entryPoint": "index",
"disabled": false
}
Run Code Online (Sandbox Code Playgroud)
索引.js:
const express = require('express') …Run Code Online (Sandbox Code Playgroud) azure node.js express azure-functions azure-functions-runtime
java ×2
artifactory ×1
azure ×1
csv ×1
express ×1
guava ×1
jackson ×1
json ×1
maven ×1
mongodb ×1
node.js ×1
org.json ×1
replicaset ×1
resttemplate ×1
spring-boot ×1
spring-test ×1