2011-07-02 58 views
0

在Fedora 15,做MVN碼頭後:奔跑,我得到,當它試圖初始化MetaMapper爲用戶提供以下EXCETION在Fedora 15,啓動電梯應用在Fedora上得到org.h2.jdbc.JdbcSQLException

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] 
+0

你可以試試更新版本的H2嗎?根據錯誤代碼,您正在使用版本1.2.138(2010-06-27),並且在最新版本(我相信版本1.3.156)中錯誤消息已得到改進。 –

+0

當前版本似乎由maven2安裝,因爲它是電梯應用程序的依賴項之一。如果我安裝了新版本,maven2是否仍然可以使用它? – tom

+0

正在下載:http://scala-tools.org/repo-releases/com/h2database/h2/1.3.156/h2-1.3.156.jar [信息]無法找到資源'com.h2database:h2:jar :1.3.156'in repository scala-tools.releases(http://scala-tools.org/repo-releases) 正在下載:http://repo1.maven.org/maven2/com/h2database/h2/1.3。 156/h2-1.3.156.jar – tom

回答

0

也許你的應用程序仍然運行或端口沒有關閉。 使用'netstat'驗證。

您可能想閱讀so_reuseaddr。

我有一臺服務器在我的電腦上運行(它的Common Lisp的,而不是H2,但是這並不重要):

[email protected]:~$ 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中偵聽。

+0

我做了netstat,沒有任何東西在端口上運行。我更新了這個問題。對於tcp ip +端口組合,爲什麼每次都不一樣?有沒有辦法將它設置爲「常量」?而且IP地址肯定不在我的網絡上。 – tom

0

這很可能是一個網絡配置問題。你能檢查你的主機文件中是否有奇怪的條目?我的hosts文件(Mac OS)中:

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

如果有什麼奇怪在這個文件中,請下載H2和(用於Windows或build.bat testNetwork)運行./build.sh 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」,但某些功能不能按設計工作。