今天在使用JavaAPI來鏈接sqoop1.99.7的時候,遇到了個錯誤。
錯誤信息以下:html
0 [main] WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform… using builtin-java classes where applicable Exception in thread "main" org.apache.sqoop.common.SqoopException: CLIENT_0004:Unable to find valid Kerberos ticket cache (kinit) at org.apache.sqoop.client.request.ResourceRequest.doHttpRequest(ResourceRequest.java:159) at org.apache.sqoop.client.request.ResourceRequest.doHttpRequest(ResourceRequest.java:69) at org.apache.sqoop.client.request.ResourceRequest.get(ResourceRequest.java:179) at org.apache.sqoop.client.request.JobResourceRequest.read(JobResourceRequest.java:65) at org.apache.sqoop.client.request.SqoopResourceRequests.readJob(SqoopResourceRequests.java:146) at org.apache.sqoop.client.SqoopClient.getJobs(SqoopClient.java:403) at com.fz.hadoop.sqoop.SqoopTest.main(SqoopTest.java:18) Caused by: org.apache.hadoop.security.authentication.client.AuthenticationException: Authentication failed, status: 404, message: Not Found at org.apache.hadoop.security.authentication.client.AuthenticatedURL.extractToken(AuthenticatedURL.java:275) at org.apache.hadoop.security.authentication.client.PseudoAuthenticator.authenticate(PseudoAuthenticator.java:77) at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.authenticate(DelegationTokenAuthenticator.java:131) at org.apache.hadoop.security.authentication.client.KerberosAuthenticator.authenticate(KerberosAuthenticator.java:214) at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticator.authenticate(DelegationTokenAuthenticator.java:131) at org.apache.hadoop.security.authentication.client.AuthenticatedURL.openConnection(AuthenticatedURL.java:215) at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL.openConnection(DelegationTokenAuthenticatedURL.java:322) at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL.openConnection(DelegationTokenAuthenticatedURL.java:245) at org.apache.sqoop.client.request.ResourceRequest.doHttpRequest(ResourceRequest.java:79) … 6 more
問題分析:
從報錯信息上看貌似是Authentication認證的一些錯誤java
無心中在http://blog.csdn.net/jiacai2050/article/details/59117645這篇文章中發現了但願
web
因此,我試着在url後面加上/,果真好使了。apache
個人代碼以下:
沒加/以前
app
url加上/後
oop