首先我是新來的HBase和Jetty 8HBASE 0.94.xxx與碼頭8.xxx
我一直在試圖讓HBase的0.94.xx和嵌入式碼頭8.x中發揮好起來。
我從Lars採取了示例代碼並更新了Hush以使用0.94。這是我做的HBase 0.94更新。 https://github.com/yepher/hbase-book/blob/master/hush/pom.xml當我將Jetty版本從「7.3.1.v20110307」更改爲「8.1.4.v20120524」時。 「Credential」的編譯錯誤很容易通過更改導入來解決。該噓服務器將開始不錯,但最終我得到這個異常:
Exception in thread "main" java.lang.NoSuchMethodError:
org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
at
org.eclipse.jetty.util.log.JettyAwareLogger.log(JettyAwareLogger.java:601)
at
org.eclipse.jetty.util.log.JettyAwareLogger.warn(JettyAwareLogger.java:425)
at org.eclipse.jetty.util.log.Slf4jLog.warn(Slf4jLog.java:64) at
org.eclipse.jetty.util.component.AbstractLifeCycle.setFailed(AbstractLifeCycle.java:199)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at com.hbasebook.hush.HushMain.main(HushMain.java:112)
這是行家的輸出爲「包括sl4j」
[hush (master)]$ mvn dependency:tree -Dincludes=org.slf4j
Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java...
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-maven-plugin/8.1.4.v20120524/jetty-maven-plugin-8.1.4.v20120524.pom
Downloaded: http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-maven-plugin/8.1.4.v20120524/jetty-maven-plugin-8.1.4.v20120524.pom (7 KB at 14.5 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-integration-project/8.1.4.v20120524/jetty-integration-project-8.1.4.v20120524.pom
Downloaded: http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-integration-project/8.1.4.v20120524/jetty-integration-project-8.1.4.v20120524.pom (12 KB at 298.1 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-maven-plugin/8.1.4.v20120524/jetty-maven-plugin-8.1.4.v20120524.jar
Downloaded: http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-maven-plugin/8.1.4.v20120524/jetty-maven-plugin-8.1.4.v20120524.jar (70 KB at 758.4 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building HBase URL Shortener 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ hush ---
[INFO] com.hbasebook:hush:war:1.0
[INFO] \- org.apache.hbase:hbase:jar:0.94.3:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.4.3:compile
[INFO] \- org.slf4j:slf4j-log4j12:jar:1.4.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.987s
[INFO] Finished at: Tue Mar 05 09:51:40 CST 2013
[INFO] Final Memory: 8M/81M
[INFO] ------------------------------------------------------------------------
我試過很多東西像排除SL4J,明確包括SL4j 。我相信我錯過了一些簡單但不太確定的事情。
作爲另一個參考點,我嘗試了這個項目https://github.com/steveliles/jetty-embedded-spring-mvc-noxml/blob/master/pom.xml,但是當我將HBase/core添加到pom.xml時,我開始遇到與上面相同的問題。
有沒有人有一個適用於Jetty 8.x和HBase 0.94.xx的pom.xml?
編輯:
我增加了更多的SLF4J排除,然後明確包括SLF4J
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
</dependency>
我已經有工作代碼在這裏更新胡赫項目:https://github.com/yepher/hbase-book
當我排除的jar我得到這個錯誤在啓動時: 異常在線程「主要」 java.lang.NoClassDefFoundError:組織/ SLF4J /的LoggerFactory \t在org.apache.zookeeper.ZooKeeper。(ZooKeeper.java:93) –
Yepher
2013-03-05 16:54:34