4

在我们的 Oracle DB 从 11g 升级到 12g 之后,我们得到了下面的堆栈跟踪信息Io exception: Oracle Error ORA-12650。我该如何解决这个问题?

2015-10-26 14:59:36,319 [RMI TCP Connection(2)-127.0.0.1] u:/d: ERROR org.enhydra.jdbc.xapool - Error Exception in GenericPool:start java.sql.SQLException: Cannot get connection for URL jdbc:oracle:thin:@test.db.my.edu:1521:sid : Io exception: Oracle Error ORA-12650
java.sql.SQLException: Cannot get connection for URL jdbc:oracle:thin:@test.db.my.edu:1521:sid : Io exception: Oracle Error ORA-12650
at org.enhydra.jdbc.standard.StandardDataSource.getConnection(StandardDataSource.java:216)
at org.kuali.rice.core.database.RiceXADataSource.getConnection(RiceXADataSource.java:58)
at org.enhydra.jdbc.standard.StandardPooledConnection.<init>(StandardPooledConnection.java:65)
at org.enhydra.jdbc.standard.StandardXAConnection.<init>(StandardXAConnection.java:81)
at org.enhydra.jdbc.standard.StandardXADataSource.getXAConnection(StandardXADataSource.java:110)
at org.enhydra.jdbc.pool.StandardXAPoolDataSource.create(StandardXAPoolDataSource.java:159)
at org.enhydra.jdbc.pool.GenericPool.getFromPool(GenericPool.java:251)
at org.enhydra.jdbc.pool.GenericPool.checkOut(GenericPool.java:357)
at org.enhydra.jdbc.pool.StandardPoolDataSource.getConnection(StandardPoolDataSource.java:194)
at org.enhydra.jdbc.pool.StandardPoolDataSource.getConnection(StandardPoolDataSource.java:164)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:210)
at com.sun.proxy.$Proxy174.prepareStatement(Unknown Source)
at org.apache.ojb.broker.accesslayer.StatementsForClassImpl.prepareStatement(Unknown Source)
at org.apache.ojb.broker.accesslayer.StatementsForClassImpl.getPreparedStmt(Unknown Source)
at org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement(Unknown Source)
at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown Source)
at org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown Source)
at org.apache.ojb.broker.accesslayer.RsIterator.<init>(Unknown Source)
at org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(Unknown Source)
at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source)
at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source)
at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown Source)
at org.springmodules.orm.ojb.PersistenceBrokerTemplate$3.doInPersistenceBroker(PersistenceBrokerTemplate.java:195)
at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:141)
at org.springmodules.orm.ojb.PersistenceBrokerTemplate.executeFind(PersistenceBrokerTemplate.java:162)
at org.springmodules.orm.ojb.PersistenceBrokerTemplate.getCollectionByQuery(PersistenceBrokerTemplate.java:193)
at org.kuali.rice.ksb.messaging.dao.impl.ServiceInfoDAOOjbImpl.findLocallyPublishedServices(ServiceInfoDAOOjbImpl.java:95)
at org.kuali.rice.ksb.messaging.service.impl.ServiceRegistryImpl.findLocallyPublishedServices(ServiceRegistryImpl.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy65.findLocallyPublishedServices(Unknown Source)
at org.kuali.rice.ksb.messaging.RemotedServiceRegistryImpl.run(RemotedServiceRegistryImpl.java:337)
at org.kuali.rice.ksb.messaging.RemotedServiceRegistryImpl.start(RemotedServiceRegistryImpl.java:391)
at org.kuali.rice.core.lifecycle.ServiceDelegatingLifecycle.start(ServiceDelegatingLifecycle.java:50)
at org.kuali.rice.core.lifecycle.BaseCompositeLifecycle.start(BaseCompositeLifecycle.java:40)
at org.kuali.rice.core.lifecycle.BaseCompositeLifecycle.start(BaseCompositeLifecycle.java:40)
at org.kuali.rice.core.config.RiceConfigurerBase.start(RiceConfigurerBase.java:106)
at org.kuali.rice.core.config.RiceConfigurer.start(RiceConfigurer.java:100)
at org.kuali.rice.core.config.RiceConfigurerBase.afterPropertiesSet(RiceConfigurerBase.java:85)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:308)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:947)
at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:701)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:377)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at org.kuali.rice.core.web.listener.StandaloneInitializeListener.contextInitialized(StandaloneInitializeListener.java:133)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5017)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5531)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1809)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
4

4 回答 4

6

我们的解决方案是将 ojdbc jar 从 ojdbc14-10.xxx 升级到 ojdbc14-11.xxx

于 2015-10-27T20:27:34.083 回答
1

检查 jre 路径中是否已经存在版本的 ojdbc jar。如果是这样,请删除此 jar,因为它会与您的应用程序中正确版本的 ojdc 冲突。就像我的情况一样,它与 maven repo 路径冲突。

于 2017-06-18T10:35:30.510 回答
0

我用过ojdbc7.jar。这对我来说可以。这是链接

于 2016-07-06T10:59:50.610 回答
0

升级到 Oracle 19c 后遇到同样的错误。我能够通过以下更改解决问题-

  1. 从 Oracle19 客户端将 ojdbc6.jar 替换为 ojdbc8.jar

  2. 在连接中使用了这些参数

    属性 prop = new Properties(); prop.put("用户", 用户); prop.put("密码", pwd); prop.put("oracle.net.encryption_client", "已接受"); prop.put("oracle.net.encryption_types_client", "AES256"); prop.put("oracle.net.crypto_checksum_client","REQUESTED"); prop.put("oracle.net.crypto_checksum_types_client", "SHA256");

    Connection con = DriverManager.getConnection(url, prop);

部署上述更改后,我可以连接到数据库。

希望这个答案可以帮助面临类似错误的人。

于 2021-06-17T10:34:24.523 回答