daily pastebin goal
47%
SHARE
TWEET

Untitled

a guest May 16th, 2018 132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Exception in thread "main" org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
  2.    
  3. "C:Program FilesJavajdk1.8.0_162binjava.exe" "-javaagent:C:Program FilesJetBrainsIntelliJ IDEA 2018.1.3libidea_rt.jar=63481:C:Program FilesJetBrainsIntelliJ IDEA 2018.1.3bin" -Dfile.encoding=UTF-8 -classpath "C:Program FilesJavajdk1.8.0_162jrelibcharsets.jar;C:Program FilesJavajdk1.8.0_162jrelibdeploy.jar;C:Program FilesJavajdk1.8.0_162jrelibextaccess-bridge-64.jar;C:Program FilesJavajdk1.8.0_162jrelibextcldrdata.jar;C:Program FilesJavajdk1.8.0_162jrelibextdnsns.jar;C:Program FilesJavajdk1.8.0_162jrelibextjaccess.jar;C:Program FilesJavajdk1.8.0_162jrelibextjfxrt.jar;C:Program FilesJavajdk1.8.0_162jrelibextlocaledata.jar;C:Program FilesJavajdk1.8.0_162jrelibextnashorn.jar;C:Program FilesJavajdk1.8.0_162jrelibextsunec.jar;C:Program FilesJavajdk1.8.0_162jrelibextsunjce_provider.jar;C:Program FilesJavajdk1.8.0_162jrelibextsunmscapi.jar;C:Program FilesJavajdk1.8.0_162jrelibextsunpkcs11.jar;C:Program FilesJavajdk1.8.0_162jrelibextzipfs.jar;C:Program FilesJavajdk1.8.0_162jrelibjavaws.jar;C:Program FilesJavajdk1.8.0_162jrelibjce.jar;C:Program FilesJavajdk1.8.0_162jrelibjfr.jar;C:Program FilesJavajdk1.8.0_162jrelibjfxswt.jar;C:Program FilesJavajdk1.8.0_162jrelibjsse.jar;C:Program FilesJavajdk1.8.0_162jrelibmanagement-agent.jar;C:Program FilesJavajdk1.8.0_162jrelibplugin.jar;C:Program FilesJavajdk1.8.0_162jrelibresources.jar;C:Program FilesJavajdk1.8.0_162jrelibrt.jar;C:UsersMarkIdeaProjectsSpringuntitled3targetclasses;C:UsersMarkIdeaProjectsSpringuntitled3libclassmate-1.3.0.jar;C:UsersMarkIdeaProjectsSpringuntitled3libhibernate-commons-annotations-5.0.1.Final.jar;C:UsersMarkIdeaProjectsSpringuntitled3libdom4j-1.6.1.jar;C:UsersMarkIdeaProjectsSpringuntitled3libantlr-2.7.7.jar;C:UsersMarkIdeaProjectsSpringuntitled3libhibernate-jpa-2.1-api-1.0.0.Final.jar;C:UsersMarkIdeaProjectsSpringuntitled3libjandex-2.0.3.Final.jar;C:UsersMarkIdeaProjectsSpringuntitled3libjboss-logging-3.3.1.Final.jar;C:UsersMarkIdeaProjectsSpringuntitled3libjboss-transaction-api_1.2_spec-1.0.1.Final.jar;C:UsersMarkIdeaProjectsSpringuntitled3libjavassist-3.22.0-GA.jar;C:UsersMarkIdeaProjectsSpringuntitled3libhibernate-core-5.2.16.Final.jar;C:UsersMark.m2repositorymysqlmysql-connector-java5.1.6mysql-connector-java-5.1.6.jar;C:UsersMark.m2repositoryjavaxxmlbindjaxb-api2.2.11jaxb-api-2.2.11.jar;C:UsersMark.m2repositorycomsunxmlbindjaxb-core2.2.11jaxb-core-2.2.11.jar;C:UsersMark.m2repositorycomsunxmlbindjaxb-impl2.2.11jaxb-impl-2.2.11.jar;C:UsersMark.m2repositoryorghibernatehibernate-core5.3.0.Finalhibernate-core-5.3.0.Final.jar;C:UsersMark.m2repositoryorgjbossloggingjboss-logging3.3.2.Finaljboss-logging-3.3.2.Final.jar;C:UsersMark.m2repositoryjavaxpersistencejavax.persistence-api2.2javax.persistence-api-2.2.jar;C:UsersMark.m2repositoryorgjavassistjavassist3.22.0-GAjavassist-3.22.0-GA.jar;C:UsersMark.m2repositorynetbytebuddybyte-buddy1.8.0byte-buddy-1.8.0.jar;C:UsersMark.m2repositoryantlrantlr2.7.7antlr-2.7.7.jar;C:UsersMark.m2repositoryorgjbossspecjavaxtransactionjboss-transaction-api_1.2_spec1.0.1.Finaljboss-transaction-api_1.2_spec-1.0.1.Final.jar;C:UsersMark.m2repositoryorgjbossjandex2.0.3.Finaljandex-2.0.3.Final.jar;C:UsersMark.m2repositorycomfasterxmlclassmate1.3.0classmate-1.3.0.jar;C:UsersMark.m2repositorydom4jdom4j1.6.1dom4j-1.6.1.jar;C:UsersMark.m2repositoryorghibernatecommonhibernate-commons-annotations5.0.3.Finalhibernate-commons-annotations-5.0.3.Final.jar" Main
  4. máj 17, 2018 12:07:38 AM org.hibernate.Version logVersion
  5. INFO: HHH000412: Hibernate Core {5.2.16.Final}
  6. máj 17, 2018 12:07:38 AM org.hibernate.cfg.Environment <clinit>
  7. INFO: HHH000206: hibernate.properties not found
  8. máj 17, 2018 12:07:39 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
  9. INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
  10. máj 17, 2018 12:07:39 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  11. WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
  12. máj 17, 2018 12:07:39 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  13. INFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/hb_student_tracker?useSSL=false]
  14. máj 17, 2018 12:07:39 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  15. INFO: HHH10001001: Connection properties: {user=hbstudent, password=****}
  16. máj 17, 2018 12:07:39 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  17. INFO: HHH10001003: Autocommit mode: false
  18. máj 17, 2018 12:07:39 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init>
  19. INFO: HHH000115: Hibernate connection pool size: 3 (min=1)
  20. Exception in thread "main" org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
  21.     at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:271)
  22.     at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233)
  23.     at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
  24.     at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
  25.     at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
  26.     at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:242)
  27.     at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
  28.     at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352)
  29.     at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111)
  30.     at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83)
  31.     at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418)
  32.     at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87)
  33.     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:691)
  34.     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726)
  35.     at Main.main(Main.java:13)
  36. Caused by: org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
  37.     at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:115)
  38.     at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator$1$1.convert(BasicConnectionCreator.java:101)
  39.     at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.convertSqlException(BasicConnectionCreator.java:123)
  40.     at org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:41)
  41.     at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.createConnection(BasicConnectionCreator.java:58)
  42.     at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections.addConnections(DriverManagerConnectionProviderImpl.java:363)
  43.     at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections.<init>(DriverManagerConnectionProviderImpl.java:282)
  44.     at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections.<init>(DriverManagerConnectionProviderImpl.java:260)
  45.     at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections$Builder.build(DriverManagerConnectionProviderImpl.java:401)
  46.     at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.buildPool(DriverManagerConnectionProviderImpl.java:112)
  47.     at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:75)
  48.     at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
  49.     at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:242)
  50.     at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
  51.     at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145)
  52.     at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66)
  53.     at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
  54.     at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
  55.     at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259)
  56.     ... 14 more
  57. Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client
  58.     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  59.     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  60.     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  61.     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  62.     at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
  63.     at com.mysql.jdbc.Util.getInstance(Util.java:381)
  64.     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
  65.     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
  66.     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
  67.     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
  68.     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:910)
  69.     at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3923)
  70.     at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1273)
  71.     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2031)
  72.     at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
  73.     at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
  74.     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  75.     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  76.     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  77.     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  78.     at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
  79.     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
  80.     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
  81.     at org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:38)
  82.     ... 29 more
  83.  
  84. Process finished with exit code 1
  85.    
  86. <?xml version="1.0" encoding="UTF-8"?>
  87. <project xmlns="http://maven.apache.org/POM/4.0.0"
  88.          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  89.          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  90.     <modelVersion>4.0.0</modelVersion>
  91.  
  92.     <groupId>groupId</groupId>
  93.     <artifactId>untitled3</artifactId>
  94.     <version>1.0-SNAPSHOT</version>
  95.  
  96.     <dependencies>
  97.         <dependency>
  98.             <groupId>mysql</groupId>
  99.             <artifactId>mysql-connector-java</artifactId>
  100.             <version>5.1.6</version>
  101.         </dependency>
  102.  
  103.         <dependency>
  104.             <groupId>javax.xml.bind</groupId>
  105.             <artifactId>jaxb-api</artifactId>
  106.             <version>2.2.11</version>
  107.         </dependency>
  108.         <dependency>
  109.             <groupId>com.sun.xml.bind</groupId>
  110.             <artifactId>jaxb-core</artifactId>
  111.             <version>2.2.11</version>
  112.         </dependency>
  113.         <dependency>
  114.             <groupId>com.sun.xml.bind</groupId>
  115.             <artifactId>jaxb-impl</artifactId>
  116.             <version>2.2.11</version>
  117.         </dependency>
  118.  
  119.         <dependency>
  120.             <groupId>org.hibernate</groupId>
  121.             <artifactId>hibernate-core</artifactId>
  122.             <version>5.3.0.Final</version>
  123.         </dependency>
  124.     </dependencies>
  125. </project>
  126.    
  127. import org.hibernate.SessionFactory;
  128. import org.hibernate.cfg.Configuration;
  129. import test.Student;
  130.  
  131. public class Main {
  132.  
  133.     public static void main(String[] args) {
  134.  
  135.         SessionFactory factory = new Configuration()
  136.                 .configure()
  137.                 .addAnnotatedClass(Student.class)
  138.                 .buildSessionFactory();
  139.     }
  140. }
  141.    
  142. package test;
  143.  
  144. import javax.persistence.Column;
  145. import javax.persistence.Entity;
  146. import javax.persistence.Id;
  147. import javax.persistence.Table;
  148.  
  149.  
  150. @Entity
  151. @Table(name = "student")
  152. public class Student {
  153.  
  154.     @Id
  155.     @Column(name = "id")
  156.     private int id;
  157.  
  158.     @Column(name = "first_name")
  159.     private String firstName;
  160.  
  161.     @Column(name = "last_name")
  162.     private String lastName;
  163.  
  164.     @Column(name = "email")
  165.     private String email;
  166.  
  167.     public Student() {
  168.     }
  169.  
  170.  
  171.     public Student(String firstName, String lastName, String email) {
  172.         this.firstName = firstName;
  173.         this.lastName = lastName;
  174.         this.email = email;
  175.     }
  176.  
  177.     public int getId() {
  178.         return id;
  179.     }
  180.  
  181.     public void setId(int id) {
  182.         this.id = id;
  183.     }
  184.  
  185.     public String getFirstName() {
  186.         return firstName;
  187.     }
  188.  
  189.     public void setFirstName(String firstName) {
  190.         this.firstName = firstName;
  191.     }
  192.  
  193.     public String getLastName() {
  194.         return lastName;
  195.     }
  196.  
  197.     public void setLastName(String lastName) {
  198.         this.lastName = lastName;
  199.     }
  200.  
  201.     public String getEmail() {
  202.         return email;
  203.     }
  204.  
  205.     public void setEmail(String email) {
  206.         this.email = email;
  207.     }
  208.  
  209.     @Override
  210.     public String toString() {
  211.         return "Student{" +
  212.                 "id=" + id +
  213.                 ", firstName='" + firstName + ''' +
  214.                 ", lastName='" + lastName + ''' +
  215.                 ", email='" + email + ''' +
  216.                 '}';
  217.     }
  218. }
  219.    
  220. <!DOCTYPE hibernate-configuration PUBLIC
  221.         "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  222.         "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  223.  
  224. <hibernate-configuration>
  225.  
  226.     <session-factory>
  227.  
  228.         <!-- JDBC Database connection settings -->
  229.         <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  230.         <property name="connection.url">jdbc:mysql://localhost:3306/hb_student_tracker?useSSL=false</property>
  231.         <property name="connection.username">hbstudent</property>
  232.         <property name="connection.password">hbstudent</property>
  233.  
  234.         <!-- JDBC connection pool settings ... using built-in test pool -->
  235.         <property name="connection.pool_size">1</property>
  236.  
  237.         <!-- Select our SQL dialect -->
  238.         <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
  239.  
  240.         <!-- Echo the SQL to stdout -->
  241.         <property name="show_sql">true</property>
  242.  
  243.         <!-- Set the current session context -->
  244.         <property name="current_session_context_class">thread</property>
  245.  
  246.  
  247.     </session-factory>
  248.  
  249. </hibernate-configuration>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top