【问题标题】:GWT - Connect to talk.google.com from GWT ApplicationGWT - 从 GWT 应用程序连接到 talk.google.com
【发布时间】:2013-01-25 06:24:24
【问题描述】:

我想从我的 GWT 应用程序连接到谷歌服务器,以将谷歌聊天集成到我的应用程序中。 我曾尝试使用 emite gwt 库,但没有成功配置连接到 google 服务器所需的配置。

对此的任何帮助都非常感谢。

尝试在 GWT 应用程序中使用 Emite 时出现以下异常。

00:01:07.158 [INFO] Thu Jan 24 16:54:19 IST 2013 com.calclab.emite.core.client.bosh.XmppBoshConnection SEVERE: Connection error #1: Bad status: 302

在 web.xml 中

<servlet>
<servlet-name>Proxy</servlet-name>
<servlet-class>de.spieleck.servlets.ProxyServlet</servlet-class>
<init-param>
    <param-name>remotePath</param-name>
    <param-value>/http-bind/</param-value>
</init-param>
<init-param>
    <param-name>remoteServer</param-name>
    <param-value>talk.google.com</param-value>
</init-param>
<init-param>
    <param-name>remotePort</param-name>
    <param-value>5222</param-value>
</init-param>
</servlet>
<servlet-mapping>
    <servlet-name>Proxy</servlet-name>
    <url-pattern>/http-bind</url-pattern>
</servlet-mapping>

在 GWTModule.html 中

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="emite.httpBase" content="/http-bind">
<meta name="emite.host" content="talk.google.com">
<meta name="emite.session" content="login">
<meta name="emite.onBeforeUnload" content="logout">
<meta name="emite.user" content="abc@gmail.com">
<meta name="emite.password" content="xxxxx">
<meta name="emite.chat" content="xxxx@gmail.com">

我在这里错过了什么?

问候

【问题讨论】:

  • '没有成功'...有什么例外吗??
  • 我收到以下异常。 00:01:07.158 [INFO] Thu Jan 24 16:54:19 IST 2013 com.calclab.emite.core.client.bosh.XmppBoshConnection 严重:连接错误 #1:错误状态:302 remoteServer:talk.google.com remotePort : 5222
  • 请附上代码sn-p和错误日志作为其他开发者帮助你的起点。
  • 请求的类型是什么???
  • @SSR 请在上面找到sn-p。我需要知道,如何使用 Emite 库连接到 talk.google.com。

标签: java gwt xmpp google-talk


【解决方案1】:

经过一些搜索和尝试 - 谷歌似乎没有自己的 bosh 端点来代理对谷歌 xmpp 服务器的请求。 所以,不知何故 ProxyServlet 无法让我连接到谷歌服务器。

但现在我可以使用JabberHTTPBind 连接到谷歌服务器。 我使用了emite-0.4.7-proxies.jar,它捆绑了JabberHTTPBind servlet。 在 web.xml 中,添加了下面的 servlet 映射

    <servlet>
        <servlet-name>Jabber HTTP Binding Servlet</servlet-name>
        <servlet-class>org.jabber.JabberHTTPBind.JHBServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jabber HTTP Binding Servlet</servlet-name>
        <url-pattern>/http-bind/*</url-pattern>
    </servlet-mapping>

这对我有用。现在我可以使用 Emite 连接到谷歌服务器了。

【讨论】:

    猜你喜欢
    • 2014-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多