【发布时间】:2011-07-02 19:44:17
【问题描述】:
在 Fedora 15 上,执行 mvn jetty:run 后,尝试为用户初始化 MetaMapper 时出现以下异常
org.h2.jdbc.JdbcSQLException: Exception opening port "H2 TCP Server (tcp://
192.168.1.105:33463)" (port may be in use), cause: "timeout" [90061-138]
(full stack trace is pasted last in the mail)
以下是我生成项目的方式
mvn archetype:generate \
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-basic_2.8.1 \
-DarchetypeVersion=2.3 \
-DarchetypeRepository=http://scala-tools.org/repo-releases \
-DremoteRepositories=http://scala-tools.org/repo-releases \
-DgroupId=com.mytest \
-DartifactId=helloworld \
-Dversion=2.0
我尝试将 OpenJDK 替换为 Sun JDK,但仍然无法正常工作。 H2有什么问题吗?我需要重新安装 H2 吗?还是电梯问题?
如果我终止运行并重新启动另一个,我将得到相同的异常,但只是不同的 tcp 端口,例如
org.h2.jdbc.JdbcSQLException: Exception opening port "H2 TCP Server
(tcp://208.68.143.50:55325)" (port may be in use), cause: "timeout" [90061-138]
【问题讨论】:
-
您可以尝试使用更新版本的 H2 吗?根据错误码,您使用的是1.2.138版本(2010-06-27),最近的版本(我相信是1.3.156版本)对错误信息进行了改进。
-
当前版本似乎是由 maven2 安装的,因为它是 lift 应用程序的依赖项之一。如果我安装一个新版本,maven2 还能用吗?
-
下载:scala-tools.org/repo-releases/com/h2database/h2/1.3.156/… [INFO] 无法在存储库 scala-tools.releases (scala-tools.org/repo-releases) 中找到资源 'com.h2database:h2:jar:1.3.156' 下载:repo1.maven.org/maven2/com/h2database/h2/1.3.156/h2-1.3.156.jar
-
13:30:26.505 [main] 调试 net.liftweb.mapper.MetaMapper - 为用户 org.h2.jdbc.JdbcSQLException 初始化 MetaMapper:异常打开端口“H2 TCP 服务器 (tcp://208.68) .143.50:36909)"(端口可能正在使用中),原因:org.h2.message.DbException.getJdbcSQLException(DbException.java:327) 处的“超时”[90061-156]
-
仍然遇到与 h2 156 相同的异常。