질문&답변
빌드하고 실행하기 gradlew build 에러 ㅠㅠ
gradlew build 시 나오는 에러입니다. 기본적으로 소스코드를 컴파일 못하는데요? 인텔리제에서는 잘 돌아갔었는데요.. D:\SpringTest\saproject>gradlew build > Task :compileJava FAILED D:\SpringTest\saproject\src\main\java\com\example\saproject\controller\ArticleController.java:41: error: cannot find symbol return "redirect:/articles/" + saved.getId(); ^ symbol: method getId() location: variable saved of type Article D:\SpringTest\saproject\src\main\java\com\example\saproject\controller\ArticleController.java:95: error: cannot find symbol Article target = articleRepository.findById(articleEntity.getId()).orElse(null); ^ symbol: method getId() location: variable articleEntity of type Article D:\SpringTest\saproject\src\main\java\com\example\saproject\controller\ArticleController.java:103: error: cannot find symbol return "redirect:/articles/" + articleEntity.getId(); ^ symbol: method getId() location: variable articleEntity of type Article D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\ArticleForm.java:30: error: constructor Article in class Article cannot be applied to given types; return new Article(id, title, content); ^ required: no arguments found: Long,String,String reason: actual and formal argument lists differ in length D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:30: error: cannot find symbol if (dto.getId() != null) ^ symbol: method getId() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:32: error: cannot find symbol if (dto.getArticleId() != article.getId()) ^ symbol: method getArticleId() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:32: error: cannot find symbol if (dto.getArticleId() != article.getId()) ^ symbol: method getId() location: variable article of type Article D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:36: error: cannot find symbol dto.getId(), ^ symbol: method getId() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:38: error: cannot find symbol dto.getNickname(), ^ symbol: method getNickname() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:39: error: cannot find symbol dto.getBody() ^ symbol: method getBody() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:45: error: cannot find symbol if ( this.id != dto.getId()) ^ symbol: method getId() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:48: error: cannot find symbol if (dto.getNickname() != null) ^ symbol: method getNickname() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:49: error: cannot find symbol this.nickname = dto.getNickname(); ^ symbol: method getNickname() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:50: error: cannot find symbol if (dto.getBody() != null) ^ symbol: method getBody() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:51: error: cannot find symbol this.body = dto.getBody(); ^ symbol: method getBody() location: variable dto of type CommentDto D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\CommentDto.java:23: error: cannot find symbol comment.getId(), ^ symbol: method getId() location: variable comment of type Comment D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\CommentDto.java:24: error: cannot find symbol comment.getArticle().getId(), ^ symbol: method getArticle() location: variable comment of type Comment D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\CommentDto.java:25: error: cannot find symbol comment.getNickname(), ^ symbol: method getNickname() location: variable comment of type Comment D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\CommentDto.java:26: error: cannot find symbol comment.getBody() ^ symbol: method getBody() location: variable comment of type Comment 19 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed; see the compiler error output for details. * 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 4s 1 actionable task: 1 executed
- 좋아요수
- 0
- 댓글수
- 5
- 조회수
- 5581





