Open felixlamgit opened 8 months ago
Change client.connect(smbUrl)
to client.connect(servername, port)
The default port is 445, so if that it the port you can just use client.connect(servername)
But the parameter you pass to connect needs to be a valid hostname or IP-adress, it can not be a full smburl.
Change
client.connect(smbUrl)
toclient.connect(servername, port)
The default port is 445, so if that it the port you can just useclient.connect(servername)
But the parameter you pass to connect needs to be a valid hostname or IP-adress, it can not be a full smburl.
Yes, I miss the alternative implementation of connect function with separated port, this works for me, thanks 👍
I used jcifs.smb for upload data from android to Windows folder by SMB1.0, but now needs to switch to SMB2.0 with smbj package
I face an error in connection
SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details. java.net.UnknownHostException: smb://xxx.xxx.x.xxx:445/ at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:208) at java.net.Socket.connect(Socket.java:646) at com.hierynomus.protocol.commons.socket.ProxySocketFactory.createSocket(ProxySocketFactory.java:87) at com.hierynomus.protocol.commons.socket.ProxySocketFactory.createSocket(ProxySocketFactory.java:63) at com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport.connect(DirectTcpTransport.java:95) at com.hierynomus.smbj.connection.Connection.connect(Connection.java:139) at com.hierynomus.smbj.SMBClient.getEstablishedOrConnect(SMBClient.java:96) at com.hierynomus.smbj.SMBClient.connect(SMBClient.java:71)
I try the smbURL format as follow, it works when I used jcifs.smb with SMB1 protocol, but it does not work in connection with SMB2.0 with smbj package smb://xxx.xxx.x.xxx:445/
I have also tested in PowerShell whether SMB 2 protocol which shows true
Can anyone advise how smbURL needs to modified, or any other changes(disable SMB1Protocol) I need to made in order to establish the connection successfully? Thanks.
The following are the further codes in which I try to upload file to SMB-shared folder