Spring Boot - API - polaczenie z baza danych

Odpowiedz Nowy wątek
2019-09-08 15:44
0

Cześć.

Zacząłem bawić z się z własną aplikacja REST-API.
Jakieś początkowe poradniki - wszystko poziom podstawowy. Ale problemy zaczęły się gdy chciałem podłączyć moją aplikacje do bazy danych z własnym hostingiem więc znalazłem jakiś darmowy na szybko ale tutaj napotkałem na ścianę.
Za pomocą application.properties i funkcji chciałem podłączyć się ale wywala mi błędy.

spring.datasource.url=jdbc:mysql://remotemysql.com:3306
spring.datasource.username=IEci8d0gZc
spring.datasource.password=QRnrC7cYRr
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

Poniżej zamieszczam moje dane do bazy (nie ma żadnej wartości bo nie ma tam teoretycznie nic poza jedną tabelą).

Username: IEci8d0gZc

Database name: IEci8d0gZc

Password: QRnrC7cYRr

Server: remotemysql.com

Port: 3306

Gdy odpalam apke to dostaje błędy, których nie potrafię ogarnąć co może być nie tak.

Dodam jeszcze, że w bazie danych jest jedna tabela, która zawiera wszystkie dane takie jak id, imie, nazwisko itd, których używam w aplikacji RESTowej.

Poniżej zamieszczam kod błędów, które dostaje po odpaleniu aplikacji:

