Weblogic10.3+Oracle10g 运行报错:
环境:intellij11.1.1、oracle10g、Weblogic10.3
java.lang.IllegalAccessError: tried to access method oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(Ljava/util/Properties;)Ljavax/sql/PooledConnection; from class oracle.jdbc.pool.OracleConnectionCacheImpl
at oracle.jdbc.pool.OracleConnectionCacheImpl.getNewPoolOrXAConnection(OracleConnectionCacheImpl.java:547)
at oracle.jdbc.pool.OracleConnectionCacheImpl.getPooledConnection(OracleConnectionCacheImpl.java:423)
at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:259)
at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:237)
at db.DefaultDataSource.getConnection(DefaultDataSource.java:96)
Truncated. see log file for complete stacktrace
......
java.lang.IllegalAccessError: tried to access method oracle.jdbc.pool.OracleDataSource.getPassword()Ljava/lang/String; from class oracle.jdbc.pool.OracleConnectionCacheImpl
at oracle.jdbc.pool.OracleConnectionCacheImpl.getPooledConnection(OracleConnectionCacheImpl.java:326)
at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:259)
at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:237)
at db.DefaultDataSource.getConnection(DefaultDataSource.java:96)
at db.ConnManager.getConnection(ConnManager.java:112)
看意思是oracle.jdbc.pool.OracleDataSource.getPassword()的方法声明的是private,没有访问权限。但是引用的jar包版本是ojdbc14-10.2.0.3.0.jar查看源码使用的是protected,继承的父类,有读取权限,那估计可能是jar包冲突了,去lib下找jar包分析,没有发现有冲突的jar包,目前切换成tomcat问题解决,印象中切换成weblogic8.1.6可解决,但是代码中有大量泛型无法用jdk1.4部署所以没有尝试,具体原因还需继续分析。