Java 窗口电话上的推送通知

Java 窗口电话上的推送通知,java,windows-phone-7,Java,Windows Phone 7,我正在移动操作系统上构建一个多平台推送通知系统。我的服务器是用jspservlet编写的。在Windows phone平台上构建时遇到的问题。我试过在这个操作系统上用ASP服务器推送测试,它们运行得很好。但因为我的服务器是JSP,所以为了保持一致性,我想从ASP转移到JSP。我使用了这里的库MPN来实现这一点。但在运行过程中,我的服务器出现故障,消息无法发送到客户端。您能帮我吗 当我在debug中运行它时,MpnsService=MPNS.newService().build(),服务器停止并不

我正在移动操作系统上构建一个多平台推送通知系统。我的服务器是用jspservlet编写的。在Windows phone平台上构建时遇到的问题。我试过在这个操作系统上用ASP服务器推送测试,它们运行得很好。但因为我的服务器是JSP,所以为了保持一致性,我想从ASP转移到JSP。我使用了这里的库MPN来实现这一点。但在运行过程中,我的服务器出现故障,消息无法发送到客户端。您能帮我吗

当我在debug中运行它时,MpnsService=MPNS.newService().build(),服务器停止并不再运行。和WebBrowser错误消息HTTP Status 500-Servlet执行引发异常

代码服务器

public class SendAllMessagesServlet extends BaseServlet {

@Override
 protected void doPost(HttpServletRequest req, HttpServletResponse resp)
  throws IOException, ServletException {
  String uri=req.getParameter("uri");
  String title=req.getParameter("title");
  String content=req.getParameter("content");
  String page=req.getParameter("page");
  MpnsService service =
          MPNS.newService()
                  .build();
  TileNotification tile = MPNS.newNotification().tile()
          .count(1).title(title).backBackgroundImage("http://sample.com/image.png")
          .backTitle(content)
          .build();
  String subscriptionUri = uri;
  service.push(subscriptionUri, tile);

//PushNotificationWP push=new PushNotificationWP();
//push.PushNotif(title,content,page,uri);
getServletContext().getRequestDispatcher("/home").forward(req, resp);
 }

 }
web浏览器上出现错误

HTTP Status 500 - Servlet execution threw an exception

type Exception report message Servlet execution threw an exception description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception root cause

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:187)
org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:146)
mpns.MpnsServiceBuilder.build(MpnsServiceBuilder.java:185)
SendAllMessagesServlet.doPost(SendAllMessagesServlet.java:32)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
 note The full stack trace of the root cause is available in the Apache Tomcat/7.0.37 logs.
HTTP状态500-Servlet执行引发异常
类型异常报告消息Servlet execution抛出异常描述服务器遇到内部错误,导致无法满足此请求。
例外
javax.servlet.ServletException:servlet执行引发异常的根本原因
java.lang.NoClassDefFoundError:org/apache/commons/logging/LogFactory
org.apache.http.impl.client.AbstractHttpClient.(AbstractHttpClient.java:187)
org.apache.http.impl.client.DefaultHttpClient。(DefaultHttpClient.java:146)
mpns.MpnsServiceBuilder.build(MpnsServiceBuilder.java:185)
doPost(SendAllMessagesServlet.java:32)
javaservlet.http.HttpServlet.service(HttpServlet.java:647)
javaservlet.http.HttpServlet.service(HttpServlet.java:728)
注意,根本原因的完整堆栈跟踪可在Apache Tomcat/7.0.37日志中找到。

您应该在应用程序中包含commons loggin jar。你可以在这里找到它

下载文件后,打开它并将名为commons-logging-1.1.3.jar的文件(假设您下载了最后一个二进制文件)复制到web应用程序中


祝你好运

你的问题解决了吗?