Hibernate 查询仅在一台机器上挂起
我在 Glassfish 服务器上部署了一个 Java 应用程序。在从一台 Windows 7 迁移到另一台装有 Windows 10 的电脑期间,我遇到了一个非常奇怪的问题。当我启动本地开发环境,连接到相同的数据库,使用相同版本的战争工件时,在新机器上,一切似乎都工作正常,但当我尝试访问一个功能时,它就冻结了。没有错误消息,http 请求永远不会得到答复。
我连接到 Glassfish 上的调试端口并准确地追踪到从未执行的行。这是 hibernate Query 对象 .list() 方法。它应该执行一个 SELECT。
我尝试部署工件,尝试不同的版本,确认它们正在部署,添加日志记录以确保代码停止在我认为的地方,行为没有变化。
将相同的工件复制到我的旧机器上可以正常工作。除了操作系统之外,环境之间的差异在于新机器通过 VPN 连接,而旧机器在本地网络上,但我认为这并不重要,因为显然已经建立了与数据库的连接。
环境:
- Glassfish 2.1.1
- Java 1.8
- Hibernate 版本:5.4.21
- DB:JNDI Oracle
- JDBC 版本:19.3.0.0
I have a Java application deployed on Glassfish server. During the move from one Windows 7 to another PC with Windows 10 I have encountered a very strange problem. As I launch local dev environment, connecting to the same database, with the same versions of war artifacts, on the new machine, everything seems to be working fine, but when I try to access one function, it just freezes. No error messages, the http request is never answered.
I connected to the debug port on Glassfish and tracked down exactly the line that never executes. It's the hibernate Query object .list() method. It's supposed to execute a SELECT.
I tried deploying artefacts, tried different versions, confirmed that they ARE being deployed, added logging to make sure that the code stops where I think it does, no change in the behavior.
The same artifact, copied to my old machine works without a problem. The difference between environments, aside from OS, is the fact that new machine is connecting via VPN, while the old one is on the local network, however I don't think this could matter, as obviously the connection to DB is established.
Environment:
- Glassfish 2.1.1
- Java 1.8
- Hibernate version: 5.4.21
- DB: JNDI Oracle
- JDBC version: 19.3.0.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 Glassfish 2.1.1 支持的操作系统< /a>,它没有列出 Windows 10。我不相信服务器在新系统上表现一致,并建议尝试在受支持的操作系统上运行 Glassfish(或升级到13 岁以下的 Glassfish 版本)
Looking at the supported operating systems for Glassfish 2.1.1, it does not list Windows 10. I would not trust the server to behave consistently on the new system and would recommend trying to run Glassfish on a supported operating system (or upgrading to a version of Glassfish that is not 13 years old)