SQOOP2在启动server的时候总是出错

sqoop2在使用 sh sqoop.sh server start 的时候出现以下错误:


org.apache.catalina.loader.WebappClassLoader

checkThreadLocalMapForLeaks
SEVERE: The web application [/sqoop] created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7cd1a1ab]) and a
value of type [org.apache.derby.iapi.services.context.ContextManager]
(value [org.apache.derby.iapi.services.context.ContextManager@13cc0a7f])
but failed to remove it when the web application was stopped. This is very
likely to create a memory leak.
log4j: log4j called after unloading, see
http://logging.apache.org/log4j/1.2/faq.html#unload.
java.lang.IllegalStateException: Class invariant violation
         at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:199)
         at org.apache.log4j.LogManager.getLogger(LogManager.java:228)
         at org.apache.log4j.Logger.getLogger(Logger.java:117)
         at  org.apache.sqoop.connector.jdbc.GenericJdbcImportInitializer.(Native Method)

         at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)


一直没有找到原因,感觉应该是jar包的问题,冲突或者缺少jar,但是不知道具体的问题到底在什么地方。


最后的解决办法:


把hadoop2.4.1对应的所有jar包都统一copy出来,然后放入sqoop.war包里面的lib文件夹里面,最后启动server,发现问题没有了。

不过最后别忘记把/user/local/sqoop/server/conf/catalina.properties 文件里面对应的一项也更改一下:

common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/../lib/*.jar,/app/prog/hadoop/share/hadoop/common/*.jar,/app/prog/hadoop/share/hadoop/common/lib/*.jar,/app/prog/hadoop/share/hadoop/hdfs/*.jar,/app/prog/hadoop/share/hadoop/hdfs/lib/*.jar,/app/prog/hadoop/share/hadoop/mapreduce/*.jar,/app/prog/hadoop/share/hadoop/mapreduce/lib/*.jar,/app/prog/hadoop/share/hadoop/tools/*.jar,/app/prog/hadoop/share/hadoop/tools/lib/*.jar,/app/prog/hadoop/share/hadoop/yarn/*.jar,/app/prog/hadoop/share/hadoop/yarn/lib/*.jar

需要把hadoop对应的jar最好都统一加载,在catalina启动时候。




你可能感兴趣的:(SQOOP2在启动server的时候总是出错)