我正在使用json-view根据我的需要创建一个动态json,它是一个很棒的库,我现在正在使用这个库一段时间.最近我遇到了一个使用案例的问题,让我先放置我的代码
public class User {
private String name;
private String emailId;
private String mobileNo;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmailId() {
return emailId;
}
public void setEmailId(String emailId) {
this.emailId = emailId;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
}
Run Code Online (Sandbox Code Playgroud)
public class ScreenInfoPojo {
private Long id;
private String name;
private ScreenInfoPojo parentScreen; …Run Code Online (Sandbox Code Playgroud) 我正在使用ejabberd服务器和ios xmppframework.有两个客户,A和B.
- 当A和B在线时,A可以成功向B发送消息.
- 如果B离线,B可以在B再次联机时收到消息.
- 但是当B突然/意外地丢失连接时,例如手动关闭wi-fi,A发送的消息就会丢失.B永远不会收到此消息.
我想原因是B突然失去连接,服务器仍然认为B在线.因此,离线消息在这种情况下可以正常工作.
所以我的问题是如何确保B发送的消息将被B接收?确保没有消息丢失.
假设有两个类,它们需要彼此:容器和项目.类容器创建类项的实例.类项的每个实例都包含一个类容器的实例,只需要调用类容器的方法method_called_by_item.类容器需要查看类项的所有字段.
问题是前向声明:我想在item.h中有一个前向声明,这样类项可以有一个容器作为字段并调用方法method_called_by_item.我怎么做?
类容器,用于创建项目.
// container.h
#ifndef CONTAINER_H
#define CONTAINER_H
#include "item.h"
class container{
public:
item * create_item();
void method_called_by_item(item * i);
};
#endif //CONTAINER_H
Run Code Online (Sandbox Code Playgroud)
实施:
// container.cpp
#include "container.h"
item * container::create_item(){
return new item(this);
}
void container::method_called_by_item(item * i){
// do stuff with item
}
Run Code Online (Sandbox Code Playgroud)
类项,需要调用一个容器 …
我们正在使用谷歌地图android api 2.0在我们的Android应用程序中提供地图功能.在我们的应用程序中,Google地图将用于捕获和显示以下用例的位置.
Whenever a client opens the application (from androiddevice ) depending upon location
services current location will be captured and using reverse geocoding process
appropriate address will be generated.
In reverse flow if any end user wants to enter address manually, using geocoding Service
appropriate location will be showed on the map.
Run Code Online (Sandbox Code Playgroud)
这是我的问题
1 >> daily map load(api calls) limit for google map android api 2.0谷歌地图javascript api 3.0(每天25k地图加载)是什么?
2 >>什么是geocoding(android.location.Geocoder) limits(No. of geocoding request) per day? …
在Internet上搜索了很多之后我们得出了一个结论,为了确保与XMPP服务器保持连接,我们必须创建一个服务,
我们已经创建了一个使用Smack库连接XMPP服务器,并且它可以与移动和Wi-Fi网络一起使用.
每次你做出一些设计方法总是很重要!!!,Smack已经隐藏地实现了这个重新连接机制,在那里监听连接,如果连接丢失,Smack会尝试在某个时间间隔重新连接XMPP服务器.
我们的用例场景::
INTERNET连接可以是因为wifi或数据网络,这里如果连接转是空闲状态有人关闭屏幕cpu进入睡眠现在任何数据都发送到服务器上这个连接将没有响应,因为服务器不再是在监听客户端,在客户端XMPP连接已经处于连接模式,连接监听器没有检测到与服务器的任何断开连接,所以这里流程完成了.
在INTERNET上搜索后,我们发现解决这个问题的可能解决方法是在修复后ping服务器(我们使用1分钟作为修复周期),检测到ping失败后,我们实现了与smack相同的重新连接机制(从Smack重新连接机制中获取的想法)本身)通过利用计时器任务.
问题::我们唯一的问题是电池耗尽,如果用户仍然与INTERNET连接并且重新连接间隔增加,它将耗尽电池.
1).上述问题的可能解决方案是什么?
2).我们应该采取另一种方法吗?
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringUploa]]
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:917)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringUploa]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 6 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextException
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:256)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:86)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:63)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:334)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:774) …Run Code Online (Sandbox Code Playgroud) I am working on a chat app using xmpp,As per our requirement we have three server Apache Tomcat 7,ejabbered 2.1.11 and mysql 5.5,
to run xmppbot on tomcat used below library
-Smack-core-4.0.3.jar
-smack-tcp-4.0.3.jar
-xlightweb2.5.jar
-xpp3-1.1.3.3.jar
-xSocket-2.4.6.jar
Run Code Online (Sandbox Code Playgroud)
Using above library I am able to Connect with ejabberd and able to login with my login id and password but after some time of logging in connection gets close automatically and a am getting below stack trace
Sep 16, 2014 4:36:01 PM org.jivesoftware.smack.XMPPConnection …Run Code Online (Sandbox Code Playgroud)