Menu

#7 Could not obtain connection metadata

v2.0
closed
nobody
None
5
2012-09-28
2006-12-19
Anonymous
No

I try to use HA-JDBC with two MySQL DB's, the synchronisation failes with the following error:

It tries to quote a null value (PKTABLE_SCHEM) is null.

Caused by: java.lang.NullPointerException
at net.sf.hajdbc.cache.DatabaseMetaDataSupport.quote(DatabaseMetaDataSupport.java:345)
at net.sf.hajdbc.cache.DatabaseMetaDataSupport.getForeignKeyConstraints(DatabaseMetaDataSupport.java:230)
at net.sf.hajdbc.cache.EagerTableProperties.<init>(EagerTableProperties.java:49)
at net.sf.hajdbc.cache.EagerDatabaseProperties.<init>(EagerDatabaseProperties.java:63)
at net.sf.hajdbc.cache.EagerDatabaseMetaDataCache.flush(EagerDatabaseMetaDataCache.java:43)
at net.sf.hajdbc.local.LocalDatabaseCluster.flushMetaDataCache(LocalDatabaseCluster.java:700)
at net.sf.hajdbc.local.LocalDatabaseCluster.start(LocalDatabaseCluster.java:636)
at net.sf.hajdbc.distributable.DistributableDatabaseCluster.start(DistributableDatabaseCluster.java:163)

