scala - java.util.NoSuchElementException:未定义命名属性
问题描述
我有一个问题:我想读取多个 xml 文件(file1.xml、file2.xml ......),对于我在内存中读取的每个文件,然后我编辑并发送请求。阅读和编辑它的工作没有任何问题,但是当我发送请求时:
//some declarations
.......
var payload=""
try{
myscenario= scenario ("scenario Name")
.exec{mysession : Session =>
//open files, list all files
for (file <-listofmyfile) {
//some regex that i reuse in payload
// payload contains the change that i would like to add for each xml file
payload=(// some function and text message.... "XXX")
}
mysession
}
.exec("protocol used".requestReply.message(StringBody( session =>
session(payload).as[String]))
.check(substring("XXX"))
)
}
setUp(myscenario.inject....)}
我得到这 2 个错误:
[ERROR] i.g.c.s.w.BufferedFileChannelWriter - Buffer overflow, you shouldn't be logging that much data. Truncating.
[ERROR] i.g.t.a.RequestReply - crashed on session Session
java.util.NoSuchElementException:没有定义名为“payload”的属性
解决方案
推荐阅读
- java - 具有可变参数的抽象方法
- node.js - 带有 Yarn 工作区的 Firebase 函数
- prolog - Eclipse-clp 中的 nth1 谓词可能存在错误?
- reactjs - Redux Store 在 getInitialProps 中填充,但在客户端为空
- python - Python Scrapy - 从 url 抓取的不是 start_urls 中设置的
- flutter - 在没有 SetState 的情况下调用持久性底页(使用 StreamBuilder)
- python - 如何将列表列表转换为字节?
- php - If Else with isset: else 部分不起作用 [PHP]
- javascript - 谷歌浏览器片段:标识符“...”已被声明
- r - 为相关矩阵选择变量