gpt4 book ai didi

java - JPA/Hibernate 在启动期间挂起 native 文件系统操作

转载 作者:太空宇宙 更新时间:2023-11-04 11:27:52 25 4
gpt4 key购买 nike

这是 JPA/Hibernate hangs on production during EntityManagerFactory creation 的后续内容

我设法在“挂起”状态下获取线程转储,并且发现问题与文件系统列表操作有关。

一般来说,该进程可能会在应用程序引导过程中在此状态下挂起几分钟(约 30)分钟。有任何解决办法或修复吗?

"main" #1 prio=5 os_prio=0 tid=0x00000000010c9000 nid=0x2c73 runnable [0x00007f4c928f5000]
java.lang.Thread.State: RUNNABLE
at java.io.UnixFileSystem.list(Native Method)
at java.io.File.list(File.java:1122)
at java.io.File.listFiles(File.java:1207)
at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:105)
at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:118)
at org.hibernate.boot.archive.internal.ExplodedArchiveDescriptor.visitArchive(ExplodedArchiveDescriptor.java:54)
at org.hibernate.boot.archive.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:47)
at org.hibernate.boot.model.process.internal.ScanningCoordinator.coordinateScan(ScanningCoordinator.java:75)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.prepare(MetadataBuildingProcess.java:98)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:227)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:169)
at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:36)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:181)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:129)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:71)
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:52)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)

最佳答案

对我和 marc82ch 来说,问题是应用程序类路径上有大量文件(外部)。例如,在我的例子中,我的类路径中包含日志文件目录,其中包含大量文件。

关于java - JPA/Hibernate 在启动期间挂起 native 文件系统操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44152772/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com