一、异常描述
最近使用oracle的时,重启应用服务tomcat日志报"org.hibernate.exception.GenericJDBCException: Cannot open connection..org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-28001: the password has expired.."异常错误,报用户密码过期失效,导致无法正常连接数据使用,具体详细错误日志如下>>
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection@b@Caused by: @b@org.hibernate.exception.GenericJDBCException: Cannot open connection@b@ at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)@b@ at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)@b@ at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)@b@ at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)@b@ at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)@b@ at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)@b@ at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)@b@ at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)@b@ at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1327)@b@ at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510)@b@ at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)@b@ at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262)@b@ at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)@b@ at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)@b@ at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)@b@ at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)@b@ at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)@b@ at com.xwood.pms.dao.impl.FtpServerDao$$EnhancerByCGLIB$$f40eedb7.find(<generated>)@b@ at com.xwood.pms.service.impl.FtpServerServer.findFtps(FtpServerServer.java:123)@b@ at com.xwood.pms.service.impl.FtpServerServer.findAndSetFtps(FtpServerServer.java:154)@b@ at com.xwood.pms.util.publisher.FtpOms.<init>(FtpOms.java:52)@b@ at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)@b@ at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)@b@ at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)@b@ at java.lang.reflect.Constructor.newInstance(Constructor.java:423)@b@ at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)@b@ at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)@b@ at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:187)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:800)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:718)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)@b@ at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)@b@ at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:372)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:919)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:834)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)@b@ at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)@b@ at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:267)@b@ at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1100)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:268)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)@b@ at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:267)@b@ at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1100)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862)@b@ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)@b@ at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)@b@ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)@b@ at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)@b@ at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)@b@ at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)@b@ at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)@b@ at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)@b@ at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)@b@ at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)@b@ at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)@b@ at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)@b@ at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)@b@ at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)@b@ at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)@b@ at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)@b@ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)@b@ at java.util.concurrent.FutureTask.run(FutureTask.java:266)@b@ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)@b@ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)@b@ at java.lang.Thread.run(Thread.java:748)@b@Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-28001: the password has expired@b@)@b@ at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)@b@ at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)@b@ at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)@b@ at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)@b@ ... 72 more@b@Caused by: java.sql.SQLException: ORA-28001: the password has expired@b@@b@ at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)@b@ at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:388)@b@ at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:381)@b@ at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:564)@b@ at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:431)@b@ at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)@b@ at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)@b@ at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366)@b@ at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:752)@b@ at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359)@b@ at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)@b@ at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)@b@ at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)@b@ at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)@b@ at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)@b@ at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)@b@ at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)@b@ at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)@b@ ... 75 more
二、解决方法