Open Xomigrek opened 1 year ago
Первый вариант совсем непонятен, Вы команду не указали для запуска в третьем шаге. Будем разбирать второй.
Во втором варианте:
SQLException: Duplicate entry 'vasya' for key 'users.login' Query: INSERT INTO users(id, login, password, status) VALUES (?, ?, ?, ?); Parameters: [265121be-466d-4a57-a658-c3c7cdc21ad4, vasya, $2a$10$sNH5QNIxQruPD6UpK/h2w.u/DPXO/SOroxT35g5aq8ZvTUq64gSzC, active]
Описание
При запуске app-deadline.jar через терминал 2мя вариантами выдает ошибку
Шаги воспроизведения
Ожидаемый результат: Запуск приложения Фактический результат: Ошибка
Текст ошибки
DB_URL=jdbc:mysql://localhost:3306/app : Имя "DB_URL=jdbc:mysql://localhost:3306/app" не распознано как имя командлета, функции, файла сценария или выполняемой программы. Проверьте пр авильность написания имени, а также наличие и правильность пути, после чего повторите попытку. строка:1 знак:1 DB_URL=jdbc:mysql://localhost:3306/app DB_USER=app DB_PASS=pass java ... CategoryInfo : ObjectNotFound: (DB_URL=jdbc:mysql://localhost:3306/app:String) [], CommandNotFoundException FullyQualifiedErrorId : CommandNotFoundException
Шаги воспроизведения
Ожидаемый результат: Запуск приложения Фактический результат: Ошибка
Текст ошибки
2022-11-23 19:56:40.322 [main] TRACE Application - {
application.conf @ jar:file:/C:/Users/igrek/Desktop/Programing/SQL1/artifacts/app-deadline.jar!/application.conf: 6
}
2022-11-23 19:56:40.375 [DefaultDispatcher-worker-1] INFO Application - No ktor.deployment.watch patterns specified, automatic reload is not active Exception in thread "DefaultDispatcher-worker-1" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97) at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Static.call(CallerImpl.kt:106) at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:106) at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:152) at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:110) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.callFunctionWithInjection(ApplicationEngineEnvironmentReloading.kt:392) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.executeModuleFunction(ApplicationEngineEnvironmentReloading.kt:340) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.access$executeModuleFunction(ApplicationEngineEnvironmentReloading.kt:33) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1$$special$$inlined$forEach$lambda$1.invoke(ApplicationEngineEnvironmentReloading.kt:287) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1$$special$$inlined$forEach$lambda$1.invoke(ApplicationEngineEnvironmentReloading.kt:33) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.avoidingDoubleStartupFor(ApplicationEngineEnvironmentReloading.kt:320) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.access$avoidingDoubleStartupFor(ApplicationEngineEnvironmentReloading.kt:33) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1.invoke(ApplicationEngineEnvironmentReloading.kt:286) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1.invoke(ApplicationEngineEnvironmentReloading.kt:33) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.avoidingDoubleStartup(ApplicationEngineEnvironmentReloading.kt:302) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.instantiateAndConfigureApplication(ApplicationEngineEnvironmentReloading.kt:284) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.createApplication(ApplicationEngineEnvironmentReloading.kt:137) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.start(ApplicationEngineEnvironmentReloading.kt:257) at io.ktor.server.cio.CIOApplicationEngine$serverJob$1$1.invokeSuspend(CIOApplicationEngine.kt:52) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740) Caused by: java.sql.SQLException: Duplicate entry 'vasya' for key 'users.login' Query: INSERT INTO users(id, login, password, status) VALUES (?, ?, ?, ?); Parameters: [265121be-466d-4a57-a658-c3c7cdc21ad4, vasya, $2a$10$sNH5QNIxQruPD6UpK/h2w.u/DPXO/SOroxT35g5aq8ZvTUq64gSzC, active] at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:527) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:531) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:497) at ru.netology.aqa.service.UserService$register$2.invokeSuspend(UserService.kt:31) ... 5 more
Окружение