ORA-01017: 用户名/口令无效; 登录被拒绝
1 Exception in thread "main" org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 2 ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: 用户名/口令无效; 登录被拒绝 3 ) 4 ### The error may exist in file [D:\code_space\tcs-refactor\data\target\classes\com\travelsky\cupps\db\other\mapper\TbAirlineMapper.xml] 5 ### The error may involve com.travelsky.cupps.db.other.mapper.TbAirlineMapper.getAllAirlines 6 ### The error occurred while executing a query 7 ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: 用户名/口令无效; 登录被拒绝 8 ) 9 at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75) 10 at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) 11 at com.sun.proxy.$Proxy9.selectList(Unknown Source) 12 at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198) 13 at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119) 14 at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) 15 at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) 16 at com.sun.proxy.$Proxy10.getAllAirlines(Unknown Source) 17 at com.travelsky.cupps.db.other.PlatformDBContext.getAllAirlines(PlatformDBContext.java:34) 18 at com.travelsky.cupps.db.other.Start.main(Start.java:49) 19 Caused by: org.apache.ibatis.exceptions.PersistenceException: 20 ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: 用户名/口令无效; 登录被拒绝 21 ) 22 ### The error may exist in file [D:\code_space\tcs-refactor\data\target\classes\com\travelsky\cupps\db\other\mapper\TbAirlineMapper.xml] 23 ### The error may involve com.travelsky.cupps.db.other.mapper.TbAirlineMapper.getAllAirlines 24 ### The error occurred while executing a query 25 ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: 用户名/口令无效; 登录被拒绝 26 ) 27 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26) 28 at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111) 29 at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102) 30 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 31 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 32 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 33 at java.lang.reflect.Method.invoke(Method.java:497) 34 at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358) 35 ... 8 more 36 Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: 用户名/口令无效; 登录被拒绝 37 ) 38 at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) 39 at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:81) 40 at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) 41 at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:279) 42 at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:72) 43 at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:59) 44 at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267) 45 at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137) 46 at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96) 47 at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77) 48 at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108) 49 ... 14 more 50 Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: 用户名/口令无效; 登录被拒绝 51 ) 52 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225) 53 at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) 54 at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) 55 at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) 56 ... 24 more 57 Caused by: java.sql.SQLException: ORA-01017: 用户名/口令无效; 登录被拒绝 58 59 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) 60 at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289) 61 at oracle.jdbc.ttc7.O3log.receive2nd(O3log.java:496) 62 at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:278) 63 at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346) 64 at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468) 65 at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314) 66 at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) 67 at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294) 68 at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247) 69 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221) 70 ... 27 more
出现这个问题,首先看你的用户名密码是否写错,可能真是哦。
假如真没有错的话,可能又像我一样入坑了,
这是我错误的配置:
感觉应该都没什么问题对吧,可是就是不行,然后我做了下面的更改,就莫名其妙的好了.
这样就可以,真心不知道为什么,有大神看到的话,求解答一下。