"C:\Program Files\Java\jdk1.8.0_161\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.1\lib\idea_rt.jar=56173:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_161\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\rt.jar;C:\Users\Szymon\Desktop\restApi\target\classes;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-data-jpa\2.2.0.M5\spring-boot-starter-data-jpa-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-aop\2.2.0.M5\spring-boot-starter-aop-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-aop\5.2.0.RC1\spring-aop-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\aspectj\aspectjweaver\1.9.4\aspectjweaver-1.9.4.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\2.2.0.M5\spring-boot-starter-jdbc-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\com\zaxxer\HikariCP\3.3.1\HikariCP-3.3.1.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-jdbc\5.2.0.RC1\spring-jdbc-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\jakarta\activation\jakarta.activation-api\1.2.1\jakarta.activation-api-1.2.1.jar;C:\Users\Szymon\.m2\repository\jakarta\persistence\jakarta.persistence-api\2.2.2\jakarta.persistence-api-2.2.2.jar;C:\Users\Szymon\.m2\repository\jakarta\transaction\jakarta.transaction-api\1.3.2\jakarta.transaction-api-1.3.2.jar;C:\Users\Szymon\.m2\repository\org\hibernate\hibernate-core\5.4.4.Final\hibernate-core-5.4.4.Final.jar;C:\Users\Szymon\.m2\repository\org\jboss\logging\jboss-logging\3.4.0.Final\jboss-logging-3.4.0.Final.jar;C:\Users\Szymon\.m2\repository\org\javassist\javassist\3.24.0-GA\javassist-3.24.0-GA.jar;C:\Users\Szymon\.m2\repository\net\bytebuddy\byte-buddy\1.10.0\byte-buddy-1.10.0.jar;C:\Users\Szymon\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;C:\Users\Szymon\.m2\repository\org\jboss\jandex\2.0.5.Final\jandex-2.0.5.Final.jar;C:\Users\Szymon\.m2\repository\com\fasterxml\classmate\1.5.0\classmate-1.5.0.jar;C:\Users\Szymon\.m2\repository\org\dom4j\dom4j\2.1.1\dom4j-2.1.1.jar;C:\Users\Szymon\.m2\repository\org\hibernate\common\hibernate-commons-annotations\5.1.0.Final\hibernate-commons-annotations-5.1.0.Final.jar;C:\Users\Szymon\.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar;C:\Users\Szymon\.m2\repository\org\glassfish\jaxb\txw2\2.3.2\txw2-2.3.2.jar;C:\Users\Szymon\.m2\repository\com\sun\istack\istack-commons-runtime\3.0.8\istack-commons-runtime-3.0.8.jar;C:\Users\Szymon\.m2\repository\org\jvnet\staxex\stax-ex\1.8.1\stax-ex-1.8.1.jar;C:\Users\Szymon\.m2\repository\com\sun\xml\fastinfoset\FastInfoset\1.2.16\FastInfoset-1.2.16.jar;C:\Users\Szymon\.m2\repository\org\springframework\data\spring-data-jpa\2.2.0.RC2\spring-data-jpa-2.2.0.RC2.jar;C:\Users\Szymon\.m2\repository\org\springframework\data\spring-data-commons\2.2.0.RC2\spring-data-commons-2.2.0.RC2.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-orm\5.2.0.RC1\spring-orm-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-context\5.2.0.RC1\spring-context-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-tx\5.2.0.RC1\spring-tx-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-beans\5.2.0.RC1\spring-beans-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-aspects\5.2.0.RC1\spring-aspects-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.2.0.M5\spring-boot-starter-web-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter\2.2.0.M5\spring-boot-starter-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.2.0.M5\spring-boot-starter-logging-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\Szymon\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\Szymon\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.12.0\log4j-to-slf4j-2.12.0.jar;C:\Users\Szymon\.m2\repository\org\apache\logging\log4j\log4j-api\2.12.0\log4j-api-2.12.0.jar;C:\Users\Szymon\.m2\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;C:\Users\Szymon\.m2\repository\jakarta\annotation\jakarta.annotation-api\1.3.4\jakarta.annotation-api-1.3.4.jar;C:\Users\Szymon\.m2\repository\org\yaml\snakeyaml\1.24\snakeyaml-1.24.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.2.0.M5\spring-boot-starter-json-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;C:\Users\Szymon\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\Szymon\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;C:\Users\Szymon\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;C:\Users\Szymon\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;C:\Users\Szymon\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.2.0.M5\spring-boot-starter-tomcat-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.22\tomcat-embed-core-9.0.22.jar;C:\Users\Szymon\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.22\tomcat-embed-el-9.0.22.jar;C:\Users\Szymon\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.22\tomcat-embed-websocket-9.0.22.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-validation\2.2.0.M5\spring-boot-starter-validation-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\jakarta\validation\jakarta.validation-api\2.0.1\jakarta.validation-api-2.0.1.jar;C:\Users\Szymon\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-web\5.2.0.RC1\spring-web-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-webmvc\5.2.0.RC1\spring-webmvc-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-expression\5.2.0.RC1\spring-expression-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-devtools\2.2.0.M5\spring-boot-devtools-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot\2.2.0.M5\spring-boot-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.2.0.M5\spring-boot-autoconfigure-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-starter-actuator\2.2.0.M5\spring-boot-starter-actuator-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-actuator-autoconfigure\2.2.0.M5\spring-boot-actuator-autoconfigure-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\org\springframework\boot\spring-boot-actuator\2.2.0.M5\spring-boot-actuator-2.2.0.M5.jar;C:\Users\Szymon\.m2\repository\io\micrometer\micrometer-core\1.2.0\micrometer-core-1.2.0.jar;C:\Users\Szymon\.m2\repository\org\hdrhistogram\HdrHistogram\2.1.11\HdrHistogram-2.1.11.jar;C:\Users\Szymon\.m2\repository\org\latencyutils\LatencyUtils\2.0.3\LatencyUtils-2.0.3.jar;C:\Users\Szymon\.m2\repository\com\h2database\h2\1.4.199\h2-1.4.199.jar;C:\Users\Szymon\.m2\repository\mysql\mysql-connector-java\8.0.17\mysql-connector-java-8.0.17.jar;C:\Users\Szymon\.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.2\jakarta.xml.bind-api-2.3.2.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-core\5.2.0.RC1\spring-core-5.2.0.RC1.jar;C:\Users\Szymon\.m2\repository\org\springframework\spring-jcl\5.2.0.RC1\spring-jcl-5.2.0.RC1.jar" com.myOwnApi.restApi.RestApiApplication

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::             (v2.2.0.M5)

