📱인프런 모바일 App 😆
스프링 부트 개념과 활용

스프링 부트 개념과 활용

(70개의 수강평)

1490명의 수강생

110,000원

평생
중급
수료증
62개 수업, 총 11시간 31분
위시리스트 추가
이원준 프로필

neo4j host설정 문의 이원준 4일 전

docker toolbox(default ip: 192.168.99.100)을 사용중인데

다른 강의 세팅시에 spring.data.redius.host = 192.168.99.100 이런식으로 설정하여 정상작동을 확인하였는데 neo4j는 해당 host설정이 안먹는것 같습니다 설정가능한 방법을 알고 싶습니다 감사합니다.

1
신수웅 프로필

혹시 TDD 관련해서 추천해주시는 도서나 강의가 있을까요? 신수웅 4일 전

기선님께서 TDD 강좌를 만들어주시면 무조껀 들을 의향이 있는데 TDD를 Front-end 사이드에서 자스민으로 해본 경험은 있으나 자바 어플리케이션에서 제대로 구현을 해본 경험이 없습니다.

이러한 상황에서 추천해주시는 도서나 강의가 있을까요?

알려주시면 너무나 감사할 것 같습니다!

1
SangHyun Kim 프로필

EnableAutoConfiguration 어노테이션에서 궁금한 것이 생겼습니다. SangHyun Kim 11일 전

spring.factories에 있는 EnableAutoConfiguration 부분에서 @Configuration 어노테이션이 붙은 설정들을 조건에 맞게 로딩한다고 하셨는데요, spring.factories 파일은 어떤 클래스가 읽어주는건가요?

1
안지혁 프로필

오라클을 해보고싶은데.. 안지혁 11일 전

안녕하세요..

제가 이전에 스프링부트가 아닌 기본 스프링만 배우고 스프링 레거시 프로젝트로만 배워서 이 강좌를 보고 있습니다.

다름이 아니라 제가 오라클을 많이 사용을해서 오라클도 연동을 해보려고 하는데 잘 안되더라구요,.

오라클은 11g xe 실습용을 사용하고 있습니다.

이 강의에서 datasource url과 classname을 오라클로 변경하고

dependency는 구글링해보았는데  글마다 좀 달라서  밑에처럼 추가했습니다.

<dependency>

   <groupId>com.zaxxer</groupId>

    <artifactId>HikariCP</artifactId>

</dependency>

<dependency>

      <groupId>com.oracle</groupId>

      <artifactId>ojdbc6</artifactId>

</dependency>

 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pgSQLRunner': Unsatisfied dependency expressed through field 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: oracle.jdbc.OracleDriver

이러한 로그가떠서

spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver

spring.datasource.driver-class-name=oracle.jdbc.OracleDriver

이런식으로 변경해보았는데 계속 에러가 발생하더라구요.. 혹시 다른방법이 있는지 아니면 제가 잘못 하고 있는것이 무엇인지 알려 주실수 있을까요?? 감사합니다(_ _)

1
장준수 프로필

[Intellij] Context Menu Plugin....? 장준수 15일 전

안녕하세요 재미나게 강의를 듣고 있는 수강생입니다~

강의를 보면서 계속 신경쓰였던 부분이 alt+1 눌러서 프로젝트쪽으로 포커스를 옮기고 context menu를 눌렀을때

오른쪽마우스를 눌러 일반적인 new -> file list가 나오는 형태가 아니라 자주쓰이는(?) 부분만 context menu로 바로 보여주는데 혹 intellij에 내장된 기능인것인지... 아님 plugin인 것인지..... 너무너무 궁금하여 이렇게 글을 남겨봅니다

 

정말 정말 알고싶습니다 ㅠㅠㅠ

 

(아 참고로 저 기능을 비슷하게하는게 context menu란걸 알고 구글링을 열심히 뚜들겼으나 기선님께서 쓰시는 저 기능이 나오질 않아 이렇게 글을 남깁니다...)

7
변영석 프로필

[해결] Tomcat 9.x 실행 문제 변영석 16일 전

다음과 같이 코드 추가하시면 Tomcat 9.x 에서 8080포트로 실행 잘됩니다.

기존 코드

tomcat.start();
tomcat.getServer().await();

 

