소개
개발은 세상을 바꾼다는 철학
게시글
질문&답변
2021.12.06
jpaRepository 의존성 주입 중복문제????
안녕하세요 제가 최대한 해 볼려고 했고 ㅜㅜ 말씀주신 문제되는 부분만을 추출하는 것도 어려워서 이렇게 문의 드립니다. 과거의 build.gradle로 문제가 없이 작동됩니다. 예전의 build.gradle 입니다 ************************************************* buildscript { repositories { mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } ext { hibernateVersion = '5.1.0.Final' queryDSLVersion = '4.1.4' } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin") classpath "gradle.plugin.com.ewerk.gradle.plugins:querydsl-plugin:1.0.7" classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE" } } plugins { id 'org.springframework.boot' version '2.1.7.RELEASE' id 'java' id 'net.ltgt.apt' version '0.20' } apply plugin: 'io.spring.dependency-management' apply plugin: 'war' apply plugin: "com.ewerk.gradle.plugins.querydsl" apply plugin: 'net.ltgt.apt-idea' apply plugin: "io.spring.dependency-management" sourceCompatibility = '1.8' targetCompatibility = '1.8' configurations { compileOnly { extendsFrom annotationProcessor } querydsl.extendsFrom compileClasspath } repositories { mavenCentral() maven { url 'https://repo.spring.io/libs-snapshot' } } bootRun { systemProperties System.properties } ext { mapstructVersion = "1.3.1.Final" } compileQuerydsl{ options.annotationProcessorPath = configurations.querydsl } // querydsl 적용 def querydslSrcDir = project.buildDir.toString() + '/generated/sources/annotationProcessor/java/main' querydsl { jpa = true querydslSourcesDir = querydslSrcDir } sourceSets { main { java { srcDirs = ['src/main/java', querydslSrcDir] } } } dependencies { //jsp, jstl compile group: 'javax.servlet', name: 'jstl', version: '1.2' compile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '8.5.20' // https://mvnrepository.com/artifact/org.sitemesh/sitemesh compile group: 'org.sitemesh', name: 'sitemesh', version: '3.0.1' // https://mvnrepository.com/artifact/opensymphony/sitemesh compile group: 'opensymphony', name: 'sitemesh', version: '2.4.2' //qlrm compile group: 'ch.simas.qlrm', name: 'qlrm', version: '1.7.1' //database runtime("mysql:mysql-connector-java:5.1.41") compile("org.hibernate:hibernate-core:$hibernateVersion") compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") compile("org.hibernate:hibernate-java8:$hibernateVersion") compile("com.querydsl:querydsl-jpa:${queryDSLVersion}") compile("com.querydsl:querydsl-apt:${queryDSLVersion}") compile("com.querydsl:querydsl-sql:${queryDSLVersion}") compile("com.querydsl:querydsl-sql-spring:${queryDSLVersion}") compile("com.vladmihalcea:hibernate-types-52:2.3.5") // Mybatis compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2") //commons compile("commons-io:commons-io:2.4") compile("commons-codec:commons-codec:1.10") compile("commons-fileupload:commons-fileupload:1.3.1") compile("commons-httpclient:commons-httpclient:3.1") compile("commons-logging:commons-logging:1.2") compile("commons-collections:commons-collections:3.2.2") compile("org.apache.commons:commons-csv:1.4") compile("org.apache.commons:commons-lang3:3.4") //jpa compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.1.7.RELEASE' // etc compile("com.googlecode.json-simple:json-simple:1.1.1") compile("org.mindrot:jbcrypt:0.4") compile group: 'org.bouncycastle', name: 'bcprov-jdk16', version: '1.46' compile 'org.springframework.boot:spring-boot-starter-web' compile("org.springframework.session:spring-session-core") compile("org.springframework.boot:spring-boot-starter-security") compile("com.squareup.okhttp3:okhttp:3.7.0") compileOnly 'org.projectlombok:lombok' runtimeOnly 'org.springframework.boot:spring-boot-devtools' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' // local compile files('src/main/webapp/WEB-INF/lib/xalan.jar') compile files('src/main/webapp/WEB-INF/lib/commons-httpclient-3.0.jar') compile files('src/main/webapp/WEB-INF/lib/ExecureCrypto_v1.0_jdk14.jar') // mapstruct implementation "org.mapstruct:mapstruct:${mapstructVersion}" annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion} } 그리고 바꾼 즉 현재 문제가 발생되고 있는 build.gradle 입니다. *********************************** plugins { id 'java' id 'war' id 'org.springframework.boot' version '2.5.4' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10' id 'net.ltgt.apt' version '0.20'}sourceCompatibility = '1.8'targetCompatibility = '1.8'configurations { compileOnly { extendsFrom annotationProcessor } querydsl.extendsFrom compileClasspath}repositories { mavenCentral() maven { url 'https://plugins.gradle.org/m2/' } maven { url 'https://repo.spring.io/libs-snapshot' }}test { useJUnitPlatform()}compileQuerydsl{ options.annotationProcessorPath = configurations.querydsl}// querydsl 적용def querydslSrcDir = project.buildDir.toString() + '/generated/sources/annotationProcessor/java/main'querydsl { jpa = true querydslSourcesDir = querydslSrcDir}sourceSets { main { java { srcDirs = ['src/main/java', querydslSrcDir] } }}dependencies { implementation 'org.springframework.boot:spring-boot-starter-web:2.5.4' implementation 'org.springframework.boot:spring-boot-starter-data-jpa:2.5.4' implementation 'org.springframework.boot:spring-boot-starter-jdbc:2.5.4' implementation 'org.springframework.boot:spring-boot-starter-validation:2.5.4' implementation 'org.springframework.boot:spring-boot-starter-security:2.5.4' testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.4' implementation 'org.springframework.session:spring-session-core:2.5.3' implementation 'com.squareup.okhttp3:okhttp:4.9.1' runtimeOnly 'org.springframework.boot:spring-boot-devtools:2.5.4' compileOnly 'org.projectlombok:lombok:1.18.22' annotationProcessor 'org.projectlombok:lombok:1.18.22' //jsp, jstl implementation 'javax.servlet:jstl:1.2' implementation 'org.apache.tomcat.embed:tomcat-embed-jasper:10.0.8' // https://mvnrepository.com/artifact/org.sitemesh/sitemesh implementation 'org.sitemesh:sitemesh:3.0.1' // https://mvnrepository.com/artifact/opensymphony/sitemesh implementation 'opensymphony:sitemesh:2.4.2' //qlrm implementation 'ch.simas.qlrm:qlrm:1.7.1' //database runtime 'mysql:mysql-connector-java:8.0.25' implementation 'org.hibernate:hibernate-core:5.6.1.Final' implementation 'org.hibernate:hibernate-entitymanager:5.6.1.Final' implementation 'org.hibernate:hibernate-java8:5.6.1.Final' implementation 'com.vladmihalcea:hibernate-types-52:2.12.1' implementation 'com.querydsl:querydsl-jpa:5.0.0' implementation 'com.querydsl:querydsl-apt:5.0.0' implementation 'com.querydsl:querydsl-sql:5.0.0' implementation 'com.querydsl:querydsl-sql-spring:5.0.0' // Mybatis implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.0' //commons implementation 'commons-io:commons-io:20030203.000550' implementation 'commons-codec:commons-codec:20041127.091804' implementation 'commons-fileupload:commons-fileupload:1.4' implementation 'commons-httpclient:commons-httpclient:20020423' implementation 'commons-logging:commons-logging:1.2' implementation 'commons-collections:commons-collections:20040616' implementation 'org.apache.commons:commons-csv:1.8' implementation 'org.apache.commons:commons-lang3:3.12.0' // etc implementation 'com.googlecode.json-simple:json-simple:1.1.1' implementation 'org.mindrot:jbcrypt:0.4' implementation 'org.bouncycastle:bcprov-jdk16:1.46' //cf signed url 만들 때 // local implementation files('src/main/webapp/WEB-INF/lib/xalan.jar') implementation files('src/main/webapp/WEB-INF/lib/commons-httpclient-3.0.jar') implementation files('src/main/webapp/WEB-INF/lib/ExecureCrypto_v1.0_jdk14.jar') // mapstruct implementation "org.mapstruct:mapstruct:1.4.2.Final" annotationProcessor "org.mapstruct:mapstruct-processor:1.4.2.Final" testAnnotationProcessor "org.mapstruct:mapstruct-processor:1.4.2.Final"}bootRun { String activeProfile = System.properties['spring.profiles.active'] systemProperty "spring.profiles.active", activeProfile} 부탁드립니다 감사합니다.
- 0
- 7
- 9.1K
질문&답변
2021.11.30
jpaRepository 의존성 주입 중복문제????
안녕하세요 매번 번거롭게 해서 죄송합니다. findByHeadIdxAndAIdxNot -> findByHeadIdxAndaIdxNot 으로 바뀌면서 No property andaIdx found for type Integer! Traversed path: Article.headIdx. 이러한 문구로 에러를 발생시킵니다 그전에는 문제 없이 되던 것이 스프링 부트, gradle버전 올렸습니다. 그리고 수정한 것이라고는 @Autowired 주입을 @RequiredArgsConstructor으로 수정을 하면서 발생을 했습니다.
- 0
- 7
- 9.1K
질문&답변
2021.11.29
jpaRepository 의존성 주입 중복문제????
안녕하세요 동일한 에러가 발생하고 있습니다. 해결을 해야 하는데 어떻게 하면 될 수 있을지요?
- 0
- 7
- 9.1K
질문&답변
2021.11.27
jpaRepository 의존성 주입 중복문제????
안녕하세요. 답변 감사합니다 그런데 Article 클래스의 AIdx에 해당하는 필드명이 아래 (사진) 이렇게 되어 있는데 어디가 문제가 있을까요
- 0
- 7
- 9.1K
질문&답변
2021.06.28
h2 database 연결이 안되요
199 버전으로 시도를 했는데 계속해서 이러한 에러가 발생합니다. 그리고 embeded도 해서 db을 만들고 localhost:8080 tcp 테스트까지는 되는데 정작 jpashop에서는 에러가 나옵니다. 그전에는 200으로 잘되었는데 db설정을 하면서 안되었습니다.
- 0
- 4
- 534