2019-09-08 15:33:43.046  INFO 13680 --- [  restartedMain] com.myOwnApi.restApi.RestApiApplication  : Starting RestApiApplication on LAPTOP-60UL2001 with PID 13680 (C:\Users\Szymon\Desktop\restApi\target\classes started by Szymon in C:\Users\Szymon\Desktop\restApi)
2019-09-08 15:33:43.049  INFO 13680 --- [  restartedMain] com.myOwnApi.restApi.RestApiApplication  : No active profile set, falling back to default profiles: default
2019-09-08 15:33:43.141  INFO 13680 --- [  restartedMain] o.s.b.devtools.restart.ChangeableUrls    : The Class-Path manifest attribute in C:\Users\Szymon\.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar referenced one or more files that do not exist: file:/C:/Users/Szymon/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.xml.bind-api-2.3.2.jar,file:/C:/Users/Szymon/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/txw2-2.3.2.jar,file:/C:/Users/Szymon/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/istack-commons-runtime-3.0.8.jar,file:/C:/Users/Szymon/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/stax-ex-1.8.1.jar,file:/C:/Users/Szymon/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/FastInfoset-1.2.16.jar,file:/C:/Users/Szymon/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.activation-api-1.2.1.jar
2019-09-08 15:33:43.141  INFO 13680 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-09-08 15:33:43.141  INFO 13680 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-09-08 15:33:44.486  INFO 13680 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-09-08 15:33:44.550  INFO 13680 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 54ms. Found 1 repository interfaces.
2019-09-08 15:33:44.874  INFO 13680 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-09-08 15:33:45.465  INFO 13680 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-09-08 15:33:45.479  INFO 13680 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-09-08 15:33:45.480  INFO 13680 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.22]
2019-09-08 15:33:45.627  INFO 13680 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-09-08 15:33:45.627  INFO 13680 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2486 ms
2019-09-08 15:33:45.788  INFO 13680 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-09-08 15:33:46.916  INFO 13680 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2019-09-08 15:33:46.920  INFO 13680 --- [  restartedMain] o.s.b.a.h2.H2ConsoleAutoConfiguration    : H2 console available at '/h2-console'. Database available at 'jdbc:mysql://remotemysql.com:3306'
2019-09-08 15:33:47.157  INFO 13680 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2019-09-08 15:33:47.239  INFO 13680 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate Core {5.4.4.Final}
2019-09-08 15:33:47.404  INFO 13680 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2019-09-08 15:33:47.551  INFO 13680 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2019-09-08 15:33:47.996  INFO 13680 --- [  restartedMain] org.hibernate.tuple.PojoInstantiator     : HHH000182: No default (no-argument) constructor for class: com.myOwnApi.restApi.dao.Entity.Osoba (class must be instantiated by Interceptor)
2019-09-08 15:33:48.339  INFO 13680 --- [  restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2019-09-08 15:33:48.341  INFO 13680 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-09-08 15:33:48.759  WARN 13680 --- [  restartedMain] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2019-09-08 15:33:48.918  INFO 13680 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-09-08 15:33:49.258  INFO 13680 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2019-09-08 15:33:49.266  INFO 13680 --- [  restartedMain] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2019-09-08 15:33:49.510  INFO 13680 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2019-09-08 15:33:49.511  INFO 13680 --- [  restartedMain] com.myOwnApi.restApi.RestApiApplication  : Started RestApiApplication in 6.956 seconds (JVM running for 7.764)
2019-09-08 15:33:49.829  WARN 13680 --- [  restartedMain] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 1046, SQLState: 3D000
2019-09-08 15:33:49.829 ERROR 13680 --- [  restartedMain] o.h.engine.jdbc.spi.SqlExceptionHelper   : No database selected
2019-09-08 15:33:49.835  INFO 13680 --- [  restartedMain] o.h.e.internal.DefaultLoadEventListener  : HHH000327: Error performing load command : org.hibernate.exception.GenericJDBCException: could not extract ResultSet

org.hibernate.exception.GenericJDBCException: could not extract ResultSet
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:69) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.getResultSet(Loader.java:2287) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2045) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2007) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.doQuery(Loader.java:953) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:324) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.loadEntity(Loader.java:2401) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:64) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:54) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4312) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:570) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:538) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:208) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:333) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:108) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:74) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.fireLoadNoChecks(SessionImpl.java:1298) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1286) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.access$2100(SessionImpl.java:203) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2945) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.lambda$load$1(SessionImpl.java:2926) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.perform(SessionImpl.java:2882) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2926) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.get(SessionImpl.java:1086) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:306) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:172) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:70) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:889) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:875) [hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:313) ~[spring-orm-5.2.0.RC1.jar:5.2.0.RC1]
    at com.sun.proxy.$Proxy106.merge(Unknown Source) ~[na:na]
    at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:557) ~[spring-data-jpa-2.2.0.RC2.jar:2.2.0.RC2]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:345) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178) ~[spring-data-jpa-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at com.sun.proxy.$Proxy111.save(Unknown Source) ~[na:na]
    at com.myOwnApi.restApi.manager.OsobaManager.save(OsobaManager.java:30) ~[classes/:na]
    at com.myOwnApi.restApi.manager.OsobaManager.fillDb(OsobaManager.java:39) ~[classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:300) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:190) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:153) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.boot.context.event.EventPublishingRunListener.running(EventPublishingRunListener.java:103) ~[spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at org.springframework.boot.SpringApplicationRunListeners.running(SpringApplicationRunListeners.java:77) ~[spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) ~[spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1225) ~[spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214) ~[spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at com.myOwnApi.restApi.RestApiApplication.main(RestApiApplication.java:10) ~[classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.2.0.M5.jar:2.2.0.M5]
Caused by: java.sql.SQLException: No database selected
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-3.3.1.jar:na]
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-3.3.1.jar:na]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    ... 83 common frames omitted

