我想在opensuse上使用h2數據庫,但我無法讓它工作。 我從網上下載的官方網站平臺的獨立封裝,然後試圖幾件事來運行它,都沒有成功:H2數據庫將無法運行Opensuse 12.2
- 充分利用/h2/bin/h2.sh可執行文件,然後執行控制檯命令./h2 .SH
- 使用命令Java的罐子H2的* .jar
- 使用Play框架指令H2瀏覽器
所有這三個返回相同的錯誤:
org.h2.jdbc.JdbcSQLException: IO Exception: "java.net.UnknownHostException: linux-t89a.site: linux-t89a.site" [90028-170]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:158)
at org.h2.message.DbException.convert(DbException.java:273)
at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:263)
at org.h2.server.web.WebServer.updateURL(WebServer.java:325)
at org.h2.server.web.WebServer.init(WebServer.java:315)
at org.h2.tools.Server.<init>(Server.java:51)
at org.h2.tools.Server.createWebServer(Server.java:412)
at org.h2.tools.Console.runTool(Console.java:228)
at org.h2.tools.Console.main(Console.java:100)
Caused by: java.net.UnknownHostException: linux-t89a.site: linux-t89a.site
at java.net.InetAddress.getLocalHost(InetAddress.java:1454)
at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:261)
... 6 more
Exception in thread "main" org.h2.message.DbException: IO Exception: "java.net.UnknownHostException: linux-t89a.site: linux-t89a.site" [90028-170]
at org.h2.message.DbException.get(DbException.java:158)
at org.h2.message.DbException.convert(DbException.java:273)
at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:263)
at org.h2.server.TcpServer.getURL(TcpServer.java:193)
at org.h2.tools.Server.getStatus(Server.java:391)
at org.h2.tools.Console.printProblem(Console.java:300)
at org.h2.tools.Console.runTool(Console.java:270)
at org.h2.tools.Console.main(Console.java:100)
Caused by: org.h2.jdbc.JdbcSQLException: IO Exception: "java.net.UnknownHostException: linux-t89a.site: linux-t89a.site" [90028-170]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
... 8 more
Caused by: java.net.UnknownHostException: linux-t89a.site: linux-t89a.site
at java.net.InetAddress.getLocalHost(InetAddress.java:1454)
at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:261)
... 5 more
這裏是我的Java的版本:
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (suse-3.37.1-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
我的javac -version:
javac 1.7.0_21
進一步信息: 我問一個朋友嘗試運行它在UninstallX上,使用java -jar h2 * .jar過程,並且它工作正常(我們有相同的Java版本,linux發行版中省略)。 我問另一位朋友試圖用Opensuse在他的電腦上運行它,它沒有工作,與我的錯誤一樣。
感謝
編輯: 根據需要,對等內容/ hosts文件:
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
H2服務器嘗試通過TCP/IP連接到自己,並嘗試使用它自己的IP地址。它使用普通的Java API。看起來,如果網絡配置有問題,這並不總是奏效。你可以發佈你的'/ etc/hosts'文件的內容嗎? –
完成, 也許錯誤來自行 127.0.0。1本地主機 我應該添加? 127.0.0.1 linux-t89a – Saffron
根據鏈接問題的答案(見下文):是的。我想知道是否應該改變H2以便它不使用InetAddress.getLocalHost(),或者以某種方式解決此問題。 –