Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "start_value" not found 

 

spring.jpa.hibernate.ddl-auto=update

를 update 에서 create로 

spring.jpa.hibernate.ddl-auto=create

 

대부분은 기존 테이블/시퀀스가 꼬인 경우여서 그런거여서 새롭게 다시 만들어주면 해결됩니다. 

이번에 백엔드 개발중에 '&' 포함된 특수문자가 들어가면서 url에서 파라미터가 검색이 안되는 현상이 발생했다.

 

이후 base 64로 인코딩을 하여 디코딩해서 사용했는데 어떠한 특수한 경우에 이와 같은 오류가 발생했다.

 

오류:

Uncaught DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

 

이전 :

function base64(str) {
    return btoa(str);
}

 

변경을 해줬다

function utf8ToBase64(str) {
    return btoa(unescape(encodeURIComponent(str)));
}

const originalString = "all"; // 포함된 UTF-8 문자열
const encodedString = utf8ToBase64(originalString);

console.log(encodedString); //

 

문제는 여기서 또 발생하였다.

 

오류:

illegal base64 character 20; nested exception is java.lang.illegalargumentexception: illegal base64 character 20

 

이부분에 이상했던점이 한글을 인코딩하는데,

front  부분에서 특수문자인 '+'가 들어가게 되었고, url에선 '+'를 공백처리해버려서 디코딩이 잘되지 않았습니다.

 

그래서 이를 해결하기 위해

 

Hex 인코딩을 하게되었습니다. 

 

해결:

프론트 : 

function utf8ToHex(str) {
    const utf8Bytes = new TextEncoder().encode(str);
    return Array.from(utf8Bytes).map(byte => byte.toString(16).padStart(2, '0')).join('');
}

const originalString = "안녕하세요"; 
const encodedHex = utf8ToHex(originalString);

console.log(encodedHex);

 

백엔드:


public String hexDecode(String encodedHex){
  byte[] decodedBytes = new byte[encodedHex.length() / 2];
        for (int i = 0; i < encodedHex.length(); i += 2) {
            decodedBytes[i / 2] = (byte) ((Character.digit(encodedHex.charAt(i), 16) << 4)
                    + Character.digit(encodedHex.charAt(i + 1), 16));
        }
        String decodedString = new String(decodedBytes, StandardCharsets.UTF_8);
        return decodedString;
}

 

fishpoint.tistory.com/1406

 

에러해결 : Host 'HOST이름' is not allowed to connect to this MySQL server

개발중에 Host '192.168.1.242' is not allowed to connect to this MySQL server 발생할경우 해결책 DB 접근 권한이 없기 때문에 localhost로는 접근이 가능하지만 다른 ip로 접근했을때, 즉 라즈베리 파이 화면..

fishpoint.tistory.com

이사 하게 되면서 db가 조작이 안되서 ip주소 바뀐거 확인하고 코드를 바꿔줬지만 되지 않았습니다. 

...is not allowed to connect to this MySQL server

디버킹하면서 체크중에 위의 내용을 검색 결과 

현재 ip주소를 sql에서 접근해서 조작이 가능하도록 grant를 해줘야합니다.  

grant all privileges on *.* to root@아이피주소 identified by '비밀번호' with grant option;

코드에서 ip를 못찾아서 조금 시간을 뺏겼습니다. 권한부여를 미리 sql에서 명령어로 입력해줘여합니다. 

 

 

 

Installation did not succeed.
The application could not be installed.

List of apks:
[0] 'D:\AndroidStuidoProject\app\build\outputs\apk\debug\app-debug.apk'
Installation failed due to: ''pm install-create -r -t -S 19370155' returns error 'Unknown failure: Error: java.lang.IllegalStateException: ☃Requested internal only, but not enough space''

위의 경우에는 참고링크에 따라서 프로그램을 삭제해줘야한다 

이유는 모르겠지만 에뮬레이터에 메모리가 계속해서 쌓인다 

아래 이미지와같이 삭제해줍니다 

 

honeyinfo7.tistory.com/38 

 

안드로이드 에뮬레이터 용량문제(에뮬레이터 초기화)

안드로이드 개발을 공부하고 있는데 아래와 같은 오류가 계속해서 떳다. 뭔가 나의 소스가 잘못되었나하여 이것저것 지워봤지만 아무런 효과가 없었다. 심지어 아예 새로운 프로젝트를 만들어

honeyinfo7.tistory.com

 

