Javascript required
Skip to content Skip to sidebar Skip to footer

Hhh000319 Could Not Get Database Metadata

Default connection to Database is not happening......Please help

I have installed oracle 11gXE and through cmd prompt i got connected to database.

In the configuration.xml file I gave the following code.
<bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close">
<property name="connectionCachingEnabled" value="true" />
<property name="URL" value="jdbcracle:thin:@localhost:1521:XE" />
<property name="user" value="scott" />
<property name="password" value="tiger" />
</bean>

When i start the tomcat the tomcat I get the following error:

14:36:08,137 WARN JdbcServicesImpl:169 - HHH000342: Could not obtain connection to query metadata : Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

14:36:08,888 ERROR SchemaUpdate:201 - HHH000319: Could not get database metadata
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:263)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:389)
at oracle.jdbc.driver.PhysicalConnection.<init>(Physi calConnection.java:454)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnect ion.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnectio n(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:802)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConne ction(OracleDataSource.java:298)
at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:222)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.ge tPhysicalConnection(OracleConnectionPoolDataSource .java:158)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.ge tPooledConnection(OracleConnectionPoolDataSource.j ava:95)
at oracle.jdbc.pool.OracleImplicitConnectionCache.mak eCacheConnection(OracleImplicitConnectionCache.jav a:1571)
at oracle.jdbc.pool.OracleImplicitConnectionCache.mak eOneConnection(OracleImplicitConnectionCache.java: 494)
at oracle.jdbc.pool.OracleImplicitConnectionCache.get CacheConnection(OracleImplicitConnectionCache.java :455)
at oracle.jdbc.pool.OracleImplicitConnectionCache.get Connection(OracleImplicitConnectionCache.java:341)
at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:405)
at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:190)
at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:166)
at org.hibernate.ejb.connection.InjectedDataSourceCon nectionProvider.getConnection(InjectedDataSourceCo nnectionProvider.java:70)
at org.hibernate.tool.hbm2ddl.SuppliedConnectionProvi derConnectionHelper.prepare(SuppliedConnectionProv iderConnectionHelper.java:51)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(Sc hemaUpdate.java:194)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(Sc hemaUpdate.java:178)
at org.hibernate.internal.SessionFactoryImpl.<init>(S essionFactoryImpl.java:503)
at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1750)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>( EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityMan agerFactory(Ejb3Configuration.java:905)
at org.hibernate.ejb.Ejb3Configuration.buildEntityMan agerFactory(Ejb3Configuration.java:890)
at org.hibernate.ejb.HibernatePersistence.createConta inerEntityManagerFactory(HibernatePersistence.java :74)
at org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean.createNativeEntityManagerFactory( LocalContainerEntityManagerFactoryBean.java:268)
at org.springframework.orm.jpa.AbstractEntityManagerF actoryBean.afterPropertiesSet(AbstractEntityManage rFactoryBean.java:310)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1452)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:567)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:913)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:464)
at org.springframework.web.context.ContextLoader.conf igureAndRefreshWebApplicationContext(ContextLoader .java:385)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 111)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4467)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:722)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:516)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
14:36:08,888 ERROR SchemaUpdate:245 - HHH000299: Could not complete schema update
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:263)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:389)
at oracle.jdbc.driver.PhysicalConnection.<init>(Physi calConnection.java:454)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnect ion.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnectio n(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:802)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConne ction(OracleDataSource.java:298)
at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:222)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.ge tPhysicalConnection(OracleConnectionPoolDataSource .java:158)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.ge tPooledConnection(OracleConnectionPoolDataSource.j ava:95)
at oracle.jdbc.pool.OracleImplicitConnectionCache.mak eCacheConnection(OracleImplicitConnectionCache.jav a:1571)
at oracle.jdbc.pool.OracleImplicitConnectionCache.mak eOneConnection(OracleImplicitConnectionCache.java: 494)
at oracle.jdbc.pool.OracleImplicitConnectionCache.get CacheConnection(OracleImplicitConnectionCache.java :455)
at oracle.jdbc.pool.OracleImplicitConnectionCache.get Connection(OracleImplicitConnectionCache.java:341)
at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:405)
at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:190)
at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:166)
at org.hibernate.ejb.connection.InjectedDataSourceCon nectionProvider.getConnection(InjectedDataSourceCo nnectionProvider.java:70)
at org.hibernate.tool.hbm2ddl.SuppliedConnectionProvi derConnectionHelper.prepare(SuppliedConnectionProv iderConnectionHelper.java:51)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(Sc hemaUpdate.java:194)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(Sc hemaUpdate.java:178)
at org.hibernate.internal.SessionFactoryImpl.<init>(S essionFactoryImpl.java:503)
at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1750)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>( EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityMan agerFactory(Ejb3Configuration.java:905)
at org.hibernate.ejb.Ejb3Configuration.buildEntityMan agerFactory(Ejb3Configuration.java:890)
at org.hibernate.ejb.HibernatePersistence.createConta inerEntityManagerFactory(HibernatePersistence.java :74)
at org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean.createNativeEntityManagerFactory( LocalContainerEntityManagerFactoryBean.java:268)
at org.springframework.orm.jpa.AbstractEntityManagerF actoryBean.afterPropertiesSet(AbstractEntityManage rFactoryBean.java:310)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1452)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:567)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:913)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:464)
at org.springframework.web.context.ContextLoader.conf igureAndRefreshWebApplicationContext(ContextLoader .java:385)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 111)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4467)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:722)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:516)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
14:36:09,487 DEBUG FlowDefinitionRegistryImpl:100 - Registering flow definition

Hhh000319 Could Not Get Database Metadata

Source: http://www.javaprogrammingforums.com/jdbc-databases/30031-connection-database-not-happening-please-help.html