Home > other >  Hadoop3.1.1 $MkdirsRequestProto always be cast to com. Google. Protobuf. Message
Hadoop3.1.1 $MkdirsRequestProto always be cast to com. Google. Protobuf. Message

Time:11-12

Just started to learn hadoop startup is an error. The hadoop jar package is under the hadoop/share/jar
This is the code
 
Package com. CCB. BDL. Modules;

Import org, apache hadoop. Conf. Configuration;
Import org, apache hadoop. Fs. FileSystem;
Import org, apache hadoop. Fs. The Path;
The import org. Junit. After;
The import org. Junit. Before;
The import org. Junit. Test;

Import the Java. IO. IOException;

/* *
* Created by 86184 on 2019/7/17.
*/
Public class TestHdfs {

The Configuration the Configuration;
FileSystem FileSystem.

@ Before
Public void conn () throws IOException {
The configuration=new configuration (true);
FileSystem=fileSystem. Get (configuration);
}

@ After
Public void the close () throws IOException {
FileSystem. The close ();
}
@ Test
Public void the mkdir () throws IOException {
Path the Path=new Path ("/sex ");
//if (fileSystem. The exists (path)) {
//fileSystem. Delete (path, true);
//}
FileSystem. The file.mkdirs (path);
}


}




Here is an error

 
14:43:51. 998. [the main] the DEBUG org.. Apache hadoop. HDFS. Protocol. The datatransfer. Sasl. DataTransferSaslUtil - DataTransferProtocol not using SaslPropertiesResolver, no QOP found in the configuration for DFS.. The data transfer. The protection,
14:43:52. 005. [the main] the DEBUG org. Apache. Hadoop. HDFS. DFSClient -/sex: masked={masked: rwxr-xr-x mto, unmasked: RWXRWXRWX}
14:44:55. 263. [the main] the DEBUG org.. Apache hadoop. IO. Retry. RetryInvocationHandler - Exception while invoking the call # 0 ClientNamenodeProtocolTranslatorPB. The file.mkdirs over node01/192.168.33.101:8020 the Not retrying because the try once and fail.
Java. Lang. ClassCastException: org. Apache. Hadoop. HDFS. Protocol. The proto. ClientNamenodeProtocolProtos $MkdirsRequestProto always be cast to com. Google. Protobuf. Message
At org, apache hadoop. Ipc. ProtobufRpcEngine $Invoker. Invoke (ProtobufRpcEngine. Java: 225)
At org, apache hadoop. Ipc. ProtobufRpcEngine $Invoker. Invoke (ProtobufRpcEngine. Java: 116)
At com. Sun. Proxy. $Proxy16. The file.mkdirs (Unknown Source)
At org, apache hadoop. HDFS. ProtocolPB. ClientNamenodeProtocolTranslatorPB. The file.mkdirs (ClientNamenodeProtocolTranslatorPB. Java: 653)
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (498) Method. The Java:
At org, apache hadoop. IO. Retry. RetryInvocationHandler. InvokeMethod (RetryInvocationHandler. Java: 422)
At org, apache hadoop. IO. Retry. RetryInvocationHandler $Call. InvokeMethod (RetryInvocationHandler. Java: 165)
At org, apache hadoop. IO. Retry. RetryInvocationHandler $Call. Invoke (RetryInvocationHandler. Java: 157)
At org, apache hadoop. IO. Retry. RetryInvocationHandler $Call. InvokeOnce (RetryInvocationHandler. Java: 95)
At org, apache hadoop. IO. Retry. RetryInvocationHandler. Invoke (RetryInvocationHandler. Java: 359)
At com. Sun. Proxy. $Proxy17. The file.mkdirs (Unknown Source)
At org, apache hadoop. HDFS. DFSClient. PrimitiveMkdir (DFSClient. Java: 2409)
At org, apache hadoop. HDFS. DFSClient. The file.mkdirs (DFSClient. Java: 2385)
At org, apache hadoop. HDFS. DistributedFileSystem $27 doCall (DistributedFileSystem. Java: 1321)
At org, apache hadoop. HDFS. DistributedFileSystem $27 doCall (DistributedFileSystem. Java: 1318)
At org, apache hadoop. Fs. FileSystemLinkResolver. Resolve (FileSystemLinkResolver. Java: 81)
At org, apache hadoop. HDFS. DistributedFileSystem. MkdirsInternal (DistributedFileSystem. Java: 1335)
At org, apache hadoop. HDFS. DistributedFileSystem. The file.mkdirs (DistributedFileSystem. Java: 1310)
At org, apache hadoop. Fs. FileSystem. The file.mkdirs (2326) FileSystem. Java:
At com. CCB. BDL. Modules. TestHdfs. Mkdir (TestHdfs. Java: 36)
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (498) Method. The Java:
The at org. Junit. Runners. Model. FrameworkMethod $1. RunReflectiveCall (FrameworkMethod. Java: 50)
The at org. Junit. Internal. Runners. Model. ReflectiveCallable. Run (ReflectiveCallable. Java: 12)
The at org. Junit. Runners. Model. FrameworkMethod. InvokeExplosively (FrameworkMethod. Java: 47)
The at org. Junit. Internal. Runners. Statements. InvokeMethod. Evaluate (InvokeMethod. Java: 17)
The at org. Junit. Internal. Runners. Statements. RunBefores. Evaluate (RunBefores. Java: 26)
The at org. Junit. Internal. Runners. Statements. RunAfters. Evaluate (RunAfters. Java: 27)
The at org. Junit. Runners. ParentRunner. RunLeaf (ParentRunner. Java: 325)
The at org. Junit. Runners. BlockJUnit4ClassRunner. RunChild (BlockJUnit4ClassRunner. Java: 78)
The at org. Junit. Runners. BlockJUnit4ClassRunner. RunChild (BlockJUnit4ClassRunner. Java: 57)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related