简体   繁体   English

为什么这段代码崩溃了JVM?

[英]Why this code crashes the JVM?

Why does this code crashes the JVM? 为什么这段代码会崩溃JVM?

public Connection createConnectionFromDS() throws Exception {
    try {
        Connection con = null;
        Properties props = new Properties();
        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
        props.put(Context.PROVIDER_URL, "my_ip");
        Context ctx = new InitialContext(props);
        log.debug("Looking up datasource " + dataSourceName);
        DataSource dataSource = (javax.sql.DataSource) ctx.lookup(dataSourceName);
        con = dataSource.getConnection();
        return con;
    } catch (NameNotFoundException e) {
        throw new Exception("Datasource [" + dataSourceName + "] not bound!");
    }
}

The log is the following: 日志如下:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001800060ba, pid=3816, tid=3076
#
# JRE version: 6.0_39-b04
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.14-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [db2jcct2.dll+0x60ba]

I have already upgraded from 6.0_29 to 6.0_39, but it didn't solve the problem. 我已经从6.0_29升级到6.0_39,但它没有解决问题。

Briefly, it shouldn't . 简而言之,它不应该 That looks like a bug in db2jcct2.dll (your DB2 driver). 这看起来像db2jcct2.dll (您的DB2驱动程序)中的错误。

# Problematic frame:
# C  [db2jcct2.dll+0x60ba]

Can you try another version of your JDBC driver ? 你能试试另一个版本的JDBC驱动程序吗? And/or report this to IBM ? 和/或向IBM报告此事?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM