我正在创建一种从文件中写入和读取工作簿的方法,但是当我第二次调用此方法时.发生错误:org.apache.xmlbeans.impl.values.XmlValueDisconnectedException
public XSSFWorkbook GetUpdatedResult(XSSFWorkbook vmworkbookhelper) throws Exception
{
this.vmWorkbookHelper2 = vmworkbookhelper;
String tempName = UUID.randomUUID().toString()+".xlsx";
File tempFile = new File(tempName);
fileOut = new FileOutputStream(tempFile);
this.vmWorkbookHelper2.write(fileOut);
fileOut.close();
vmworkbookhelper = new XSSFWorkbook(tempFile);
if(tempFile.exists())
tempFile.delete();
return vmworkbookhelper;
}
Run Code Online (Sandbox Code Playgroud) 我正在使用smack 4.1库,我无法恢复消息事件.
这是我的代码 -
Chat chat = connection.getChatManager().createChat("user2@openfireserver", new MessageListener() {
@Override
public void processMessage(Chat arg0, Message arg1) {
System.out.println(arg1.getBody());
}
});
chat.sendMessage("test message");
Run Code Online (Sandbox Code Playgroud)
调试报告 -
<message id="WrfOv-14" to="user1@openfireserver/Smack" from="user2@openfireserver/Smack" type="chat"><body>my test application</body><thread>56b1a75c-69a5-4a12-b12a-d24e072a2ce7</thread></message>
Run Code Online (Sandbox Code Playgroud)
在调试中接收聊天节目但在processMessage方法中没有获取事件.(可能我的问题是重复但我找不到相关的答案)
我是新手,对 get、post、put、delete、option、head 等 http 方法感到困惑,任何人都可以分享我一个简单的例子。
这是我的例子:
@GET
@Produces("text/plain")
public String getIt() {
return "Hi there!";
}
@DELETE
@Produces("text/plain")
@Path("/getItDelTest")
public String getItDelTest()
{
return "Hi there is getITDelTest method";
}
@HEAD
@Produces("text/plain")
@Path("/getItHeadTest")
public String getItHeadTest()
{
return "Hi there is getITHeadTest method";
}
@PUT
@Produces("text/plain")
@Path("/getItPutTest")
public String getItPutTest()
{
return "Hi there is getITPutTest method";
}
@POST
@Produces("text/plain")
@Path("/getItPost")
public String getItPost()
{
return "Hi there is getItPost method";
}
Run Code Online (Sandbox Code Playgroud)
在这个例子上面,我只是创建了一个具有 diffrent-2 性质的简单方法,但我不明白为什么我们需要所有这些,如果我们能够通过 post 完成所有这些操作