欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

sqoop2启动job时报错 java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException解决方案

程序员文章站 2022-04-13 21:37:36
...

初次使用Sqoop2,在 start job时出现了一下异常:

java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException
	java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	org.apache.hadoop.mapreduce.Job.getJobSubmitter(Job.java:1291)
	org.apache.hadoop.mapreduce.Job.submit(Job.java:1302)
	org.apache.sqoop.submission.mapreduce.MapreduceSubmissionEngine.submitToCluster(MapreduceSubmissionEngine.java:274)
	org.apache.sqoop.submission.mapreduce.MapreduceSubmissionEngine.submit(MapreduceSubmissionEngine.java:255)
	org.apache.sqoop.driver.JobManager.start(JobManager.java:288)
	org.apache.sqoop.handler.JobRequestHandler.startJob(JobRequestHandler.java:380)
	org.apache.sqoop.handler.JobRequestHandler.handleEvent(JobRequestHandler.java:116)
	org.apache.sqoop.server.v1.JobServlet.handlePutRequest(JobServlet.java:96)
	org.apache.sqoop.server.SqoopProtocolServlet.doPut(SqoopProtocolServlet.java:79)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
	org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:622)
	org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationFilter.doFilter(DelegationTokenAuthenticationFilter.java:301)
	org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:574)

经过参考网上的信息,发现该错误是由于缺少jar包导致的,我是用CDH安装的集群,具体操作是将

/opt/cloudera/parcels/CDH-5.10.2-1.cdh5.10.2.p0.5/lib/sqoop2/client-lib路径下的jackson-core-asl-1.8.8.jar   和   jackson-mapper-asl-1.8.8.jar复制到/var/lib/sqoop2,然后重启Sqoop2服务,并重新登录client。

另外注意目标路径的权限问题。