2019-09-08 15:33:49.931 ERROR 13680 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.orm.jpa.JpaSystemException: could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:351) ~[spring-orm-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:253) ~[spring-orm-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:527) ~[spring-orm-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178) ~[spring-data-jpa-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at com.sun.proxy.$Proxy111.save(Unknown Source) ~[na:na]
    at com.myOwnApi.restApi.manager.OsobaManager.save(OsobaManager.java:30) ~[classes/:na]
    at com.myOwnApi.restApi.manager.OsobaManager.fillDb(OsobaManager.java:39) ~[classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:300) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:190) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:153) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) ~[spring-context-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.boot.context.event.EventPublishingRunListener.running(EventPublishingRunListener.java:103) ~[spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at org.springframework.boot.SpringApplicationRunListeners.running(SpringApplicationRunListeners.java:77) ~[spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1225) [spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214) [spring-boot-2.2.0.M5.jar:2.2.0.M5]
    at com.myOwnApi.restApi.RestApiApplication.main(RestApiApplication.java:10) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.2.0.M5.jar:2.2.0.M5]
Caused by: org.hibernate.exception.GenericJDBCException: could not extract ResultSet
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:69) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.getResultSet(Loader.java:2287) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2045) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2007) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.doQuery(Loader.java:953) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:324) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.Loader.loadEntity(Loader.java:2401) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:64) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:54) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4312) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:570) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:538) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:208) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:333) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:108) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:74) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.fireLoadNoChecks(SessionImpl.java:1298) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1286) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.access$2100(SessionImpl.java:203) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2945) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.lambda$load$1(SessionImpl.java:2926) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.perform(SessionImpl.java:2882) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2926) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.get(SessionImpl.java:1086) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:306) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:172) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:70) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:889) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:875) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:313) ~[spring-orm-5.2.0.RC1.jar:5.2.0.RC1]
    at com.sun.proxy.$Proxy106.merge(Unknown Source) ~[na:na]
    at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:557) ~[spring-data-jpa-2.2.0.RC2.jar:2.2.0.RC2]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605) ~[spring-data-commons-2.2.0.RC2.jar:2.2.0.RC2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:345) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RC1.jar:5.2.0.RC1]
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.0.RC1.jar:5.2.0.RC1]
    ... 32 common frames omitted
Caused by: java.sql.SQLException: No database selected
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003) ~[mysql-connector-java-8.0.17.jar:8.0.17]
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-3.3.1.jar:na]
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-3.3.1.jar:na]
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60) ~[hibernate-core-5.4.4.Final.jar:5.4.4.Final]
    ... 83 common frames omitted

2019-09-08 15:33:49.935  INFO 13680 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2019-09-08 15:33:49.935  INFO 13680 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-09-08 15:33:49.938  INFO 13680 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2019-09-08 15:33:49.977  INFO 13680 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

Process finished with exit code 0
  • api.png (0,05 MB) - ściągnięć: 6
edytowany 2x, ostatnio: Shalom, 2019-09-09 11:31

Pozostało 580 znaków

2019-09-08 17:13
0

