-->
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.  [ 1 post ] 
Author Message
 Post subject: Cannot connect to OracleXE
PostPosted: Wed Oct 07, 2009 10:39 am 
Newbie

Joined: Wed Oct 07, 2009 10:34 am
Posts: 2
Hello everybody. I made a small tutorial starting up with hibernate from scratch using PostGreSQL and it worked fine. I switched to Oracle Express Edition with the following hibernate.cfg.xml

Code:
<hibernate-configuration>
   <session-factory>
      <property name="dialect">org.hibernate.dialect.OracleDialect</property>
      <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
      <property name="connection.username">SYSTEM</property>
      <property name="connection.password">secure</property>
      <property name="connection.url">jdbc:oracle:thin:@localhost:8081:xe</property>
     
      <mapping resource="domain/Person.hbm.xml"/>
   </session-factory>
</hibernate-configuration>


When i execute the same code (which worked with PostGreSQL) i get an exception:

Code:
7422 [main] WARN  org.hibernate.cfg.SettingsFactory  - Could not obtain connection to query metadata
java.sql.SQLException: Got minus one from a read call
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
   at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
   at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
   at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
   at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
   at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
   at database.HibernateUtil.<init>(HibernateUtil.java:21)
   at database.HibernateUtil.getInstance(HibernateUtil.java:26)
   at control.Controller.createDatabase(Controller.java:15)
   at control.BusinessAdministration.main(BusinessAdministration.java:11)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
   at oracle.net.ns.Packet.receive(Packet.java:285)
   at oracle.net.ns.NSProtocol.connect(NSProtocol.java:286)
   at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
   ... 15 more


And then the application seems to try it again and i get the following exception:

Code:
4218 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport  - schema export unsuccessful
java.sql.SQLException: Got minus one from a read call
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
   at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
   at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
   at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
   at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
   at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:52)
   at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:252)
   at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:211)
   at database.HibernateUtil.createDatabase(HibernateUtil.java:33)
   at control.Controller.createDatabase(Controller.java:15)
   at control.BusinessAdministration.main(BusinessAdministration.java:11)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
   at oracle.net.ns.Packet.receive(Packet.java:285)
   at oracle.net.ns.NSProtocol.connect(NSProtocol.java:286)
   at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
   ... 13 more


Please note that i call the ExportSchema.create first (I seem to get the first exception there)
And then i try to insert something into the database (I get the second exception there i think)

Has anyone an idea what it could be?
Thanks in advance!


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

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.