변경 코드

tomcat.getConnector();
tomcat.start();
tomcat.getServer().await();

1
이원준 프로필

어플리케이션 실행시 에러 이원준 17일 전

현재 docker toolbox를 이용중입니다..

docker toolbox는 가상머신에 서버를 뛰우기에

디폴트 ip인 192.168.99.100 으로 이전 강의(jpa, postgre 등)에서 application.properites에 설정하여

정상적으로 작동하였습니다. redis사용할 때도 설정이 필요한지 질문드립니다. 

우선 아무설정없이 실행하면 아래에러가 뜨는데 이 설정이 없어서 나는 문제인지 알고싶습니다.

강의를 듣다가 막혀서 진도가 안나가 질문드립니다.

아래 에러메시지를 나열하였습니다.  감사합니다.

 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2019-07-31 23:30:22.611 ERROR 15076 --- [           main] o.s.boot.SpringApplication               : Application run failed

 

java.lang.IllegalStateException: Failed to execute ApplicationRunner

at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:773) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:760) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at me.izac.springbootredis.SpringbootredisApplication.main(SpringbootredisApplication.java:10) [classes/:na]

Caused by: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1106) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1085) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedConnection(LettuceConnectionFactory.java:866) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getConnection(LettuceConnectionFactory.java:341) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:132) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:95) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:82) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:211) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.DefaultValueOperations.set(DefaultValueOperations.java:236) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at me.izac.springbootredis.RedisRunner.run(RedisRunner.java:19) ~[classes/:na]

at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:770) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

... 5 common frames omitted

Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379

at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:78) ~[lettuce-core-5.1.7.RELEASE.jar:na]

at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:56) ~[lettuce-core-5.1.7.RELEASE.jar:na]

at io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:235) ~[lettuce-core-5.1.7.RELEASE.jar:na]

at io.lettuce.core.RedisClient.connect(RedisClient.java:204) ~[lettuce-core-5.1.7.RELEASE.jar:na]

at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:113) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at java.util.Optional.orElseGet(Optional.java:267) ~[na:1.8.0_171]

at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:113) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1104) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

... 17 common frames omitted

Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: localhost/127.0.0.1:6379

at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_171]

at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_171]

at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:670) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:617) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:534) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]

at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_171]

Caused by: java.net.ConnectException: Connection refused: no further information

... 12 common frames omitted

 

1
안지혁 프로필

log4j2 변경하는것이 안됩니다. 안지혁 18일 전

안녕하세요.

스프링부트2, 스프링 5로 공부중입니다.

강의에서 pom.xml에서 exclusions를 추가하여 log4j2로 변경하였는데 아래 처럼 에러가 나더라구요..

검색을 해보며 찾아보니

https://www.baeldung.com/slf4j-classpath-multiple-bindings

스프링에서 이런식으로 하라고 하는것 같은데 마찬가지더라구요..

왜 이런 에러가 발생하는걸까요??