Możesz się podłączyć do tej bazy jakimś klientem? Jest dostępna pod wskazaną lokalizacją i ma te tabelkę? I nie podawaj publicznie usera i hasła :D

edytowany 1x, ostatnio: Charles_Ray, 2019-09-08 17:13

Pozostało 580 znaków

2019-09-08 17:19
0

Czytamy logi i co mamy?

sMarkowki napisał(a):

2019-09-08 15:33:49.829 ERROR 13680 --- [ restartedMain] o.h.engine.jdbc.spi.SqlExceptionHelper : No database selected

Nie podałeś nazwy swojej bazy danych.

spring.datasource.url=jdbc:mysql://remotemysql.com:3306

Pozostało 580 znaków

2019-09-08 21:03
0

Czyli jak powinno wyglądać połączenie?

spring.datasource.url=jdbc:mysql://remotemysql.com:3306/IEci8d0gZc

?

PS. Tak jak wspominałem ta baza danych nie ma żadnej wartości. Podałem dane do testowej żeby wiedzieć jak rozwiązać mój problem na dokladnym przykładzie :))

Pozostało 580 znaków

2019-09-09 00:44
0

Tak, dodatkowo dodaj konstruktor bezparametrowy w encji Osoba.

2019-09-08 15:33:47.996 INFO 13680 --- [ restartedMain] org.hibernate.tuple.PojoInstantiator : HHH000182: No default (no-argument) constructor for class: com.myOwnApi.restApi.dao.Entity.Osoba (class must be instantiated by Interceptor)

Pozostało 580 znaków

2019-09-09 12:22
0

Wszystko zrobione tak jak poradziłeś. Błędy owe zniknęły ale wybił jeszcze jeden:

The database returned no natively generated identity value; nested exception is org.hibernate.HibernateException: The database returned no natively generated identity value

Nie bardzo wiem jak z nim ruszyc.

Edit: Dobra, nie było pytania. Chodzilo o AI w bazie danych

edytowany 1x, ostatnio: sMarkowki, 2019-09-09 12:31

Pozostało 580 znaków

2019-09-09 13:57
0

Aplikacja działa. Mam jeszcze pytanie odnośnie hostingu, na którym mogę zapodać API aby nie odwoływać się do niego po localhoscie.
Przeglądałem poradniki i jednym z pomysłów twórcy jest Heroku ale chciałbym dostawać się do niego po własnej domenie (żeby było bardziej profesjonalnie).
Jakieś słowa klucze, których mogę użyć przy wyszukiwaniu takich hostingów? Jakieś wymagania?

Dzięki,
SM

Pozostało 580 znaków

2019-09-09 14:00
2019-09-09 19:53
0

Jeszcze jedno pytanie mam odnośnie własnych zapisań MYSQL'owych do bazy danych.
Szukam, modyfikuje, denerwuje sie... i nie mogę odpalić żądnego zapytania.

Poniżej przedstawiam swój kod dla wybranej metody, która powinna zadziałać ale coś nie pyka.


@RestController
@RequestMapping("/api/osoba")
public class OsobaAPI {

@Autowired
private OsobaManager osobaManager;

public OsobaAPI(OsobaManager osobaManager) {
    this.osobaManager = osobaManager;
}

@PostMapping("/query")
@ResponseBody
public Collection<Osoba> getQuery(){
    return osobaManager.zaloguj();
}

}


@Service
public class OsobaManager {

private OsobaRepo osobaRepo;
private OsobaRepoJpa osobaRepoJpa;

public OsobaManager(OsobaRepoJpa osobaRepoJpa) {
    this.osobaRepoJpa= osobaRepoJpa;
}

public Collection<Osoba> zaloguj(){
    return osobaRepoJpa.findUserByStatusAndNameNamedParams();
}

}


@Repository
public interface OsobaRepoJpa extends JpaRepository<Osoba, Integer> {

@Query(value = "SELECT u FROM Osoba u WHERE u.id = 1")
Collection<Osoba> findUserByStatusAndNameNamedParams();

}

Pozostało 580 znaków

2019-09-09 22:58
0

Co to znaczy, że „nie pyka”? Dostajesz jakiś błąd? Przeczytałeś dokumentację Spring Data? Tam masz na przykładach jak pisać zapytania

Pozostało 580 znaków

Odpowiedz
Liczba odpowiedzi na stronę

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0