java.sql.SQLException::No suitable driver

이전:

 val conn= DriverManager.getConnection("jdbc:mysql://ip주소/데이터베이스이름","sql 권한 받은 아이디","sql 비밀번호")

해결

  Class.forName("com.mysql.jdbc.Driver")
  val conn= DriverManager.getConnection("jdbc:mysql://ip주소/데이터베이스이름","sql 권한 받은 아이디","sql 비밀번호")

참고링크:

stackoverflow.com/questions/60084064/java-sql-sqlexception-no-suitable-driver-found-for-jdbcmysql-localhost3306

 

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/database

I've been trying to set up my own rest api for a school project. I decided to use MySQL as a database and i want to connect it with my webservice, but apparently i always get this error message: j...

stackoverflow.com

 

developmentnotepad.tistory.com/entry/JDBC-%EC%82%AC%EC%9A%A9-%EC%8B%9C-%EB%B0%9C%EC%83%9D%ED%95%98%EB%8A%94-%EC%98%A4%EB%A5%98

 

[Error] JDBC 사용 시 발생하는 오류

MySQL 8.0이상의 버전을 사용하였다. Tue Jan 29 20:27:28 KST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and..

developmentnotepad.tistory.com

버그 내용:

Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification

 

위의 링크를 참조하였고 

기존:

"jdbc:mysql://ip주소:포트번호/데이터베이스이름"

해결:

"jdbc:mysql://ip주소:포트번호/데이터베이스이름?serverTimezone=Asia/Seoul&useSSL=false";

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace Demo_Console
{
    class Program
    {
        static void Main(string[] args)
        {
            Process ExternalProcess = new Process();
            ExternalProcess.StartInfo.FileName = @"파일 경로";// @"C:\Users\Vitor\ConsoleApplication1.exe";
            ExternalProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
            //실행시킬 프로그램윈도우 크기 
            ExternalProcess.Start();//process 시작
            ExternalProcess.WaitForExit();//외부 process 시작되면 실행중인 c# 일시중지
                                           // c#도 함께 사용하려면 제거 
                                            //
        }
    }
}

stackoverflow.com/questions/3173775/how-to-run-external-program-via-a-c-sharp-program

 

How to run external program via a C# program?

How do I run an external program like Notepad or Calculator via a C# program?

stackoverflow.com

외부 프로세스 종료 :

 ExternalProcess.kill();

에러는 없었지만 좌표값이 이렇게 찍혀야 하는데 

좌표가 이상하게 나와서 y축 범위가 이상하다 판단하여 코드에서 좌표값을 얻어오는곳을 확인해보니

void CMouse::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam)
{
	if (iMessage = WM_MOUSEMOVE) {
		position.x = (float)LOWORD(lParam);
		position.y = (float)LOWORD(lParam);
	}
	if (iMessage == WM_MOUSEWHEEL) {
		short temp = (short)HIWORD(wParam);
		wheelPreValue = wheelValue;
		wheelValue += (float)temp;

	}
}

y좌표가 이상하다는걸 알았습니다.

position.x = (float)LOWORD(lParam);
position.y = (float)LOWORD(lParam);

 

참조링크:http://soen.kr/lecture/win32api/lec4/lec4-2-1.htm

 

Win32 API 입문 강좌

윈도우즈와 같은 GUI운영체제에서는 키보드보다 마우스가 더 많이 사용된다. 윈도우즈의 공식 입력 장치는 키보드이지만 그래픽 툴이나 DTP, CAD 등의 복잡한 프로그램에서는 마우스가 주요 입력 장치로 사용된다. 여기서 마우스라고 함은 진짜 쥐새끼처럼 생긴 마우스는 물론이고 노트북의 터치패드, 트랙볼과 출판용 타블릿 등을 모두 포함하는 명칭이다. 키보드 입력 처리를 메시지로 하는 것과 마찬가지로 마우스 입력 처리도 메시지를 받아 처리한다. 마우스 입력에 관

soen.kr

#define LOWORD(l)           ((WORD)(((DWORD_PTR)(l)) & 0xffff))

IParam의 좌표의 위치가 잘못되었다는걸 알았습니다. 

그래서 HIWORD로 바꾸어 주었습니다.

변경전:

position.x = (float)LOWORD(lParam);
position.y = (float)LOWORD(lParam);

변경후:

position.x = (float)LOWORD(lParam);
position.y = (float)HIWORD(lParam);

+ Recent posts