Discussion

  • Paul Ferraro

    Paul Ferraro - 2006-12-19

    Logged In: YES
    user_id=599784
    Originator: NO

    Fixed in svn.

     
  • Nobody/Anonymous

    Logged In: NO

    I can't build the SVN version:

    compile:
    [javac] Compiling 98 source files to C:\temp\ha-jdbc\trunk\build
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:292: cannot find symbol
    [javac] symbol : method exportConfig()
    [javac] location: class net.sf.hajdbc.DatabaseClusterFactory
    [javac] DatabaseClusterFactory.getInstance().exportConfig();
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:393: cannot find symbol
    [javac] symbol : method getSynchronizationStrategyMap()
    [javac] location: class net.sf.hajdbc.DatabaseClusterFactory
    [javac] return DatabaseClusterFactory.getInstance().getSynchronizationStrategyMap().keySet();
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:484: cannot find symbol
    [javac] symbol : method getSynchronizationStrategyMap()
    [javac] location: class net.sf.hajdbc.DatabaseClusterFactory
    [javac] SynchronizationStrategy strategy = DatabaseClusterFactory.getInstance().getSynchronizationStrategyMap().get(strategyId);
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:578: cannot find symbol
    [javac] symbol : method exportConfig()
    [javac] location: class net.sf.hajdbc.DatabaseClusterFactory
    [javac] DatabaseClusterFactory.getInstance().exportConfig();
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\sql\DataSourceFactory.java:68: cannot find symbol
    [javac] symbol : method getDatabaseClusterMap()
    [javac] location: class net.sf.hajdbc.DatabaseClusterFactory
    [javac] DatabaseCluster databaseCluster = DatabaseClusterFactory.getInstance().getDatabaseClusterMap().get(id);
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\sql\Driver.java:135: cannot find symbol
    [javac] symbol : method getDatabaseClusterMap()
    [javac] location: class net.sf.hajdbc.DatabaseClusterFactory
    [javac] DatabaseCluster cluster = DatabaseClusterFactory.getInstance().getDatabaseClusterMap().get(id);
    [javac] ^
    [javac] Note: * uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 6 errors

    BUILD FAILED
    C:\temp\ha-jdbc\trunk\build.xml:92: Compile failed; see the compiler error output for details.

     
  • Paul Ferraro

    Paul Ferraro - 2006-12-25

    Logged In: YES
    user_id=599784
    Originator: NO

    Sorry about that. SVN trunk should compile now, although the tests do not yet.
    Before using the svn trunk - be sure to read the change log.
    The ha-jdbc.xml dtd has changed. Expect a 1.2-beta-8 release soon.

     
  • Nobody/Anonymous

    Logged In: NO

    I checked it out today, still some errors:

    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:77: net.sf.hajdbc.local.LocalDatabaseCluster is not abstract
    does not override abstract method setStateManager(net.sf.hajdbc.StateManager) in net.sf.hajdbc.DatabaseCluster
    [javac] public class LocalDatabaseCluster implements DatabaseCluster
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:292: cannot find symbol
    [javac] symbol : method exportConfiguration()
    [javac] location: class net.sf.hajdbc.DatabaseClusterFactory
    [javac] DatabaseClusterFactory.getInstance().exportConfiguration();
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:342: incompatible types
    [javac] found : java.lang.Object
    [javac] required: net.sf.hajdbc.Database
    [javac] for (Database database: this.balancer.all())
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:357: incompatible types
    [javac] found : java.lang.Object
    [javac] required: net.sf.hajdbc.Database
    [javac] for (Database database: this.balancer.all())
    [javac] ^
    [javac] C:\temp\ha-jdbc\trunk\src\net\sf\hajdbc\local\LocalDatabaseCluster.java:578: cannot find symbol
    [javac] symbol : method exportConfiguration()
    [javac] location: class net.sf.hajdbc.DatabaseClusterFactory
    [javac] DatabaseClusterFactory.getInstance().exportConfiguration();
    [javac] ^
    [javac] Note: * uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 5 errors

     
  • Paul Ferraro

    Paul Ferraro - 2007-01-08

    Logged In: YES
    user_id=599784
    Originator: NO

    Please use the 1.2-beta-7 source release and patch the net.sf.hajdbc.cache.DatabaseMetaDataSupport class with the version from svn.
    The trunk is not stable (or even compilable) at the moment. I am re-architecting much of the core logic to support JDBC 4.0 (i.e. Java 1.6).

     
  • Nobody/Anonymous

    Logged In: NO

    I used the source from 1.2 beta 7 release and patched the DatabaseMetaDataSupport class from svn there is still an error. I need urgently a stable version!

    13:51:48,348 WARN [SettingsFactory] Could not obtain connection metadata
    net.sf.hajdbc.SQLException: java.util.NoSuchElementException
    at net.sf.hajdbc.distributable.DistributableDatabaseCluster.start(DistributableDatabaseCluster.java:167)
    at net.sf.hajdbc.DatabaseClusterFactory.addDatabaseCluster(DatabaseClusterFactory.java:335)
    at net.sf.hajdbc.DatabaseClusterFactory.JiBX_binding_unmarshal_1_0(DatabaseClusterFactory.java)
    at net.sf.hajdbc.JiBX_bindingDatabaseClusterFactory_access.unmarshal()
    at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unknown Source)
    at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unknown Source)
    at net.sf.hajdbc.DatabaseClusterFactory.createDatabaseClusterFactory(DatabaseClusterFactory.java:109)
    at net.sf.hajdbc.DatabaseClusterFactory.getInstance(DatabaseClusterFactory.java:83)
    at net.sf.hajdbc.sql.Driver.getDatabaseCluster(Driver.java:152)
    at net.sf.hajdbc.sql.Driver.connect(Driver.java:76)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:140)
    at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216)
    at ch.rbs.fagi.commons.utils.HibernateUtil.<clinit>(HibernateUtil.java:49)
    at ch.rbs.fagi.commons.utils.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:99)
    at ch.rbs.fagi.commons.utils.PersistenceManagerFactory.getPersistenceManager(PersistenceManagerFactory.java:21)
    at ch.rbs.fagi.gui.fahrplan.control.FahrplanController.<init>(FahrplanController.java:81)
    at ch.rbs.fagi.gui.fahrplan.FahrplanModul.<init>(FahrplanModul.java:39)
    at ch.rbs.fagi.gui.fahrplan.FahrplanModul$1.run(FahrplanModul.java:109)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.util.NoSuchElementException
    at java.util.HashMap$HashIterator.nextEntry(HashMap.java:844)
    at java.util.HashMap$KeyIterator.next(HashMap.java:877)
    at net.sf.hajdbc.balancer.AbstractBalancer.first(AbstractBalancer.java:84)
    at net.sf.hajdbc.balancer.LoadBalancer.next(LoadBalancer.java:73)
    at net.sf.hajdbc.local.LocalDatabaseCluster.flushMetaDataCache(LocalDatabaseCluster.java:694)
    at net.sf.hajdbc.local.LocalDatabaseCluster.start(LocalDatabaseCluster.java:636)
    at net.sf.hajdbc.distributable.DistributableDatabaseCluster.start(DistributableDatabaseCluster.java:163)
    ... 22 more

     
  • Paul Ferraro

    Paul Ferraro - 2007-01-09

    Logged In: YES
    user_id=599784
    Originator: NO

    This exception due to an empty local cluster state. To use the "eager" meta data cache, you must have at least 1 database active in your cluster. Prior errors during restart are probably the cause of your empty state. Following the instructions here to reset it:
    http://ha-jdbc.sourceforge.net/faq.html#faq-N100DB

    Please remember that 1.2 is still in beta, and does not claim to be stable until its final release.
    If you need a stable version, please use the latest 1.1 release.

     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Anonymous
Anonymous

Add attachments
Cancel