日期:2014-05-16  浏览次数:21124 次

resin通过OCI方式产生EXCEPTION_ACCESS_VIOLATION 错误解决

过去thin驱动连接没问题,改成oci方式报一下错误:

?

?

?写道
#
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x61d32910, pid=8776, tid=5824
#
# Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode windows-x86)
# Problematic frame:
# C [OraClient10.Dll+0x112910]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

?参考了一下文章:

http://blog.csdn.net/xiaoxiao_hei/article/details/4410850

https://forums.oracle.com/forums/thread.jspa?threadID=504792

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7033090

?

初步定位是驱动的问题。然后用JDBC直接连接做测试:

?

?

?

Class.forName("oracle.jdbc.driver.OracleDriver");
		System.out.println(System.getProperty("java.library.path"));
		Connection conn = DriverManager
				.getConnection(
						"jdbc:oracle:oci8:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=本地地址)(PORT=本地端口))(ADDRESS=(PROTOCOL=TCP)(HOST=映射地址)(PORT=映射端口)))(SOURCE_ROUTE=yes)(CONNECT_DATA=(SERVICE_NAME=shop)))",
					
		"用户名", "密码");
		System.out.println(conn);
?

确定连接数据库没问题。

确定是resin启动的问题,在resin启动的时候讲ojbc14.jar加入。

?

问题解决。