AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-472919

Daniel Sandberg's questions

Martin Hope
Daniel Sandberg
Asked: 2023-10-17 08:06:49 +0800 CST

Tomcat 9 - 使用非阻塞 IO 连接器时,gracefulStopAwaitMillis 是否“正确”等待请求完成?

  • 5

使用 NIO 连接器时,Tomcat 9.0.80+ 如何处理正常关闭?

<Connector port="8080" protocol="HTTP/1.1"
       connectionTimeout="20000" 
       gracefulStopAwaitMillis="15000" 
       bindOnInit="false" 
       protocol="org.apache.coyote.http11.Http11NioProtocol" />

我已经在使用 HAproxy 进行重试、重新调度和运行状况检查。我还配置了 Tomcat 以使用正常关闭和延迟绑定(根据建议),让任何反向代理/负载均衡器重新分派到另一个后端。但我不确定它是否真的等待进程内请求完成处理后再退出。我的测试表明是这样,但我偶尔会从位于 HAproxy(高级路由、API 网关)前面的面向公众的 ALB(TLS、WAF)收到 HTTP 502,然后一大堆 Tomcat 服务器滚动重启。

tomcat
  • 1 个回答
  • 20 Views
Martin Hope
Daniel Sandberg
Asked: 2021-05-18 11:03:50 +0800 CST

Tomcat 9.0.46 的解决方法(错误 65308) - JNDIRealm 中的 NPE

  • 1

在 Tomcat 9.0.46 中使用 JNDIRealm/ActiveDirectory 时有人遇到过 NPE 错误并有解决方法吗?

语境

我不得不从 9.0.43 升级,因为在启用 keep-alive/re-use 时套接字输入流被损坏(并混淆了请求主体)的并发错误。日志中充满了“解析 HTTP 请求标头时出错”和“HTTP 方法名称必须是令牌 000x000x000x000x000x...”等。升级到 9.0.46 后,此问题已解决,但现在我们的 ActiveDirectory 登录已损坏。

日志

17-May-2021 14:31:49.405 INFO [Catalina-tomcat-workers-thread7] org.apache.catalina.realm.JNDIRealm.authenticate Exception performing authentication. Retrying...
    java.lang.NullPointerException
            at org.apache.catalina.realm.JNDIRealm.doAttributeValueEscaping(JNDIRealm.java:2884)
            at org.apache.catalina.realm.JNDIRealm.getRoles(JNDIRealm.java:1892)
            at org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:1350)
            at org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:1232)
            at org.apache.catalina.realm.CombinedRealm.authenticate(CombinedRealm.java:191)
            at org.apache.catalina.realm.CombinedRealm.authenticate(CombinedRealm.java:191)
            at org.apache.catalina.realm.LockOutRealm.authenticate(LockOutRealm.java:154)
            at org.apache.catalina.authenticator.BasicAuthenticator.doAuthenticate(BasicAuthenticator.java:101)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:632)

漏洞

根据错误报告(https://bz.apache.org/bugzilla/show_bug.cgi?id=65308),userRoleAttribute为空/null存在问题。估计再过 3-4 周就不会发布了。

Tomcat 文档(https://tomcat.apache.org/tomcat-9.0-doc/realm-howto.html#JNDIRealm)说:

roleSearch - the LDAP search filter for selecting role entries.
It optionally includes pattern replacements "{0}" for the distinguished name and/or "{1}" for the username and/or "{2}" for an attribute from user's directory entry, of the authenticated user.
Use userRoleAttribute to specify the name of the attribute that provides the value for "{2}".

我没有在 roleSearch 属性中使用“{2}”,所以我不需要设置userRoleAttribute。尽管如此,我还是尝试将其设置为非空,但无济于事。

在他们发布 9.0.47 之前,我需要一个解决方法。有接盘侠吗?

tomcat active-directory bug
  • 1 个回答
  • 468 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve