java.lang.UnsupportedOperationException: The application must supply JDBC connections

Stack Overflow | Dheeraj Joshi | 10 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Getting The application must supply JDBC connections exception

    Stack Overflow | 10 months ago | Dheeraj Joshi
    java.lang.UnsupportedOperationException: The application must supply JDBC connections
  2. 0

    Hibernate 5.0.6 Configuration Exception : The application must supply JDBC connections

    Stack Overflow | 1 year ago | GajanaN Chalke
    java.lang.UnsupportedOperationException: The application must supply JDBC connections
  3. 0

    Problema com JPA/Hibernate. Erro The application must supply JDBC connections. - Javafree: O fórum de Java que mais cresce

    com.br | 1 year ago
    java.lang.UnsupportedOperationException: The application must supply JDBC connections
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When starting a session with an empty hibernate config ([test project|https://github.com/rzymek/hibernate-minimal-project]): {code:java} final StandardServiceRegistry registry = new StandardServiceRegistryBuilder() .build(); SessionFactory sessionFactory = new MetadataSources(registry) .buildMetadata() .buildSessionFactory(); try (Session session = sessionFactory.openSession()) { session.beginTransaction(); session.getTransaction().commit(); } {code} The error that gets propagated to the user contains a cryptic message about a missing dialect: {noformat} Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100) at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88) at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259) ... 18 more {noformat} [(Complete output)|https://github.com/rzymek/hibernate-minimal-project/blob/5.2.8/output.txt] A more appropriate error should inform about the main issue here - no available connection. I propose to change the dialect detection procedure to return a default dialect (aka `new Dialect() {}`) on failure and moving on. The exception that gets propagated to the user becomes: {noformat} Exception in thread "main" java.lang.UnsupportedOperationException: The application must supply JDBC connections at org.hibernate.engine.jdbc.connections.internal.UserSuppliedConnectionProviderImpl.getConnection(UserSuppliedConnectionProviderImpl.java:44) at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:35) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:99) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:129) .... {noformat} [(Complete output)|https://github.com/rzymek/hibernate-minimal-project/blob/master/output.txt] _Instead of returning an anonymous instance of Dialect, a new `DefaultDialect` class might be a better choice._

    Hibernate JIRA | 3 months ago | Krzysztof Rzymkowski
    java.lang.UnsupportedOperationException: The application must supply JDBC connections
  6. 0

    how to setup the hibernate from file.properties on spring properly?

    Stack Overflow | 2 years ago | Cristian Chaparro A.
    java.lang.UnsupportedOperationException: The application must supply JDBC connections

    4 unregistered visitors
    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.lang.UnsupportedOperationException

      The application must supply JDBC connections

      at org.hibernate.engine.jdbc.connections.internal.UserSuppliedConnectionProviderImpl.getConnection()
    2. org.hibernate.engine
      UserSuppliedConnectionProviderImpl.getConnection
      1. org.hibernate.engine.jdbc.connections.internal.UserSuppliedConnectionProviderImpl.getConnection(UserSuppliedConnectionProviderImpl.java:44)
      1 frame
    3. Hibernate
      AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection
      1. org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:386)
      1 frame
    4. org.hibernate.resource
      LogicalConnectionManagedImpl.acquireConnectionIfNeeded
      1. org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:84)
      1 frame