开发者

Oracle connection error using Tomcat

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.SQL开发者_JAVA百科NestedException: 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?


ORA-01033: ORACLE initialization or shutdown in progress

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/


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;


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. :)


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