使用 Tomcat 连接 Oracle 错误
我正在使用 Eclipse Galileo 和 Tomcat 6.0。我收到这样的错误:
2010-08-17 00:09:42,684,JDBCExceptionReporter,WARN,,SQL Error: 0, SQLState: null
2010-08-17 00:09:42,684,JDBCExceptionReporter,ERROR,,Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in progress
)
2010-08-17 00:09:42,684,SettingsFactory,WARN,,Could not obtain connection metadata
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in progress
)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
我将 ojdbc14-9.2.0.8.jar
放置在 Tomcat lib
文件夹以及 Tomcat webapps< 内的部署文件夹中/代码> 文件夹。
有谁知道是什么原因造成的?
I am using Eclipse Galileo and Tomcat 6.0. I am getting an error like this:
2010-08-17 00:09:42,684,JDBCExceptionReporter,WARN,,SQL Error: 0, SQLState: null
2010-08-17 00:09:42,684,JDBCExceptionReporter,ERROR,,Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in progress
)
2010-08-17 00:09:42,684,SettingsFactory,WARN,,Could not obtain connection metadata
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in progress
)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
I have ojdbc14-9.2.0.8.jar
placed in the Tomcat lib
folder as well as the deployment folders inside Tomcat webapps
folder.
Anyone knows what is causing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我不确定发生了什么,但问题现在似乎已经消失了。我将所有项目的所有支持 jar 放入部署文件夹中。不确定这是否与此有关,或者我只是很幸运,但我现在没有收到此错误。 :)
I'm not sure what happened, but the issues seem to be gone now. I put all my support jars for all projects into the deployment folder. Not sure if that was related to this or I just got lucky, but I am not getting this error now. :)
尽管此错误表明初始化或关闭正在进行中,但导致此错误的原因可能有很多。请参阅我在类似帖子中的回答 - https://stackoverflow.com/a/20444726/2789764
Though this error says that initialization or shutdown in progress , there can be many reasons for this error. Please see my answer at a similar post - https://stackoverflow.com/a/20444726/2789764
这表明数据库正在启动或关闭,并且无法建立与该数据库的连接。
检查您的数据库实例是否已启动。如果没有,请在再次尝试程序之前从 sqlplus 提示符中调用“startup”。
如果您使用 SQLDeveloper,您还可以检查是否使用它连接到数据库。
解释ora代码的几个链接:
http://ora-01033.ora-code.com/
http://www.dbmotive.com/oracle_error_codes.php?errcode=01033
http://www.orafaq.com/forum/t/38120/2 /
This indicates that DB is in process of either startup or shutdown and Connection to this DB can't be established.
Check your database instance is started. If not then call "startup" from sqlplus prompt before you try your program again.
If you use SQLDeveloper ,You can also check do you get connected to database using it.
Few links explaining ora code:
http://ora-01033.ora-code.com/
http://www.dbmotive.com/oracle_error_codes.php?errcode=01033
http://www.orafaq.com/forum/t/38120/2/
服务器启动时是否会发生这种情况(可能是tomcat和oracle位于同一服务器上的开发环境)? Tomcat 通常会比数据库启动得更快,因此它很可能在数据库准备就绪之前尝试连接。
您(或您的 DBA)应该能够运行以下查询来显示数据库启动的时间。可以通过警报日志来确定启动所需的时间。如果它突然关闭,它必须先将重做日志应用到数据文件,然后才能允许其他会话连接。然后,它必须回滚关闭时未提交的任何事务,但它可以在此阶段处理其他会话。
从 v$instance 中选择startup_time;
Is this happening on server startup (maybe a deve environment where tomcat and oracle are on the same server) ? Tomcat would generally start up quicker than the database so it could well be trying to connect before the database is ready.
You (or your DBA) should be able to run the following query to show when the database started up. The alert log would be the place to look to determine how long it took to startup. If it was shut down abruptly, it has to apply the redo logs to the datafiles before it can permit other sessions to connect. It then has to rollback any transactions that were uncommitted when it was shutdown, but it can handle other sessions during this phase.
select startup_time from v$instance;