Hi,
I have a problem in connecting to a Oracle database whilst trying some very simple code which has only one mapping file.
I run Hibernate in a standalone Java environment (no app. server).
When I run the code in Hibernate v2.1.7, the code works fine. However, when I moved to v3.0 alpha. I got the following error message:
ERROR Configuration:380 - Could not configure datastore from input stream. (full stack trace shown further down).
Can somebody please help me?
------------------------
My configuration is:
IDE: eclipse Version: 3.0.1.
DB: Oracle 9.2.0.4.0
JDK: 1.4.2_04
jdbc: ojdbc14.jar
----------------------------
Mapping file contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="test.hibernate.Product"
table="products">
<id name="id" type="string"
unsaved-value="null">
<column name="id" sql-type="varchar2(100)"
not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="name">
<column name="name" sql-type="varchar2(100)"
not-null="true"/>
</property>
<property name="price">
<column name="price" sql-type="number(10, 5)"
not-null="true"/>
</property>
<property name="amount">
<column name="amount" sql-type="integer"
not-null="true"/>
</property>
</class>
</hibernate-mapping>
-----------
Full stack trace below:
---------------------
11:40:09,827 INFO Environment:411 - Hibernate 3.0 alpha
11:40:09,874 INFO Environment:429 - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.connection.username=ylidev, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:oracle:thin:@longmdappu12.uk.db.com:1572:GrimisU1, hibernate.connection.password=ylidev, hibernate.showSql=true, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
11:40:09,874 INFO Environment:456 - using java.io streams to persist binary types
11:40:09,874 INFO Environment:457 - using CGLIB reflection optimizer
11:40:09,890 INFO Environment:486 - using JDK 1.4 java.sql.Timestamp handling
11:40:10,077 INFO Configuration:435 - Mapping resource: test/hibernate/Product.hbm.xml
11:40:36,250 ERROR Configuration:380 - Could not configure datastore from input stream
org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:371)
at org.hibernate.cfg.Configuration.addClass(Configuration.java:439)
at test.InsertProduct.main(InsertProduct.java:40)
Nested exception:
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:512)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:489)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:617)
at java.net.URL.openStream(URL.java:913)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:371)
at org.hibernate.cfg.Configuration.addClass(Configuration.java:439)
at test.InsertProduct.main(InsertProduct.java:40)
org.hibernate.MappingException: Error reading resource: test/hibernate/Product.hbm.xml
at org.hibernate.cfg.Configuration.addClass(Configuration.java:442)
at test.InsertProduct.main(InsertProduct.java:40)
Caused by: org.hibernate.MappingException: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:381)
at org.hibernate.cfg.Configuration.addClass(Configuration.java:439)
... 1 more
Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:371)
... 2 more
Exception in thread "main"
|