类似于我之前的问题。
Eclipse 在尝试调试 Clojure 项目时挂起。之前我在 Windows 8 上使用 Eclipse Kepler,现在在 Windows XP 上使用 Eclipse Juno 也会发生同样的事情。Eclipse 错误日志包含以下相关条目(最早在顶部):
07:30 (Info) Started ccw nREPL server: nrepl://127.0.0.1:1581
07:30 (Info) Starting REPL with program args: -i "/C:/Documents and Settings/bjarvis/My Documents/Java/eclipse/configuration/org.eclipse.osgi/bundles/804/1/.cp/ccw/debug/serverrepl.clj" -e "(require 'clojure.tools.nrepl.server)(do (clojure.tools.nrepl.server/start-server :ack-port 1581) nil)"
07:30 (Info) Adding to project's classpath to support nREPL: [C:\Documents and Settings\bjarvis\My Documents\Java\eclipse\plugins\ccw.core_0.20.0.STABLE001\tools.nrepl-0.2.1.jar]
07:31 (Error) Waiting for new REPL process ack timed out
07:31 (Error) Waiting for new REPL process ack timed out
我注意到的一件奇怪的事情是,在第一次崩溃后,项目右键菜单中的“Leiningen”和“Clojure”条目消失了,所以我认为 CCW“崩溃”或消失了,或者 ??? 退出 Eclipse 并再次启动它会恢复这些菜单条目。
我意识到这里没有太多信息,但是有人有什么想法吗?请注意,调试器运行了几天 - 然后今天早上问题开始了。另请注意,我可以通过使用 Ctrl-Alt-S 将其“发送”到 REPL 来成功运行此文件。
FWIW,我要调试的文件是:
(ns myproject.core
(:require [clojure.java.jdbc :as jdbc]) )
(defn foo [str]
(println str "Hello, World!")
)
(defn hello [who]
(str "Hello " who "!"))
(defn db-test []
(let [db-path "c:/derby/testdb1"]
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
:subprotocol "derby"
:subname db-path
:create true})
(println db)
; Create a table named TESTTABLE here and insert some data
(jdbc/db-do-commands db false
"CREATE TABLE TESTTABLE
(ID_TT BIGINT
NOT NULL
GENERATED ALWAYS AS IDENTITY
CONSTRAINT PK_TESTTABLE
PRIMARY KEY,
NAME VARCHAR(10),
ADDRESS VARCHAR(20))"
"INSERT INTO TESTTABLE (NAME, ADDRESS)
VALUES ('Bob', 'Home'),
('Jack', 'Top Of The Hill'),
('Elmo', 'Dumpster')"
)
; Query the database to see what you find
(jdbc/with-connection db
(jdbc/with-query-results rs ["SELECT * FROM TESTTABLE"]
; rs will be a sequence of maps,
; one for each record in the result set.
(dorun (map #(println (:title %)) rs))))
)
)