오류메시지 : Driver oracle.jdbc.driver.OracleDriver claims to not accept jdbcUrl

application.properties의 url부분을 잘 봐야 한다.

원인: oracle데이터베이스로 연결할 때 spring.datasource.hikari.jdbc-url=jdbc:oracle:thin:@localhost:1521/xe 라고 써야 하지만 url==이라고 =을 2번 써서 발생한 오류.

Posted by 知彼知己百戰不殆
,

JUnit 테스트를 돌리는데 갑자기 연결이 잘 되던 것이 에러가 났다. 한 가지 짐작가는 건 gradle 설정을 수정을 했기에 해당 부분에 대해 알아보았다.

기존(잘되던 것) : runtimeOnly 'com.oracle.database.jdbc:ojdbc8'

수정(잘 안 됨) : runtimeOnly 'com.oracle.database.jdbc:ojdbc6'

oracle이 설치된 곳을 보면 jdbc드라이버 버전을 찾을 수 있다. 그래서 oracle설치 폴더에서 jdbc드라이버를 찾아 jar파일이 있는 버전으로 다시 수정을 했다.

Posted by 知彼知己百戰不殆
,

main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

참고: https://hodolee246.tistory.com/9

 

Spring Boot DB 오류해결

0. Github https://github.com/hodolee246/on-my-own/tree/master/DBConfig 1. 개요 Spring Boot 프로젝트에서 오류 원인 및 해결방법 "Failed to configure a DataSource: 'url' attribute is not specified and..

hodolee246.tistory.com

추후 해당 블로그 보면서 정리

Posted by 知彼知己百戰不殆
,

프로젝트 Team -> Share Project 선택

Use or create repository in parent folder of project 체크

밑에 Create Repository가 활성화되면 버튼 눌러줌.

이제 git staging에서 프로젝트를 push해주면 끝

Posted by 知彼知己百戰不殆
,

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

mySql JUnit 테스트 class를 만들어서 테스트 중 해당 에러 발생.

jdbc 드라이버는 2가지 종류.

1. com.mysql.jdbc.Driver
2. com.mysql.cj.jdbc.Driver

1번은 deprecated이므로 2번을 써야함.

Posted by 知彼知己百戰不殆
,

기존 git 소스 추가 후 project import 시 clone 후 바로 import로 추가하였다.

(실수1) clone 후 import 프로젝트
(뻘짓1) Gradle 설정

스프링부트 실행 시 Error occurred during initialization of boot layer
java.lang.LayerInstantiationException: Package jdk.internal.jimage.decompressor in both module jrt.fs and module java.base 오류 발생.

구글링 하니 spring 프로젝트는 clone 후 import 하는 방법이 조금은 달랐다.

빨간 표시의 Directory 경로를 잘 기억해야한다.

git Clone 확인 후

오른쪽 상단의 package Explorer을 눌러준다.

package Explorer로 돌아왔으면 File -> Import 클릭.

Gradle -> Existing Gradle Project 선택

소스가 있는 폴더 선택

Project root Directory를 clone경로의 소스 폴더랑 똑같이 맞춰준다.

Spring Boot App 구동 창이 나왔다.

Spring Boot 구동 성공

Posted by 知彼知己百戰不殆
,

Scanner객체에서 입력을 받기도 전에 입력한게 없다는 오류가 떨어지며 프로그램 종료. 혹시 개행 문자가 남은 건 아닐까 해서 봤지만 제일 위에 Scanner객체를 새로 생성 후 처음으로 받는 readLine()이었다.

Scanner 사용 시 NoSuchElementException 오류.
이해가 안 가 구글링.

답은 sc.close()

해당 class에는 없었지만 이 class를 호출하는 다른 class에서 이미 close를 해버려서 stream을 닫아버렸으므로 다시 stream은 열리지 않음.

예전에 공부할 땐 언뜻 스쳐지나갔는데, 오늘 다시 검색해본 김에 정리.

 

Posted by 知彼知己百戰不殆
,

노트북에서 개발하던 토이 프로젝트를 집에 있을 땐 컴퓨터에서 개발하고 싶어 git에 추가하였다. clone을 해도 gradle 프로젝트로 인식을 못하는지 gradle이 나오질 않았고, 구글링을 해보았다.

Detect and configure project natures 체크 해제!!

검색해보니 Detect and configure project natures를 체크 해제!! 해야 했다. 그리고 project import 후

프로젝트에 마우스 우클릭 후 Configure -> Add Gradle Nature 클릭.

그리고 프로젝트 마우스 우클릭 후 Refresh Gradle 선택

Posted by 知彼知己百戰不殆
,

현재 실무 시스템의 테스트가 너무 불편하여 Junit4를 실행하려고 했다.
하지만 기나긴 삽질 끝에 얻은 결론.
정상적인 spring 시스템이라고 해도 dependency에 spring-test를 넣어줘야 한다.
하지만 현 개발횐경에서는 dependency를 추가 못하게 막아놨으므로 사용불가.

Posted by 知彼知己百戰不殆
,

'언어 > 알고리즘' 카테고리의 다른 글

Arrays.binarySearch 함수  (0) 2020.09.12
Posted by 知彼知己百戰不殆
,