在 Linux 下运行时出现奇怪的休眠异常

Posted

技术标签:

【中文标题】在 Linux 下运行时出现奇怪的休眠异常【英文标题】:Strange hibernate exception when running under Linux 【发布时间】:2010-09-08 08:38:17 【问题描述】:

我有一个项目可以在 OS/X 下编译和运行完全正常,但在 Linux 下会抛出一个异常,无法说明可能是什么问题。我一直坚持几个小时试图缩小范围,任何指针都会有所帮助!

java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
Caused by: javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:375)
    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
    at au.edu.unimelb.security.model.EMF.getTestInstance(EMF.java:44)
    at au.edu.unimelb.grssc.TestHelper.reset(Unknown Source)
    at au.edu.unimelb.grssc.model.MasterResultsScoreTest.<clinit>(Unknown Source)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -5
    at java.lang.String.substring(String.java:1937)
    at org.hibernate.ejb.packaging.JarVisitorFactory.getJarURLFromURLEntry(JarVisitorFactory.java:55)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:341)

我遇到问题的环境是

操作系统: Ubuntu 10.4 和/或 Ubuntu 8.4 Java: Ubuntu sun java 包和/或从 Oracle 下载的最新 java 1.6 休眠: 3.5.4 版

persistence.xml文件的相关部分如下:

<persistence-unit name="testing">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>package.grssc.model.Application</class>
    <class>package.grssc.model.ExternalPerson</class>
    <class>package.grssc.model.Organisation</class>
    <class>package.grssc.model.Qualification</class>
    <class>package.grssc.model.Recommendation</class>
    <class>package.grssc.model.FyGrade</class>
    <class>package.grssc.model.IsisRewardCode</class>

    <class>package.security.model.Person</class>
    <class>package.security.model.Permission</class>
    <class>package.security.model.Throttle</class>
    <class>package.security.model.Role</class>
    <class>package.security.model.SimpleReport</class>
    <class>package.security.model.Template</class>
    <class>package.security.model.TemplateItem</class>
    <class>package.security.model.Setting</class>

    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>
        <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:unit-testing-jpa" />
        <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" />
        <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
        <property name="hibernate.hbm2ddl.auto" value="create-drop" />
        <property name="hibernate.connection.username" value="sa" />
        <property name="hibernate.connection.password" value="" />
    </properties>
</persistence-unit>

我一直在研究源代码,但没有帮助。看来hibernate中有一些不安全的代码:

/**
 * Get the JAR URL of the JAR containing the given entry
 * Method used in a non managed environment
 *
 * @param url URL pointing to the known file in the JAR
 * @param entry file known to be in the JAR
 * @return the JAR URL
 * @throws IllegalArgumentException if none URL is found
 */
public static URL getJarURLFromURLEntry(URL url, String entry) throws IllegalArgumentException 
    URL jarUrl;
    String file = url.getFile();
    if ( ! entry.startsWith( "/" ) ) entry = "/" + entry;
    file = file.substring( 0, file.length() - entry.length() );

