gpt4 book ai didi

java - Atmosphere 样本 : Can't get chat demo working (atmosphere. js 给出 404)

转载 作者:行者123 更新时间:2023-11-29 05:32:13 25 4
gpt4 key购买 nike

我正在尝试从 atmosphere-samples 运行聊天示例

但我在控制台中收到以下错误

GET http://localhost:8080/javascript/atmosphere.js 404 (Not Found)

当我查看 samples/chat 的源代码时我在代码中看不到 atmosphere.js。我猜这个文件应该来自 Atmosphere jar 之一?我期待在 src/main/webapp/javascript 中看到它但事实并非如此。

我已经完成了以下步骤

  1. 从 git ( git checkout https://github.com/Atmosphere/atmosphere-samples.git) 结帐
  2. 切换到最新的稳定分支(git checkout atmosphere-samples-project-2.0.5)
  3. 进口 samples/chat作为 eclipse 中的“现有 maven 项目”(使用 m2e 插件)
  4. 设置 jetty 运行目标(RunJettyRun)
  5. 转到 http://localhost:8080/<context>在浏览器中。

请注意,我看到 webapp 正在运行,它只是因为 404 而导致 javascript 错误。

最佳答案

似乎在 maven 构建中发生了一些没有在 eclipse 中复制的魔法。我没有花时间去追查确切原因,但我通过从

复制适当版本的 atmosphere.js 解决了我的问题

https://github.com/Atmosphere/atmosphere-javascript/blob/master/modules/javascript/src/main/webapp/javascript/atmosphere.js

src/main/webapp/javascript

关于java - Atmosphere 样本 : Can't get chat demo working (atmosphere. js 给出 404),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20719056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com