Einzelnen Beitrag anzeigen

BörmtDieBuse

Registriert seit: 25. Mär 2015
26 Beiträge
 
#9

AW: Hibernate und DAO und Reports

  Alt 7. Mai 2015, 13:35

Code:
} catch (Exception e) {
        System.out.println("Fehler beim erstellen der SessionFactory");
    }
Da sollte auch der Stacktrace ausgegegeben werden.

Code:
e.printStackTrace();
Du hast vollkommen recht, das kommt für printStackTrace raus.
Code:
org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
   at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:132)
   at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator$1$1.convert(BasicConnectionCreator.java:118)
   at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.convertSqlException(BasicConnectionCreator.java:140)
   at org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:58)
   at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.createConnection(BasicConnectionCreator.java:75)
   at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:106)
   at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
   at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
   at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
   at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260)
   at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94)
   at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
   at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
   at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
   at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930)
   at hibernate.HibernateTest.main(HibernateTest.java:23)
Caused by: java.sql.SQLRecoverableException: I/O-Fehler: Invalid connection string format, a valid format is: "host:port:sid"
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
   at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
   at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
   at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
   at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
   at org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:55)
   ... 14 more
Caused by: oracle.net.ns.NetException: Invalid connection string format, a valid format is: "host:port:sid"
   at oracle.net.resolver.AddrResolution.resolveSimple(AddrResolution.java:504)
   at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:437)
   at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:693)
   at oracle.net.ns.NSProtocol.connect(NSProtocol.java:251)
   at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
   ... 19 more
ich hab nochmal mein "host:port:sid" überprüft, hab exakt das rauskopiert, was auch im Oracle SQL Developer drin steht.
kann es vllt sein das er nicht erkennt, welche DB er ansprechen soll? ich hab 2 drin, einmal namens "Test" und einmal "Umweltlabor".
  Mit Zitat antworten Zitat