如果 url 参数是比 entry 参数短的字符串,则发生异常。不确定我做得对,但这是我将日志级别设置为调试时的输出:

 INFO [main] (Environment.java:570) - Hibernate 3.5.4-Final
 INFO [main] (Environment.java:603) - hibernate.properties not found
 INFO [main] (Environment.java:781) - Bytecode provider name : javassist
 INFO [main] (Environment.java:662) - using JDK 1.4 java.sql.Timestamp handling
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [uuid] -> [class org.hibernate.id.UUIDHexGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [hilo] -> [class org.hibernate.id.TableHiLoGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [assigned] -> [class org.hibernate.id.Assigned]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [identity] -> [class org.hibernate.id.IdentityGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [select] -> [class org.hibernate.id.SelectGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [sequence] -> [class org.hibernate.id.SequenceGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [seqhilo] -> [class org.hibernate.id.SequenceHiLoGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [increment] -> [class org.hibernate.id.IncrementGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [foreign] -> [class org.hibernate.id.ForeignGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [guid] -> [class org.hibernate.id.GUIDGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [uuid.hex] -> [class org.hibernate.id.UUIDHexGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [sequence-identity] -> [class org.hibernate.id.SequenceIdentityGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [enhanced-sequence] -> [class org.hibernate.id.enhanced.SequenceStyleGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [enhanced-table] -> [class org.hibernate.id.enhanced.TableGenerator]
 INFO [main] (Version.java:37) - Hibernate Commons Annotations 3.2.0.Final
 INFO [main] (Version.java:42) - Hibernate EntityManager 3.5.4-Final
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [uuid] -> [class org.hibernate.id.UUIDHexGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [hilo] -> [class org.hibernate.id.TableHiLoGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [assigned] -> [class org.hibernate.id.Assigned]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [identity] -> [class org.hibernate.id.IdentityGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [select] -> [class org.hibernate.id.SelectGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [sequence] -> [class org.hibernate.id.SequenceGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [seqhilo] -> [class org.hibernate.id.SequenceHiLoGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [increment] -> [class org.hibernate.id.IncrementGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [foreign] -> [class org.hibernate.id.ForeignGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [guid] -> [class org.hibernate.id.GUIDGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [uuid.hex] -> [class org.hibernate.id.UUIDHexGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [sequence-identity] -> [class org.hibernate.id.SequenceIdentityGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [enhanced-sequence] -> [class org.hibernate.id.enhanced.SequenceStyleGenerator]
DEBUG [main] (DefaultIdentifierGeneratorFactory.java:99) - Registering IdentifierGenerator strategy [enhanced-table] -> [class org.hibernate.id.enhanced.TableGenerator]
DEBUG [main] (Ejb3Configuration.java:301) - Look up for persistence unit: testing
TRACE [main] (Ejb3Configuration.java:320) - PersistenceMetadata(version=1.0) [
    name: standard
    jtaDataSource: null
    nonJtaDataSource: null
    transactionType: RESOURCE_LOCAL
    provider: org.hibernate.ejb.HibernatePersistence
    useQuotedIdentifiers: false
    classes[
        package.grssc.model.Application     package.grssc.model.ExternalPerson      package.grssc.model.Organisation        package.grssc.model
.Qualification      package.grssc.model.Recommendation      package.grssc.model.MastersGrade        package.grssc.model.GraduatingClassPositionScore        package.grssc.model.MasterResultsScore      package.grssc.model.PenultimateAndFinalYearScore        package.grssc.model.IsisRewardCode      package.grs
sc.model.PyGrade        package.grssc.model.FyGrade             package.security.model.Person       package.security.model.Permission       package.security.model.Throttle     package.security.model.Role     package.security.model.Privilege        package.security.model.Group        package.security.model.LogEntry     package.security.model.LogEntryData     package.security.model.SimpleReport     package.security.model.Template     package.security.model.TemplateItem     package.security.model.Setting  ]
    packages[
    ]
    mappingFiles[
    ]
    jarFiles[
    ]
    hbmfiles: 0
    properties[
        java.runtime.name: Java(TM) SE Runtime Environment
        hibernate.connection.password: password
        sun.boot.library.path: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64
        java.vm.version: 16.3-b01
        hibernate.connection.username: username
        java.vm.vendor: Sun Microsystems Inc.
        java.vendor.url: http://java.sun.com/
        path.separator: :
        java.vm.name: Java HotSpot(TM) 64-Bit Server VM
        file.encoding.pkg: sun.io
        sun.java.launcher: SUN_STANDARD
        user.country: US
        sun.os.patch.level: unknown
        java.vm.specification.name: Java Virtual Machine Specification
        user.dir: /tmp/GRSSC
        java.runtime.version: 1.6.0_20-b02
        java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
        java.endorsed.dirs: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/endorsed
        os.arch: amd64
        java.io.tmpdir: /tmp
        line.separator: 

        java.vm.specification.vendor: Sun Microsystems Inc.
        os.name: Linux
        hibernate.c3p0.idle_test_period: 500
        sun.jnu.encoding: ANSI_X3.4-1968
        hibernate.c3p0.timeout: 300
        java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/amd64:/usr/jav
a/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
        java.class.version: 50.0
        java.specification.name: Java Platform API Specification
        sun.management.compiler: HotSpot 64-Bit Server Compiler
        os.version: 2.6.32-22-server
        user.home: /home/jacob
        user.timezone: 
        java.awt.printerjob: sun.print.PSPrinterJob
        java.specification.version: 1.6
        file.encoding: ANSI_X3.4-1968
        hibernate.format_sql: false
        hibernate.c3p0.min_size: 5
        hibernate.connection.driver_class: com.mysql.jdbc.Driver
        user.name: jacob
        java.class.path: /tmp/GRSSC/ant.build:/tmp/GRSSC/lib/ApplicationTemplate-1.0.jar:/tmp/GRSSC/lib/UMServices.jar:/tmp/GRSSC/lib/Validator.jar:/tmp/GRSSC/lib/Authentication-1.1.jar:/tmp/GRSSC/lib/UptecsEmail.jar:/tmp/GRSSC/lib/catalina-ant.jar:/tmp/GRSSC/lib/hibernate/antlr-2.7.6.jar:/tmp/GRSSC/lib/hibernate/c3p0-0.9.1.jar:/tmp/GRSSC/lib/hibernate/commons-co
llections-3.1.jar:/tmp/GRSSC/lib/hibernate/dom4j-1.6.1.jar:/tmp/GRSSC/lib/hibernate/hibernate-jpa-2.0-api-1.0.0.Final.jar:/tmp/GRSSC/lib/hibernate/hibernate3.jar:/tmp/GRSSC/lib/hibernate/javassi
st-3.9.0.GA.jar:/tmp/GRSSC/lib/hibernate/jta-1.1.jar:/tmp/GRSSC/lib/hibernate/slf4j-api-1.6.1.jar:/tmp/GRSSC/lib/hibernate/slf4j-log4j12-1.6.1.jar:/tmp/GRSSC/lib/hsqldb.jar:/tmp/GRSSC/lib/iText-
2.1.7.jar:/tmp/GRSSC/lib/jsp-api.jar:/tmp/GRSSC/lib/junit-3.8.2.jar:/tmp/GRSSC/lib/log4j-1.2.16.jar:/tmp/GRSSC/lib/mysql-connector-java-5.1.6-bin.jar:/tmp/GRSSC/lib/ojdbc5.jar:/tmp/GRSSC/lib/ser
vlet-api.jar:/tmp/GRSSC/lib/soap/axis-ant.jar:/tmp/GRSSC/lib/soap/axis.jar:/tmp/GRSSC/lib/soap/commons-discovery-0.2.jar:/tmp/GRSSC/lib/soap/commons-logging-1.0.4.jar:/tmp/GRSSC/lib/soap/jaxrpc.
jar:/tmp/GRSSC/lib/soap/saaj.jar:/tmp/GRSSC/lib/soap/wsdl4j-1.5.1.jar:/tmp/GRSSC/lib/soap/xercesImpl.jar:/usr/share/java/ant-launcher-1.7.1.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-
junit.jar
        hibernate.show_sql: false
        java.vm.specification.version: 1.0
        sun.arch.data.model: 64
        java.home: /usr/lib/jvm/java-6-sun-1.6.0.20/jre
        hibernate.connection.url: jdbc:oracle:thin:blah
        hibernate.dialect: org.hibernate.dialect.OracleDialect
        java.specification.vendor: Sun Microsystems Inc.
        user.language: en
        hibernate.c3p0.max_size: 20
        java.vm.info: mixed mode
        java.version: 1.6.0_20
        java.ext.dirs: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/ext:/usr/java/packages/lib/ext
        sun.boot.class.path: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/resources.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/rt.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/sunrsasign.ja
r:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/jsse.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/jce.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/charsets.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/cl
asses
        java.vendor: Sun Microsystems Inc.
        file.separator: /
        java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
        hibernate.hbm2ddl.auto: update
        sun.cpu.endian: little
        sun.io.unicode.encoding: UnicodeLittle
        sun.cpu.isalist: 
    ]]
TRACE [main] (Ejb3Configuration.java:320) - PersistenceMetadata(version=1.0) [
    name: testing
    jtaDataSource: null
    nonJtaDataSource: null
    transactionType: RESOURCE_LOCAL
    provider: org.hibernate.ejb.HibernatePersistence
    useQuotedIdentifiers: false
    classes[
        package.grssc.model.Application     package.grssc.model.ExternalPerson      package.grssc.model.Organisation        package.grssc.model
.Qualification      package.grssc.model.Recommendation      package.grssc.model.MastersGrade        package.grssc.model.GraduatingClassPositionScore        package.grssc.model.MasterResultsScore      package.grssc.model.PenultimateAndFinalYearScore        package.grssc.model.IsisRewardCode      package.grs
sc.model.PyGrade        package.grssc.model.FyGrade     package.grssc.model.IsisRewardCode      package.security.model.Person       package.security.model.Permission       package.security.model.Throttle     package.security.model.Role     package.security.model.Privilege        package.security.model.Group        package.security.model.LogEntry     package.security.model.LogEntryData     package.security.model.SimpleReport     -package.security.model.Template        package.security.model.TemplateItem     package.security.model.Setting  ]
    packages[
    ]
    mappingFiles[
    ]
    jarFiles[
    ]
    hbmfiles: 0
    properties[
        java.runtime.name: Java(TM) SE Runtime Environment
        hibernate.connection.password: 
        sun.boot.library.path: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64
        java.vm.version: 16.3-b01
        hibernate.connection.username: sa
        java.vm.vendor: Sun Microsystems Inc.
        java.vendor.url: http://java.sun.com/
        path.separator: :
        java.vm.name: Java HotSpot(TM) 64-Bit Server VM
        file.encoding.pkg: sun.io
        user.country: US
        sun.java.launcher: SUN_STANDARD
        sun.os.patch.level: unknown
        java.vm.specification.name: Java Virtual Machine Specification
        user.dir: /tmp/GRSSC
        java.runtime.version: 1.6.0_20-b02
        java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
        java.endorsed.dirs: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/endorsed
        os.arch: amd64
        java.io.tmpdir: /tmp
        line.separator: 

        java.vm.specification.vendor: Sun Microsystems Inc.
        os.name: Linux
        sun.jnu.encoding: ANSI_X3.4-1968
        java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/amd64:/usr/jav
a/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
        java.specification.name: Java Platform API Specification
        java.class.version: 50.0
        sun.management.compiler: HotSpot 64-Bit Server Compiler
        os.version: 2.6.32-22-server
        user.home: /home/jacob
        user.timezone: 
        java.awt.printerjob: sun.print.PSPrinterJob
        java.specification.version: 1.6
        file.encoding: ANSI_X3.4-1968
        hibernate.connection.driver_class: org.hsqldb.jdbcDriver
        user.name: jacob
        java.class.path: /tmp/GRSSC/ant.build:/tmp/GRSSC/lib/ApplicationTemplate-1.0.jar:/tmp/GRSSC/lib/UMServices.jar:/tmp/GRSSC/lib/Validator.jar:/tmp/GRSSC/lib/authentiAuthenti
cation-1.1.jar:/tmp/GRSSC/lib/UptecsEmail.jar:/tmp/GRSSC/lib/catalina-ant.jar:/tmp/GRSSC/lib/hibernate/antlr-2.7.6.jar:/tmp/GRSSC/lib/hibernate/c3p0-0.9.1.jar:/tmp/GRSSC/lib/hibernate/commons-co
llections-3.1.jar:/tmp/GRSSC/lib/hibernate/dom4j-1.6.1.jar:/tmp/GRSSC/lib/hibernate/hibernate-jpa-2.0-api-1.0.0.Final.jar:/tmp/GRSSC/lib/hibernate/hibernate3.jar:/tmp/GRSSC/lib/hibernate/javassi
st-3.9.0.GA.jar:/tmp/GRSSC/lib/hibernate/jta-1.1.jar:/tmp/GRSSC/lib/hibernate/slf4j-api-1.6.1.jar:/tmp/GRSSC/lib/hibernate/slf4j-log4j12-1.6.1.jar:/tmp/GRSSC/lib/hsqldb.jar:/tmp/GRSSC/lib/iText-
2.1.7.jar:/tmp/GRSSC/lib/jsp-api.jar:/tmp/GRSSC/lib/junit-3.8.2.jar:/tmp/GRSSC/lib/log4j-1.2.16.jar:/tmp/GRSSC/lib/mysql-connector-java-5.1.6-bin.jar:/tmp/GRSSC/lib/ojdbc5.jar:/tmp/GRSSC/lib/ser
vlet-api.jar:/tmp/GRSSC/lib/soap/axis-ant.jar:/tmp/GRSSC/lib/soap/axis.jar:/tmp/GRSSC/lib/soap/commons-discovery-0.2.jar:/tmp/GRSSC/lib/soap/commons-logging-1.0.4.jar:/tmp/GRSSC/lib/soap/jaxrpc.
jar:/tmp/GRSSC/lib/soap/saaj.jar:/tmp/GRSSC/lib/soap/wsdl4j-1.5.1.jar:/tmp/GRSSC/lib/soap/xercesImpl.jar:/usr/share/java/ant-launcher-1.7.1.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-
junit.jar
        java.vm.specification.version: 1.0
        sun.arch.data.model: 64
        java.home: /usr/lib/jvm/java-6-sun-1.6.0.20/jre
        hibernate.connection.url: jdbc:hsqldb:mem:unit-testing-jpa
        hibernate.dialect: org.hibernate.dialect.HSQLDialect
        java.specification.vendor: Sun Microsystems Inc.
        user.language: en
        java.vm.info: mixed mode
        java.version: 1.6.0_20
        java.ext.dirs: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/ext:/usr/java/packages/lib/ext
        sun.boot.class.path: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/resources.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/rt.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/sunrsasign.ja
r:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/jsse.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/jce.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/charsets.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/cl
asses
        java.vendor: Sun Microsystems Inc.
        file.separator: /
        java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
        hibernate.hbm2ddl.auto: create-drop
        sun.cpu.endian: little
        sun.io.unicode.encoding: UnicodeLittle
        sun.cpu.isalist: 
    ]]

【问题讨论】:

如果您知道原因,然后解决它,并提交错误报告。 您的分析是正确的,但不知何故,这不应该发生。您能否将 o.h.e.Ejb3Configuration 的日志记录设置为 TRACE 并使用输出更新问题。 @Thorbjom,我还不知道原因。无论哪种方式,我都不确定getJarURLFromURLEntry 在传递一些非预期输入时是否应该爆炸。 你能发布一个完整的 Eclipse 或 Maven 项目或类似的东西吗? 【参考方案1】:

文件名是否区分大小写?我不熟悉 OS/X 的文件系统,但也许它只是一个文件名,如persistence.xml 中的另一种情况?

这可以解释为什么它在 linux 上不起作用。

【讨论】:

以上是关于在 Linux 下运行时出现奇怪的休眠异常的主要内容,如果未能解决你的问题,请参考以下文章

尝试在 debian linux 上运行 ember 测试时出现奇怪的错误

为 rmiregistry 实例化服务器类时出现运行时异常

运行发布构建的应用程序时出现访问冲突异常

从 Mac OS X 10.6 64 位 macbook 运行时出现 CORBA 异常

将 IISLocal(适用于 IISExpression)与 ASP.NET MVC 一起使用时出现奇怪的异常

保存我的对象时出现休眠异常