/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/bin/java -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=62538:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/tools.jar:/Users/zidol/Desktop/sts_workspace/springinit/target/classes:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.1.6.RELEASE/spring-boot-starter-web-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.1.6.RELEASE/spring-boot-starter-json-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.9/jackson-databind-2.9.9.jar:/Users/zidol/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar:/Users/zidol/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.9/jackson-core-2.9.9.jar:/Users/zidol/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.9/jackson-datatype-jdk8-2.9.9.jar:/Users/zidol/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.9/jackson-datatype-jsr310-2.9.9.jar:/Users/zidol/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.9/jackson-module-parameter-names-2.9.9.jar:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.1.6.RELEASE/spring-boot-starter-tomcat-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.21/tomcat-embed-core-9.0.21.jar:/Users/zidol/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.21/tomcat-embed-el-9.0.21.jar:/Users/zidol/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.21/tomcat-embed-websocket-9.0.21.jar:/Users/zidol/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.17.Final/hibernate-validator-6.0.17.Final.jar:/Users/zidol/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar:/Users/zidol/.m2/repository/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar:/Users/zidol/.m2/repository/com/fasterxml/classmate/1.4.0/classmate-1.4.0.jar:/Users/zidol/.m2/repository/org/springframework/spring-web/5.1.8.RELEASE/spring-web-5.1.8.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/spring-beans/5.1.8.RELEASE/spring-beans-5.1.8.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/spring-webmvc/5.1.8.RELEASE/spring-webmvc-5.1.8.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/spring-aop/5.1.8.RELEASE/spring-aop-5.1.8.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/spring-context/5.1.8.RELEASE/spring-context-5.1.8.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/spring-expression/5.1.8.RELEASE/spring-expression-5.1.8.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.6.RELEASE/spring-boot-starter-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot/2.1.6.RELEASE/spring-boot-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.6.RELEASE/spring-boot-autoconfigure-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/Users/zidol/.m2/repository/org/springframework/spring-core/5.1.8.RELEASE/spring-core-5.1.8.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/spring-jcl/5.1.8.RELEASE/spring-jcl-5.1.8.RELEASE.jar:/Users/zidol/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/2.1.6.RELEASE/spring-boot-starter-log4j2-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.11.2/log4j-slf4j-impl-2.11.2.jar:/Users/zidol/.m2/repository/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar:/Users/zidol/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.2/log4j-api-2.11.2.jar:/Users/zidol/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.2/log4j-core-2.11.2.jar:/Users/zidol/.m2/repository/org/apache/logging/log4j/log4j-jul/2.11.2/log4j-jul-2.11.2.jar:/Users/zidol/.m2/repository/org/slf4j/jul-to-slf4j/1.7.26/jul-to-slf4j-1.7.26.jar:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot-configuration-processor/2.1.6.RELEASE/spring-boot-configuration-processor-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.1.6.RELEASE/spring-boot-starter-logging-2.1.6.RELEASE.jar:/Users/zidol/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/zidol/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/zidol/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.11.2/log4j-to-slf4j-2.11.2.jar me.zidol.springinit.SpringinitApplication

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/Users/zidol/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.11.2/log4j-slf4j-impl-2.11.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/Users/zidol/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]

Exception in thread "main" java.lang.StackOverflowError

5
안지혁 프로필

프로퍼티 우선순위 안지혁 19일 전

안녕하세요..

프로퍼티 우선 순위

  1. 유저 홈 디렉토리에 있는 spring-boot-dev-tools.properties =>유저 홈 디렉토리라는게 어디를 말씀하시는건가요??

1
박재현 LARS 프로필

강의는 너무 좋은데 박재현 LARS 23일 전

강의는 너무 좋은데 왜이리 끊기나요? ㅜㅜ

와이파이 쓰는것도 아닌데

지하철 타고다니면서 볼수가 없습니다

다운로드는 안되나요?

0
이원준 프로필

AccountRepositoryTest에 Account 추가시 에러... 이원준 1달 전

강의 16:37 부터 Account 객체를 추가하여 진행 후 run 하면 에러가 발생합니다. 아래에 내용 추가했어요

원인확인 부탁드립니다 .

 

java.lang.IllegalStateException: Failed to load ApplicationContext

 

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)

at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108)

at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)

at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)

at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:43)

at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)

at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)

at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)

at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)

at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)

at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)

at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract me.izac.springbootjpa.account.Account me.izac.springbootjpa.account.AccountRepository.findByUsername(java.lang.String)! Unable to locate Attribute  with the the given name [username] on this ManagedType [me.izac.springbootjpa.account.Account]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:826)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)

at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:119)

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)

... 25 more

Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract me.izac.springbootjpa.account.Account me.izac.springbootjpa.account.AccountRepository.findByUsername(java.lang.String)! Unable to locate Attribute  with the the given name [username] on this ManagedType [me.izac.springbootjpa.account.Account]

at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:84)

at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:106)

at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:211)

at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:79)

at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lookupQuery(RepositoryFactorySupport.java:566)

at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$mapMethodsToQuery$1(RepositoryFactorySupport.java:559)

at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)

at java.util.Iterator.forEachRemaining(Iterator.java:116)

at java.util.Collections$UnmodifiableCollection$1.forEachRemaining(Collections.java:1049)

at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)

at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)

at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)

at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)

at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)

at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.mapMethodsToQuery(RepositoryFactorySupport.java:561)

at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$new$0(RepositoryFactorySupport.java:551)

