이거 오류는 SpringApplication이 오류였음
이 application 내에서 PostgreSQLRunner.java
를 실행하는데
package com.auction.common;
import com.auction.postgrestest.PostgreSQLRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
public class AuctionApplication {
public static void main(String[] args) {
SpringApplication.run(PostgreSQLRunner.class, args);
// SpringApplication.run(AuctionApplication.class, args);
}
}
PostgreSQLRunner는 class이기 때문에 이렇게 실행하면 오류가 나고
package com.auction.common;
import com.auction.postgrestest.PostgreSQLRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
public class AuctionApplication {
public static void main(String[] args) {
SpringApplication.run(AuctionApplication.class, args); // 애플리케이션 메인 클래스 실행
// PostgreSQLRunner를 직접 실행하려는 경우
PostgreSQLRunner postgreSQLRunner = new PostgreSQLRunner();
postgreSQLRunner.run(null); // 또는 필요한 ApplicationArguments 객체를 전달
}
}
이렇게 실행해야 했다.