0

モバイルオペレーティングシステムでマルチプラットフォームのプッシュ通知システムを構築しています。私のサーバーは JSP サーブレットで書かれています。ウィンドウフォンプラットフォームでビルドするときに発生した問題。このオペレーティング システムで ASP サーバーを使用してプッシュ テストを試みたところ、うまく動作しました。しかし、私のサーバーは JSP なので、一貫性を保つために ASP から JSP に移行したいと考えています。これを行うために、 https: //github.com/notnoop/java-mpns のライブラリ mpns を使用しました。しかし、実行中にサーバーに障害が発生し、クライアントにメッセージを送信できません。

MpnsService service = MPNS.newService().build();へのデバッグで実行すると、、サーバーが停止し、再度実行されません。および WebBrowser エラー メッセージHTTP Status 500 - Servlet execution throw an exception

コードサーバー

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);
 }

 }

ウェブブラウザのエラー

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.
4

1 に答える 1

0

commons-loggin jar をアプリケーションに含める必要があります。ここで見つけることができますcommons.apache.org

ファイルをダウンロードしたら、それを開いて、commons-logging-1.1.3.jar という名前のファイルを Web アプリケーションにコピーします (最後のバイナリをダウンロードしたと仮定します)。

幸運を

于 2013-07-03T21:51:45.780 に答える