2013-03-05 7 views
1

첫 번째와 부두 8HBase와의 0.94.xxx 내가 HBase를 새로운 오전 모두의

내가 함께 좋은 플레이 HBase와의 0.94.xx 및 임베디드 부두 8.x의를 얻기 위해 노력 해왔다를 8.xxx.

나는 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"에 대한 컴파일 오류는 가져 오기를 변경하여 쉽게 해결할 수 있습니다. 해시 서버가 잘 시작하지만 결국 내가이 예외를 얻을 : 나는 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 포함"에 대한이 받는다는의 출력은

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 포함 . 나는 그것이 무엇인지 간단하지는 않지만 꽤 확신하지 못한다고 확신한다.

또 다른 참조 점으로이 프로젝트 https://github.com/steveliles/jetty-embedded-spring-mvc-noxml/blob/master/pom.xml을 시도했지만 pom.xml에 HBase/core를 추가하면 위와 같은 문제가 발생하기 시작합니다.

방 파 제 8.x 및 HBase 0.94.xx에서 작동하는 pom.xml을 가진 사람이 있습니까?

편집 :

내가 추가 한 더 SLF4J 제외하고는 명시 적으로 내가 작업 코드 여기에 Huch 프로젝트를 업데이트했습니다 SLF4J에게

<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-log4j12</artifactId> 
    <version>1.6.4</version>       
</dependency> 

이 포함 https://github.com/yepher/hbase-book

답변

1

가이 예외가 발생할 때이 클래스 경로에 다른 버전의 복수 LocationAwareLogger 클래스가 있습니다. lib 디렉토리에서 grep -R LocationAwareLogger *.jar을 수행하고 클래스를 포함하는 jar를 파악할 수 있습니다. 그런 다음 pom.xml에서 제외 할 수 있습니다.

편집 : 내 repo를 다운로드하여 내 컴퓨터에 설치했습니다. 내가 출력 다음있어 grep 명령을 실행 한 후 :

[email protected]:hbase-book$ grep -R 'org/slf4j/spi/LocationAwareLogger' hush/target/hush/WEB-INF/lib/*.jar 
Binary file hush/target/hush/WEB-INF/lib/slf4j-api-1.6.4.jar matches 
[email protected]:hbase-book$ grep -R 'org/slf4j/LoggerFactory' hush/target/hush/WEB-INF/lib/*.jar 
Binary file hush/target/hush/WEB-INF/lib/slf4j-api-1.6.4.jar matches 

그것은 당신이 잘못된 groupId/artifactId 조합을 사용하여 완전히 slf4j을 제외하지 않은 것 같습니다. POM을 업데이트하고 다시 테스트해야합니다.

jetty에 포함 된 로깅 라이브러리 버전은 hbase과 충돌 할 수 있으므로 일반적인 해결책은 없으므로 사용할 버전을 확인하고 다른 버전을 제외해야합니다. 나는 단지를 제외하면 시작에

+0

는이 오류를 얻을 : 조직/SLF4J/LoggerFactory org.apache.zookeeper.ZooKeeper에서 \t : 스레드 "기본"java.lang.NoClassDefFoundError가에서 예외입니다. (ZooKeeper.java:93) – Yepher