Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while creating SMBJ Connection - java.util.concurrent.TimeoutException: Timeout expired #827

Open
hkmudgal29 opened this issue May 15, 2024 · 0 comments

Comments

@hkmudgal29
Copy link

Hi,
I am using below Java code using smbj-0.13.0 library on apache tomcat 10.1.23 and java version "17.0.10" 2024-01-16 LTS on RHEL 9.3 (Plow) VM. I tried telnet on host and port 445 from VM and it's working fine even ping is working fine -
try (SMBClient smbClient = new SMBClient(config)) {
log.info("smbClient initialized - "+smbClient);
try (Connection connection = smbClient.connect(SMB_HOST)) {
log.info("Connection created: "+connection);
AuthenticationContext ac = new AuthenticationContext(smbUser, smbPassword.toCharArray(), null);
try (Session session = connection.authenticate(ac)) {
log.info("Session Created: "+session);
try (DiskShare share = (DiskShare) session.connectShare(SMB_SHARE)) {
ListObjectsV2Request listReq = ListObjectsV2Request.builder().bucket(BUCKET_NAME).prefix(date).build();
} catch (Exception e) {
log.error("Exception while making DiskShare : "+e.getMessage());
}
} catch (Exception e) {
log.error("Exception while making Session : "+e.getMessage());
}
} catch (Exception e) {
log.error("Exception while Connection for SMB HOST: {}, Error: {}", SMB_HOST, e.getMessage());
}
} catch (Exception e) {
log.error("Exception while initializing SMBClient(), error: " + e.getMessage());
}

It's failing on line - try (Connection connection = smbClient.connect(SMB_HOST)) with following error -

2024-05-15T07:30:46.259Z INFO 39417 --- [nio-8080-exec-1] com.adobe.service.ComplianceService : smbClient initialized - com.hierynomus.smbj.SMBClient@4f54f699
2024-05-15T07:32:46.302Z INFO 39417 --- [nio-8080-exec-1] c.hierynomus.smbj.connection.Connection : Closed connection to indstore.corp.adobe.com
2024-05-15T07:32:46.303Z INFO 39417 --- [.corp.adobe.com] c.h.s.t.t.direct.DirectTcpPacketReader : Thread[Packet Reader for indstore.corp.adobe.com,5,main] stopped.
2024-05-15T07:32:46.310Z ERROR 39417 --- [nio-8080-exec-1] com.adobe.service.ComplianceService : Exception while Connection for SMB HOST: indstore.corp.adobe.com, Error: java.util.concurrent.ExecutionException: com.hierynomus.smbj.common.SMBRuntimeException: java.util.concurrent.TimeoutException: Timeout expired
2024-05-15T07:32:46.310Z INFO 39417 --- [nio-8080-exec-1] com.hierynomus.smbj.SMBClient : Going to close all remaining connections

However it's working on my laptop macos using same apache tomcat server and java version "17.0.6" 2023-01-17 LTS.

Can you help me to fix the issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant