java.sql.SQLException: Cannot open database requested by the login. The login failed.

QOS.ch JIRA | Paul Krause | 2 years ago
  1. 0

    Users - Using DBAppender with an unreliable database connection

    nabble.com | 11 months ago
    java.sql.SQLException: Cannot open database requested by the login. The login failed.
  2. 0

    We have configured DBAppender to log to a SQL Server database from a Spring webapp under Tomcat using ch.qos.logback.core.db.DataSourceConnectionSource. This works fine, except that when the host reboots (this is Windows, after all), Tomcat restarts faster than SQL Server does, so when DataSourceConnectionSource is first started, it fails to connect to the database. There should be a way to detect this and retry the connection., Alternately, there should be a way for the application to check DBAppender's state and tell it to reconnect if needed. 12:11:11,593 |-WARN in ch.qos.logback.core.db.DataSourceConnectionSource@134c00a9 - Could not discover the dialect to use. java.sql.SQLException: Cannot open database requested by the login. The login failed. at java.sql.SQLException: Cannot open database requested by the login. The login failed. at at ch.qos.logback.core.db.DataSourceConnectionSource.getConnection(DataSourceConnectionSource.java:63) at at ch.qos.logback.core.db.ConnectionSourceBase.discoverConnectionProperties(ConnectionSourceBase.java:48) at at ch.qos.logback.core.db.DataSourceConnectionSource.start(DataSourceConnectionSource.java:44) at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:167) at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182) at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49) at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150) at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85) at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55) at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129) at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108) at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276) at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156) at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132) at at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:274) at at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:282)

    QOS.ch JIRA | 2 years ago | Paul Krause
    java.sql.SQLException: Cannot open database requested by the login. The login failed.
  3. 0

    We have configured DBAppender to log to a SQL Server database from a Spring webapp under Tomcat using ch.qos.logback.core.db.DataSourceConnectionSource. This works fine, except that when the host reboots (this is Windows, after all), Tomcat restarts faster than SQL Server does, so when DataSourceConnectionSource is first started, it fails to connect to the database. There should be a way to detect this and retry the connection., Alternately, there should be a way for the application to check DBAppender's state and tell it to reconnect if needed. 12:11:11,593 |-WARN in ch.qos.logback.core.db.DataSourceConnectionSource@134c00a9 - Could not discover the dialect to use. java.sql.SQLException: Cannot open database requested by the login. The login failed. at java.sql.SQLException: Cannot open database requested by the login. The login failed. at at ch.qos.logback.core.db.DataSourceConnectionSource.getConnection(DataSourceConnectionSource.java:63) at at ch.qos.logback.core.db.ConnectionSourceBase.discoverConnectionProperties(ConnectionSourceBase.java:48) at at ch.qos.logback.core.db.DataSourceConnectionSource.start(DataSourceConnectionSource.java:44) at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:167) at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182) at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49) at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150) at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85) at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55) at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129) at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108) at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276) at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156) at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132) at at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:274) at at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:282)

    QOS.ch JIRA | 2 years ago | Paul Krause
    java.sql.SQLException: Cannot open database requested by the login. The login failed.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    prototype-standalone.war 独立运行出错

    GitHub | 2 years ago | flanliulf
    java.sql.SQLException: NamingException while looking up DataSource: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
  6. 0

    MyBatis Migrations should support property evaluation in environment properties files.

    GitHub | 2 years ago | GoogleCodeExporter
    org.apache.ibatis.migration.MigrationException: Could not create SqlRunner. Cause: java.sql.SQLException: Cannot open database "mydb_${database}" requested by the login. The login failed.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      Cannot open database requested by the login. The login failed.

      at ch.qos.logback.core.db.DataSourceConnectionSource.getConnection()
    2. Logback Core Module
      GenericConfigurator.doConfigure
      1. ch.qos.logback.core.db.DataSourceConnectionSource.getConnection(DataSourceConnectionSource.java:63)
      2. ch.qos.logback.core.db.ConnectionSourceBase.discoverConnectionProperties(ConnectionSourceBase.java:48)
      3. ch.qos.logback.core.db.DataSourceConnectionSource.start(DataSourceConnectionSource.java:44)
      4. ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:167)
      5. ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
      6. ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
      7. ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
      8. ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
      9. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
      10. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
      11. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
      12. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
      12 frames
    3. Logback Classic Module
      ContextInitializer.autoConfig
      1. ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
      2. ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
      2 frames
    4. SLF4J LOG4J-12 Binding
      StaticLoggerBinder.<clinit>
      1. org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
      2. org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
      2 frames
    5. SLF4J API Module
      LoggerFactory.getLogger
      1. org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
      2. org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
      3. org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
      4. org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
      4 frames
    6. Apache Commons Logging
      LogFactory.getLog
      1. org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
      2. org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
      3. org.apache.commons.logging.LogFactory.getLog(LogFactory.java:274)
      3 frames
    7. Spring
      ContextLoader.initWebApplicationContext
      1. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:282)
      1 frame