在 Eclipse Helios 中使用 Clojure 启动 labrepl 时出错
我在启动我认为是 labrepl 程序的网络服务器时遇到了一些困难。
我使用了此处的说明设置好一切,并成功安装 labrepl。
我能够运行 repl 并在浏览器中获取课程。由于某种原因,当我今天启动 Eclipse 并使用“作为新的 Clojure 项目的 JVM 和 REPL 运行”时,它说 labrepl.clj 中存在错误。我清空了git制作的目录(我找不到Maven制作的目录,但我把它从工作空间中删除了,指定删除文件)。
我再次浏览了该网站上的说明,得到了看起来像 labrepl 0.0.2 的内容(根据 pom.xml 文件)。现在 labrepl.clj 没有问题,但启动 (labrepl/-main)
时,出现以下错误:
2011-04-17 01:29:07.380:INFO::jetty-6.1.26
2011-04-17 01:29:07.502:WARN::failed [email protected]:9000: java.net.BindException:
Address already in use: JVM_Bind
2011-04-17 01:29:07.503:WARN::failed Server@2d68be1b: java.net.BindException: Address
already in use: JVM_Bind
java.net.BindException: Address already in use: JVM_Bind (repl-1:3)
因此,基于网络的课程版本将无法运行。我在目录结构中寻找课程,但找不到任何 html。
我发现这这似乎是一个类似的问题,可能的解决方案用于回滚到早期版本,但我想看看之前是否有人遇到过这种特定情况。
I'm having some difficulty starting what I presume is the webserver for the labrepl program.
I used the instructions here to set everything up, and installed labrepl successfully.
I was able to run the repl and get the lessons in my browser. For some reason, when I started Eclipse today and used the "Run As new Clojure project's JVM and a REPL" it said there was an error in the labrepl.clj. I cleared out the directory made by git (I couldn't find the one made by Maven, but I deleted it out of the workspace, specifying to delete the files).
I went through the directions on that website again, getting what seems like labrepl 0.0.2 (according to the pom.xml file). Now there were no problems with the labrepl.clj, but when starting (labrepl/-main)
, the following error comes up:
2011-04-17 01:29:07.380:INFO::jetty-6.1.26
2011-04-17 01:29:07.502:WARN::failed [email protected]:9000: java.net.BindException:
Address already in use: JVM_Bind
2011-04-17 01:29:07.503:WARN::failed Server@2d68be1b: java.net.BindException: Address
already in use: JVM_Bind
java.net.BindException: Address already in use: JVM_Bind (repl-1:3)
Consequently, the web based version of the lessons will not work. I hunted through the directory structure for the lessons, but I couldn't find any html.
I found this which seems to be a similar problem, possible solution for rolling back to an earlier version, but I wanted to see if anyone had run into this specific situation before.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您链接到的问题并不相似:您已经解决了他遇到的问题,因此无需担心尝试应用他的解决方案。相反,您的问题是其他一些程序正在使用套接字 8080,因此 labrepl Web 服务器不能。
上次我使用 Eclipse 时,发现 Eclipse 本身可以选择性地使用 8080 来支持某种动态语言,这对我来说是个障碍;但 8080 是一个非常常见的端口,其他人可能正在使用它。
如果您使用的是类 Unix 操作系统,有一种方法可以找出谁打开了该套接字 - 使用
lsof
列出带有-i
的“打开文件”选项说你的意思是套接字。命令行有点混乱,但可以识别:进程 6427 正在侦听我的端口 8080,该进程是我的本地副本 sexpbot。
如果您有这样的进程,您可以通过暂时禁用它(例如,通过终止该进程)来解决您的问题。
更好的长期解决方案是将 Jetty 配置为 labrepl 使用不同的端口。我确信有更好的方法可以做到这一点,但我不太了解 Jetty。如果您查看
labrepl/src/labrepl.clj
内部,会看到一行(run-jetty (var app) {:port 8080
。将 8080 更改为其他端口 (例如,8778),然后它应该可以正常启动,您将能够浏览到 localhost:8778 并以这种方式使用 labrepl。The problem you link to is not similar: you've already solved the problem he was having, so there's no need to worry about trying to apply his solution. Instead, your issue is that some other program is using socket 8080, so the labrepl webserver can't.
Last time I used Eclipse, it turned out that Eclipse itself optionally uses 8080 for some kind of dynamic-language support and that was getting in my way; but 8080 is a pretty common port, and someone else might be using it.
If you are using a Unix-like operating system, there's one way you can find out who has that socket open - use
lsof
to list "open files" with the-i
option to say that you mean sockets.The command line is a bit mangled, but recognizable: process 6427 is listening to my port 8080, and that process is my local copy of sexpbot.
If you have such a process, you can work around your problem by disabling it temporarily (say, by killing the process).
The better long-term solution is to configure Jetty to use a different port for labrepl. I'm sure there are better ways of doing this, but I don't know Jetty that well. If you look inside
labrepl/src/labrepl.clj
, there is a line(run-jetty (var app) {:port 8080
. Change 8080 to some other port (say, 8778), and then it should start up fine. You'll be able to browse to localhost:8778 and work with labrepl that way.