facebook

[Closed] Hibernate 3.0 and Microsoft SQL

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #241051 Reply

    Dear All,

    Am attempting to get my head around Hibernate, MyEclipse and Struts. Just started working through the examples from http://www.laliluna.de.

    My curent issues are (a) that my system seems unable to recognise that I’ve installed version 3.0 of Hibernate

    the .myhibernatedata looks like this

    
    #
    #Tue Nov 08 17:34:42 CET 2005
    configFile=
    libInstallFolder=
    addLibs2Classpath=false
    addLibs2Project=false
    createConfigFile=false
    keyGenerator=sequence
    version=2.1
    basePersistenceClass=
    useJavaTypes=true
    

    Can’t seem to get it to update. It may or may not be related to the second problem (b) I get when I run my database testing program: –

    
    0 [main] INFO com.ympulse.library.LibraryTest  - Started main method
    95 [main] INFO org.hibernate.cfg.Environment  - Hibernate 3.0.5
    95 [main] INFO org.hibernate.cfg.Environment  - hibernate.properties not found
    111 [main] INFO org.hibernate.cfg.Environment  - using CGLIB reflection optimizer
    111 [main] INFO org.hibernate.cfg.Environment  - using JDK 1.4 java.sql.Timestamp handling
    237 [main] INFO org.hibernate.cfg.Configuration  - configuring from resource: /hibernate.cfg.xml
    237 [main] INFO org.hibernate.cfg.Configuration  - Configuration resource: /hibernate.cfg.xml
    602 [main] DEBUG org.hibernate.util.DTDEntityResolver  - trying to locate http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath under org/hibernate/
    602 [main] DEBUG org.hibernate.util.DTDEntityResolver  - found http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath
    650 [main] DEBUG org.hibernate.cfg.Configuration  - myeclipse.connection.profile=testbase
    650 [main] DEBUG org.hibernate.cfg.Configuration  - connection.url=jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=testbase
    650 [main] DEBUG org.hibernate.cfg.Configuration  - connection.username=sa
    650 [main] DEBUG org.hibernate.cfg.Configuration  - connection.password=xxxxxxx
    650 [main] DEBUG org.hibernate.cfg.Configuration  - connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver
    650 [main] DEBUG org.hibernate.cfg.Configuration  - dialect=org.hibernate.dialect.SQLServerDialect
    650 [main] DEBUG org.hibernate.cfg.Configuration  - null<-org.dom4j.tree.DefaultAttribute@121ab80 [Attribute: name resource value "com/ympulse/library/Book.hbm.xml"]
    665 [main] INFO org.hibernate.cfg.Configuration  - Mapping resource: com/ympulse/library/Book.hbm.xml
    665 [main] DEBUG org.hibernate.util.DTDEntityResolver  - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under org/hibernate/
    665 [main] DEBUG org.hibernate.util.DTDEntityResolver  - http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd not found in classpath
    21999 [main] ERROR org.hibernate.cfg.Configuration  - 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:484)
        at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
        at com.ympulse.library.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:48)
        at com.ympulse.library.LibraryTest.main(LibraryTest.java:37)
    Nested exception: 
    java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.<init>(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        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.XML11Configuration.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:465)
        at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
        at com.ympulse.library.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:48)
        at com.ympulse.library.LibraryTest.main(LibraryTest.java:37)
    %%%% Error Creating SessionFactory %%%%
    org.hibernate.MappingException: Error reading resource: com/ympulse/library/Book.hbm.xml
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:452)
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
        at com.ympulse.library.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:48)
        at com.ympulse.library.LibraryTest.main(LibraryTest.java:37)
    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:408)
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
        ... 7 more
    Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
        at org.dom4j.io.SAXReader.read(SAXReader.java:484)
        at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
        ... 8 more
    Exception in thread "main" java.lang.NullPointerException
        at com.ympulse.library.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:56)
        at com.ympulse.library.LibraryTest.main(LibraryTest.java:37)
    0 [main] INFO com.ympulse.library.LibraryTest  - Started main method
    95 [main] INFO org.hibernate.cfg.Environment  - Hibernate 3.0.5
    95 [main] INFO org.hibernate.cfg.Environment  - hibernate.properties not found
    111 [main] INFO org.hibernate.cfg.Environment  - using CGLIB reflection optimizer
    111 [main] INFO org.hibernate.cfg.Environment  - using JDK 1.4 java.sql.Timestamp handling
    237 [main] INFO org.hibernate.cfg.Configuration  - configuring from resource: /hibernate.cfg.xml
    237 [main] INFO org.hibernate.cfg.Configuration  - Configuration resource: /hibernate.cfg.xml
    602 [main] DEBUG org.hibernate.util.DTDEntityResolver  - trying to locate http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath under org/hibernate/
    602 [main] DEBUG org.hibernate.util.DTDEntityResolver  - found http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath
    650 [main] DEBUG org.hibernate.cfg.Configuration  - myeclipse.connection.profile=testbase
    650 [main] DEBUG org.hibernate.cfg.Configuration  - connection.url=jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=testbase
    650 [main] DEBUG org.hibernate.cfg.Configuration  - connection.username=sa
    650 [main] DEBUG org.hibernate.cfg.Configuration  - connection.password=xj600dec
    650 [main] DEBUG org.hibernate.cfg.Configuration  - connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver
    650 [main] DEBUG org.hibernate.cfg.Configuration  - dialect=org.hibernate.dialect.SQLServerDialect
    650 [main] DEBUG org.hibernate.cfg.Configuration  - null<-org.dom4j.tree.DefaultAttribute@121ab80 [Attribute: name resource value "com/ympulse/library/Book.hbm.xml"]
    665 [main] INFO org.hibernate.cfg.Configuration  - Mapping resource: com/ympulse/library/Book.hbm.xml
    665 [main] DEBUG org.hibernate.util.DTDEntityResolver  - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under org/hibernate/
    665 [main] DEBUG org.hibernate.util.DTDEntityResolver  - http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd not found in classpath
    21999 [main] ERROR org.hibernate.cfg.Configuration  - 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:484)
        at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
        at com.ympulse.library.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:48)
        at com.ympulse.library.LibraryTest.main(LibraryTest.java:37)
    Nested exception: 
    java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.<init>(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        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.XML11Configuration.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:465)
        at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
        at com.ympulse.library.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:48)
        at com.ympulse.library.LibraryTest.main(LibraryTest.java:37)
    %%%% Error Creating SessionFactory %%%%
    org.hibernate.MappingException: Error reading resource: com/ympulse/library/Book.hbm.xml
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:452)
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
        at com.ympulse.library.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:48)
        at com.ympulse.library.LibraryTest.main(LibraryTest.java:37)
    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:408)
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
        ... 7 more
    Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
        at org.dom4j.io.SAXReader.read(SAXReader.java:484)
        at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
        ... 8 more
    Exception in thread "main" java.lang.NullPointerException
        at com.ympulse.library.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:56)
        at com.ympulse.library.LibraryTest.main(LibraryTest.java:37)
    
    #241053 Reply

    Sorry – my config settings are: –

    
    *** Date: Tue Nov 08 18:00:33 CET 2005
    
    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_04
    
    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    
    Version: 4.0.3 GA
    Build id: 20051025-4.0.3-GA
    
    *** Eclipse details:
    Eclipse SDK
    
    Version: 3.1.1
    Build id: M20050929-0840
    
    Eclipse Platform
    
    Version: 3.1.1
    Build id: M20050929-0840
    
    Eclipse RCP
    
    Version: 3.1.1
    Build id: M20050929-0840
    
    Eclipse Java Development Tools
    
    Version: 3.1.1
    Build id: M20050929-0840
    
    Eclipse Plug-in Development Environment
    
    Version: 3.1.1
    Build id: M20050929-0840
    
    Eclipse Project SDK
    
    Version: 3.1.1
    Build id: M20050929-0840
    
    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\Program Files\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    2290_68
    -vm
    C:\Program Files\Java\jre1.5.0_04\bin\javaw.exe
    

    FYI the hibernate.cfg.xml file seems to be correct, just not written out to the .myhibernate file. An example may be useful so I can edit my version (if a fix is not obvious)

    Cheers

    #241404 Reply

    Riyad Kalla
    Member

    The problem is when you added Hibernate Capabilities, you didn’t specify 3.0, you left it at the default of 2.1. I would suggest creating a new project and re-adding Hibernate 3 capabilities to it, then moving the parts of your existing project youw ant to keep over to the new project. This may seem heavy handed but we don’t have a Remove HIbernate Capabilities feature yet, so intead of walking you through every step manually, I figured we’ll start with a new project.

    #241831 Reply

    You can close this one. <snip>

    Cheers chaps and bye for now.

    😳

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: [Closed] Hibernate 3.0 and Microsoft SQL

You must be logged in to post in the forum log in