at java.util.Optional.map(Optional.java:215)

at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:551)

at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:324)

at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:297)

at org.springframework.data.util.Lazy.getNullable(Lazy.java:211)

at org.springframework.data.util.Lazy.get(Lazy.java:94)

at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:300)

at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:121)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)

... 40 more

Caused by: java.lang.IllegalArgumentException: Unable to locate Attribute  with the the given name [username] on this ManagedType [me.izac.springbootjpa.account.Account]

at org.hibernate.metamodel.internal.AbstractManagedType.checkNotNull(AbstractManagedType.java:128)

at org.hibernate.metamodel.internal.AbstractManagedType.getAttribute(AbstractManagedType.java:113)

at org.springframework.data.jpa.repository.query.QueryUtils.toExpressionRecursively(QueryUtils.java:594)

at org.springframework.data.jpa.repository.query.QueryUtils.toExpressionRecursively(QueryUtils.java:578)

at org.springframework.data.jpa.repository.query.JpaQueryCreator$PredicateBuilder.getTypedPath(JpaQueryCreator.java:381)

at org.springframework.data.jpa.repository.query.JpaQueryCreator$PredicateBuilder.build(JpaQueryCreator.java:304)

at org.springframework.data.jpa.repository.query.JpaQueryCreator.toPredicate(JpaQueryCreator.java:209)

at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:122)

at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:57)

at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:119)

at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:95)

at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:81)

at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.<init>(PartTreeJpaQuery.java:147)

at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$CountQueryPreparer.<init>(PartTreeJpaQuery.java:270)

at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:79)

... 66 more

 

2
Yong D 프로필

프로퍼티 파일 설정 Yong D 1달 전

[application.properties]
man.name=dustin
man.age=19
woman.name=elsa
woman.age=19
 
[application_test.properties]
 
man.name=tom
man.age=30
woman.name=robin
woman.age=22
============================================
 
[Man.java]
@PropertySource("classpath:application_test.properties")
//적용되지 않음
@ConfigurationProperties("man")
@Component
public class Man{

String name;
int age;

//getter,setter
 
 

}
 
==============================================
질문
Man 을 사용시 application.properties의 값만 설정되는데
application_test.properties의 값을 설정하는 방법 없을까요?
 

2
김찬 프로필

스프링 di(ioc) ,aop에 대해 김찬 1달 전

안녕하세요 백기선님의 강의의 열혈팬입니다.

 

강의를 듣다가 궁금한 점이 생겨 질문드려봅니다.

 

스프링에서 제공해주는 다양한 기능들 중 di(ioc), aop가 적용되어 있는 곳이 어디가 있을까요?

(개발자가 직접 코드로 구현하는 것 말고!!)

 

제 생각으로는, 

aop

- filter 기능을 이용한 controller의 메소드에 기본 파라미터 주입

- tiles xml파일 내 definition태그 안의 preparer 기능

di

- application.propertis를 통한 설정 정보 주입

- Autowired 객체 주입

- view resolver에서 view 파일 지정

 

들이 있는데 더 많은 예를 알고싶어 질문드립니다.

감사합니다!

 

 

1
강희준 프로필

인텔리제이에서 @Autowired의 사용을 자제하라고 하는데 이유가 뭘까요? 강희준 1달 전

@Autowired를 사용하여 빌드하니 그것보다는 private final 과 생성자를 통해서 bean을 주입받으라고 하는것을 보았습니다. 잠깐 검색을 해보니 @Autowired를 남용하면interface의 구현체가 여러개인 경우 문제가 생길 수 있다는건 알았는데요, 혹시 또 다른 중요한 이유가 있을까요?

1
강희준 프로필

classpath와 current directory의 기준 강희준 1달 전

spring docs의 application property files (24.3)을 보면

1. a /config subdir of current dir

2. current dir

3. classpath /config

4. classpath root 

라고 적혀있는데요, 정확히 current directory와 classpath의 위치가 어디인지 알고 싶습니다. docs에서 current directory를 '현재 프로젝트 최상위 폴더 및' 이라고 하지 않고 classpath를 구체적으로 resources 하위 항목 이라고 하지 않는 이유가 뭘까요? 너무 설명이 모호하다고 느껴집니다.

1