-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate using wrong SID for oracle Database Please Help
PostPosted: Sat Mar 31, 2007 10:25 pm 
Newbie

Joined: Sat Mar 31, 2007 10:06 pm
Posts: 6
Hello,
I am just a starter on hibernate. I am going thru the tutorial on hibernate.org. Only thing I am doing different is, Oracle 10g, express edition. On execution I am getting this error below. I defined the right JDBC url, still it is picking up wrong SID.
---------------------------------------------------------------------------------------------------------
21:53:55,125 INFO SessionFactoryImpl:161 - building session factory
21:53:55,484 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
21:53:55,625 WARN JDBCExceptionReporter:77 - SQL Error: 0, SQLState: null
21:53:55,625 ERROR JDBCExceptionReporter:78 - Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl

Exception in thread "main" org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:424)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)

-------------------------------------------------------------------------------------

My config files look like this


<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin://localhost:1521:XE</property>
<property name="connection.username">event</property>
<property name="connection.password">event</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

_________________
Its coming you will see.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 01, 2007 1:02 pm 
Newbie

Joined: Sat Mar 31, 2007 10:06 pm
Posts: 6
Well, folks its me again, the original poster. I tried to use a plugin with eclipse to connect to the oracle, still getting the same problem. Suprisingly I could connect just fine using client like db visualizer, sql explorer etc. Why I am getting this error with oracle 10g. Please anybody, any idea? I have the jars from oracle 10g for driver.

Ignoring resources in Project output: /hibernate/bin
Ignoring resources in Project output: /hibernate/bin
Adding Project Classpath file:/C:/javaproject/hibernate/bin/
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
The Connection descriptor used by the client was:
localhost:1521:orcl

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at net.sf.hibernator.HibernateConnection.createConnection(HibernateConnection.java:157)
at net.sf.hibernator.views.ConnectionView$8.run(ConnectionView.java:199)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

_________________
Its coming you will see.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 01, 2007 1:49 pm 
Newbie

Joined: Sat Mar 31, 2007 10:06 pm
Posts: 6
Folks forget it. I had url wrong. I needed to use @ sign instead of // before localhost.

_________________
Its coming you will see.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.