在 Fedora 15 上,在 Fedora 上启动 Lift 应用程序并获取 org.h2.jdbc.JdbcSQLException

发布于 2024-11-18 11:22:36 字数 955 浏览 3 评论 0原文

在 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

我尝试用 Sun JDK 替换 OpenJDK,但仍然不起作用。 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]

On Fedora 15, after doing mvn jetty:run, I am getting the following excetion when it's trying to initialize the MetaMapper for User

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) 

The following is how I generated the project

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

I tried replacing OpenJDK with Sun JDK, still doesn't work. Anything wrong with H2? Do I need to reinstall H2? Or is it a Lift issue?

If I kill the run and restart another one, I will get the same exception, but just different tcp port, for example

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]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仅此而已 2024-11-25 11:22:36

也许您的应用程序仍在运行或端口尚未关闭。
使用“netstat”进行验证。

您可能想阅读 so_reuseaddr。

我的计算机上运行着一台服务器(它是 Common Lisp,而不是 H2,但这并不重要):

xxx@fp:~$ netstat -tulpen
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 127.0.0.1:4005          0.0.0.0:*               LISTEN      1000       68449       7559/sbcl       

我希望有一个进程正在侦听 208.68.143.50:55325。如果这个 IP 不是您的计算机,那么就会发生一些奇怪的事情。
您可以使用

sudo strace -f mvn ... 2>&1 test.out

test.out 文件启动您的应用程序,然后调查该文件。 “strace”工具允许您记录程序发出的所有系统调用。在文件test.out中搜索listen。

Maybe your application still runs or the ports haven't closed.
Verify using 'netstat'.

You may want to read on so_reuseaddr.

I have a server running on my computer (its Common Lisp and not H2 but this doesn't matter):

xxx@fp:~$ netstat -tulpen
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 127.0.0.1:4005          0.0.0.0:*               LISTEN      1000       68449       7559/sbcl       

I would expect that either a process is listening on 208.68.143.50:55325. If this IP isn't your computer, then something weird is going on.
You can start your application with

sudo strace -f mvn ... 2>&1 test.out

and afterwards investigate the test.out file. The 'strace' tool allows you to log all the system calls that are issued by the program. Search listen in the file test.out.

暖树树初阳… 2024-11-25 11:22:36

这很可能是网络配置问题。你能检查一下你的主机文件中是否有奇怪的条目吗?我的hosts文件是(Mac OS):

> cat /etc/hosts
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost

如果这个文件没有什么奇怪的,请下载H2并运行./build.sh testNetwork(或build.bat testNetwork)视窗)。在我的系统上,我得到:

Target: testNetwork
localhost:localhost/127.0.0.1
  localhost/127.0.0.1
  localhost/0:0:0:0:0:0:0:1
  localhost/fe80:0:0:0:0:0:0:1%1
getLocalHost:Thomas-Muellers-MacBook-Pro.local/192.168.0.105
  /192.168.0.105
byName:/192.168.0.105
ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=55489]
server accepting
client:/192.168.0.105:55489
server accepted:Socket[addr=/192.168.0.105,port=55490,localport=55489]
client:Socket[addr=/192.168.0.105,port=55489,localport=55490]
server read:123
client read:234
server closing
server done
done
Done in 1666 ms

当然,H2 可以只使用“localhost”,但某些功能将无法按设计工作。

This is most likely a network configuration problem. Could you check in your hosts file for strange entries? My hosts file is (Mac OS):

> cat /etc/hosts
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost

If there is nothing strange in this file, please download H2 and run ./build.sh testNetwork (or build.bat testNetwork for Windows). On my system, I get:

Target: testNetwork
localhost:localhost/127.0.0.1
  localhost/127.0.0.1
  localhost/0:0:0:0:0:0:0:1
  localhost/fe80:0:0:0:0:0:0:1%1
getLocalHost:Thomas-Muellers-MacBook-Pro.local/192.168.0.105
  /192.168.0.105
byName:/192.168.0.105
ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=55489]
server accepting
client:/192.168.0.105:55489
server accepted:Socket[addr=/192.168.0.105,port=55490,localport=55489]
client:Socket[addr=/192.168.0.105,port=55489,localport=55490]
server read:123
client read:234
server closing
server done
done
Done in 1666 ms

Of course H2 could just use "localhost", but then certain features wouldn't work as designed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文