问题描述
我的本地设置有问题。该项目使用Java编写的GUI,该GUI通过Http隧道连接到后端部分。该服务器是Wildfly 19,并且可以正常启动。 每种设置似乎都是正确的,每个必要的文件都在其位置,但是在调用Http隧道类时出现“套接字已关闭”异常。该代码不会错误地关闭套接字,并且对其他所有人都有效,因此在我的本地计算机上一定有错误的配置。
这是来自GUI的日志:
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.172 CEST|Logger.java:765|WRITE: TLS12 handshake,length = 250
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.301 CEST|Logger.java:765|READ: TLSv1.2 handshake,length = 4644
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.302 CEST|Logger.java:765|READ: TLSv1.2 handshake,length = 4644
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.324 CEST|Logger.java:765|WRITE: TLS12 handshake,length = 70
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.340 CEST|Logger.java:765|WRITE: TLS12 handshake,length = 24
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.393 CEST|Logger.java:765|READ: TLSv1.2 change_cipher_spec,length = 1
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.393 CEST|Logger.java:765|READ: TLSv1.2 change_cipher_spec,length = 1
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.394 CEST|Logger.java:765|READ: TLSv1.2 handshake,length = 40
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.395 CEST|Logger.java:765|READ: TLSv1.2 handshake,length = 40
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.415 CEST|Logger.java:765|WRITE: TLS12 application_data,length = 231
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.492 CEST|Logger.java:765|READ: TLSv1.2 application_data,length = 159
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.493 CEST|Logger.java:765|READ: TLSv1.2 application_data,length = 159
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.500 CEST|Logger.java:765|READ: TLSv1.2 application_data,length = 29
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.500 CEST|Logger.java:765|READ: TLSv1.2 application_data,length = 29
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.503 CEST|Logger.java:765|duplex close of SSLSocket
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.505 CEST|Logger.java:765|WRITE: TLS12 alert(close_notify),length = 10
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.506 CEST|Logger.java:765|close the underlying socket
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.506 CEST|Logger.java:765|close the SSL connection (initiative)
javax.net.ssl|FINE|01|main|2020-10-13 13:50:20.507 CEST|Logger.java:765|close inbound of SSLSocket
javax.net.ssl|WARNING|01|main|2020-10-13 13:50:20.509 CEST|Logger.java:765|SSLSocket duplex close Failed (
"throwable" : {
java.net.socketException: Socket is closed
at java.net.socket.shutdownInput(Socket.java:1539)
at sun.security.ssl.BaseSSLSocketImpl.shutdownInput(BaseSSLSocketImpl.java:216)
at sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:661)
at sun.security.ssl.SSLSocketImpl.bruteForceCloseInput(SSLSocketImpl.java:609)
at sun.security.ssl.SSLSocketImpl.duplexCloSEOutput(SSLSocketImpl.java:569)
at sun.security.ssl.SSLSocketImpl.close(SSLSocketImpl.java:482)
at sun.net.www.http.HttpClient.closeServer(HttpClient.java:1057)
at sun.net.www.protocol.https.HttpsClient.closeIdleConnection(HttpsClient.java:669)
at sun.net.www.protocol.http.HttpURLConnection.disconnect(HttpURLConnection.java:2951)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.disconnect(HttpsURLConnectionImpl.java:279)
at com.mycompany.myteam.remoting.RemotingClientHTTPS.callUserAuthSupportServlet(RemotingClientHTTPS.java:368)
at com.mycompany.myteam.remoting.RemotingClientHTTPS.connect(RemotingClientHTTPS.java:188)
at com.mycompany.myteam.ui.platform.dialogs.LoginDialog.okpressed(LoginDialog.java:146)
at org.eclipse.jface.dialogs.Dialog.buttonpressed(Dialog.java:466)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.display.sendEvent(display.java:4362)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
at org.eclipse.swt.widgets.display.runDeferredEvents(display.java:4180)
at org.eclipse.swt.widgets.display.readAnddispatch(display.java:3769)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
at org.eclipse.jface.window.Window.open(Window.java:803)
这在我启动GUI时显示在开头。但是,它连接到数据库并成功执行查询。写操作给我各种错误,可能都是由于套接字被关闭导致的。
我不知道什么原因关闭了插座,为什么。它肯定不在代码中,因为它适用于其他人。
尝试用Wireshark分析它是否值得?还有其他想法吗?
谢谢。
@Override
public synchronized void connect(final String user,final String pwd) throws LoginFailedException {
if (holder != null) {
log.error("Client is already initialised");
} else {
try {
namingHelper = new NamingHelper(properties);
log.debug("Initialise remote client for user " + user);
// register Authenticator for this session
UserAuthenticator userAuthenticator = new UserAuthenticator (pwd);
Authenticator.setDefaultuserAuthenticator
StubHolder stubs = new StubHolder();
fillHolder(stubs);
String[] authAttrs = callUserAuthSupportServlet(user,false).split("\n");
log.debug("Authentication attributes: " + Arrays.toString(authAttrs));
RemotingClient.setAuthenticationAttribute(authAttrs[0]);
if ( authAttrs.length > 1 && authAttrs[1].equals("(mail={0})") && authAttrs[2].equals("mail")){
userAuthenticator.setCheckMaxLogins(true);
checkUserValidityByEmail(stubs,user);
}
else{
userAuthenticator.setCheckMaxLogins(false);
checkUserValidity(stubs,RemotingClient.getAuthenticationAttribute());
}
holder = stubs;
log.debug("Completed,clientInfo: " + stubs.clientInfo);
} catch (LoginFailedException e) {
throw e;
} catch (Exception e) {
if ( (e.getCause() != null && e.getCause() instanceof BogusCredentialMarkerException) || e instanceof BogusCredentialMarkerException ){
throw new LoginFailedException();
}
throw new TechnicalException(e.getMessage(),e);
}
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)