인프런 커뮤니티 질문&답변

감귤님의 프로필 이미지
감귤

작성한 질문수

스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술

JSP로 회원 관리 웹 애플리케이션 만들기

save.jsp 오류

작성

·

883

·

수정됨

0

[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? 예
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예
3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예

[질문 내용]
여기에 질문 내용을 남겨주세요.

new-form.jsp는 잘 접속이 되는데

전송을 누르면 아래와 같이 오류가 발생합니다.

"C:\Program Files\Java\jdk-17.0.2\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.2\lib\idea_rt.jar=64020:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\user\Desktop\여름방학\mvc1\servlet\servlet\out\production\classes;C:\Users\user\Desktop\여름방학\mvc1\servlet\servlet\out\production\resources;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\3.0.6\d0b6b836a6e3a223a92e6594c2d8c5f0a7cccec\spring-boot-starter-data-jpa-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\3.0.6\7c6597cae584c359d7e4ddea6e006176e0c15936\spring-boot-starter-web-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\2.1.1\48b9bda22b091b1f48b13af03fe36db3be6e1ae3\jakarta.annotation-api-2.1.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\3.1.0\66901fa1c373c6aff65c13791cc11da72060a8d6\jakarta.persistence-api-3.1.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.github.gavlyukovskiy\p6spy-spring-boot-starter\1.9.0\b51740224ed4f0cdca7ba93fe9167e7b97064f41\p6spy-spring-boot-starter-1.9.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.querydsl\querydsl-jpa\5.0.0\2a653852848dee41b967d3520be3339f0f92f1ea\querydsl-jpa-5.0.0-jakarta.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-jasper\10.1.8\eefcfd4e175ca6a6db9fc1444bf452ebcf2956a0\tomcat-embed-jasper-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.servlet.jsp.jstl\jakarta.servlet.jsp.jstl-api\3.0.0\8ace30b09ce88dc6f19d4f59251cc83a23cc180a\jakarta.servlet.jsp.jstl-api-3.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.servlet\jakarta.servlet-api\6.0.0\abecc699286e65035ebba9844c03931357a6a963\jakarta.servlet-api-6.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.glassfish.web\jakarta.servlet.jsp.jstl\3.0.1\78909a1354585b2a7a2d3b4e348fceff8b6d180\jakarta.servlet.jsp.jstl-3.0.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\3.0.5\84987fbd727eb0cf2f164dd07fe2bd697ddde8f1\spring-data-jpa-3.0.5.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\3.0.6\bb39de062db9b7b7a277e6c026ed5ac45f544fc8\spring-boot-starter-aop-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\3.0.6\672661f4a90a9479170fba058a88892dac5ba69c\spring-boot-starter-jdbc-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.hibernate.orm\hibernate-core\6.1.7.Final\343f47b34c96fe9c44bf9b219a7b3c5d6d2fc90e\hibernate-core-6.1.7.Final.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\6.0.8\53e6f4b4136b40cc0a7137fb05e38b45c2c286fe\spring-aspects-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\3.0.6\e0a1dd1653750a8e0a25b7b6be977231d7fa607e\spring-boot-starter-json-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\3.0.6\1029c155da41fa04820cf81fdbe5752260eead5\spring-boot-starter-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\3.0.6\feae12210905b6cb7ce8affce4f309665c4a805b\spring-boot-starter-tomcat-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\6.0.8\10b9481118ecf8ae9dc6f9fb47f95ed6da0e43e\spring-webmvc-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\6.0.8\b2d3643c5dd191b07c642adca0de40c303bb7505\spring-web-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.github.gavlyukovskiy\datasource-decorator-spring-boot-autoconfigure\1.9.0\831a15b04e176cd41c0539cda6194ac3e6b715ff\datasource-decorator-spring-boot-autoconfigure-1.9.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\p6spy\p6spy\3.9.0\7fedf78cc1e53a623a7b36d1f2705790836400aa\p6spy-3.9.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.querydsl\querydsl-core\5.0.0\7a469f78b7a89bae429f17766fb92687d0ab9e5b\querydsl-core-5.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\10.1.8\ec4b884806c65c80c86bb3db134f6f6f99e79ed8\tomcat-embed-core-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\10.1.8\6f3a4ae2ae37270eeb6e9bec4e7207facdc9e8fa\tomcat-embed-el-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.eclipse.jdt\ecj\3.33.0\4041d27ffea3c9351e3121f9bfe94dea4723d583\ecj-3.33.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.el\jakarta.el-api\5.0.0\2a22b304920f43d6427cdefb5ce5f6726e2a63a3\jakarta.el-api-5.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\6.0.8\4550c5e2bbb8cd07647b1b29b47c73cf4732de8c\spring-context-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\6.0.8\36c4cf00bab58bbcd60134a154e290185fa71bfa\spring-aop-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\6.0.8\97d41b8e4e9823e611cd49aa10730c4055720cb4\spring-orm-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\3.0.5\bd41ef8c15f83b2dcd699e358f6565d650280a0a\spring-data-commons-3.0.5.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\6.0.8\d12a11ae6a6a6cb76bcbbf2d496abd25adac4a98\spring-tx-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\6.0.8\86393eaf6ace0a84aeb42d3bebaa3c0a660deaed\spring-beans-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\6.0.8\70c3748212ba1a64978e4ed1a3e5050204f1fe15\spring-core-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\2.0.7\41eb7184ea9d556f23e18b5cb99cad1f8581fc00\slf4j-api-2.0.7.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.19\afbffb1210239fbba5cad73093c5b216d515838f\aspectjweaver-1.9.19.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\5.0.1\a74c7f0a37046846e88d54f7cb6ea6d565c65f9c\HikariCP-5.0.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\6.0.8\3f8e24e37d4ab6982c3979a6d19955023f93f145\spring-jdbc-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\2.0.1\51a520e3fae406abb84e2e1148e6746ce3f80a1a\jakarta.transaction-api-2.0.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.14.2\796518148a385b2728d44886cc0f8852eb8eeb53\jackson-datatype-jsr310-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.14.2\2b6c19b3d99dda02915515df879ab9e23fed3864\jackson-module-parameter-names-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.14.2\2f3c71211b6ea7a978eba33574d7135d536e07fb\jackson-datatype-jdk8-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.14.2\1e71fddbc80bb86f71a6345ac1e8ab8a00e7134\jackson-databind-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\3.0.6\8ccd83b2530c96595f92b4e07c1bb17560bfba8b\spring-boot-autoconfigure-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\3.0.6\95ac2c7aa28fcdef587b2c4f554016f8b9af624\spring-boot-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\3.0.6\fbbba25bd9870f9a85dd282133019750b79ad9eb\spring-boot-starter-logging-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.33\2cd0a87ff7df953f810c344bdf2fe3340b954c69\snakeyaml-1.33.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\10.1.8\7abb8ab966dd135924c8e69cb2f1db735dee5f23\tomcat-embed-websocket-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\6.0.8\2e4f2132fbf168e716a618442d6100b71a0e95f9\spring-expression-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-observation\1.10.6\2026f75e43d1354530d70be6e88221a46d696ca8\micrometer-observation-1.10.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.mysema.commons\mysema-commons-lang\0.2.4\d09c8489d54251a6c22fbce804bdd4a070557317\mysema-commons-lang-0.2.4.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat\tomcat-annotations-api\10.1.8\1f26901ba8b329a65d063c15c81fd9c757b64feb\tomcat-annotations-api-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\6.0.8\72aa4dd5eaaede821d3f2ec856c2365c2042a326\spring-jcl-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.14.2\a7aae9525864930723e3453ab799521fdfd9d873\jackson-annotations-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.14.2\f804090e6399ce0cf78242db086017512dd71fcc\jackson-core-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.4.7\307944865579a6d490e6a4cbb5082dc8f36536ca\logback-classic-1.4.7.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.19.0\30f4812e43172ecca5041da2cb6b965cc4777c19\log4j-to-slf4j-2.19.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\2.0.7\a48f44aeaa8a5ddc347007298a28173ac1fbbd8b\jul-to-slf4j-2.0.7.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-commons\1.10.6\ddbcbabad244c79537c918422ad3ba66e1a773b4\micrometer-commons-1.10.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.4.7\a2948dae4013d0e9486141b4d638d8951becb767\logback-core-1.4.7.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.19.0\ea1b37f38c327596b216542bc636cfdc0b8036fa\log4j-api-2.19.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.h2database\h2\2.1.214\d5c2005c9e3279201e12d4776c948578b16bf8b2\h2-2.1.214.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.5.0.Final\c19307cc11f28f5e2679347e633a3294d865334d\jboss-logging-3.5.0.Final.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\6.0.6.Final\77a5f94b56d49508e0ee334751db5b78e5ccd50c\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.4.2.Final\1e1c385990b258ff1a24c801e84aebbacf70eb39\jandex-2.4.2.Final.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.5.1\3fe0bed568c62df5e89f4f174c101eab25345b6c\classmate-1.5.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.12.23\d470526e8c4566c04e9ae5d3ccb62d1a7aa58986\byte-buddy-1.12.23.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\4.0.2\e4e4e0c5b0d42054d00dc4023901572a60d368c7\jaxb-runtime-4.0.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\4.0.0\bbb399208d288b15ec101fa4fcfc4bd77cedc97a\jakarta.xml.bind-api-4.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.inject\jakarta.inject-api\2.0.0\46fc8560b6fd17b78396d88f39c1a730457671f0\jakarta.inject-api-2.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.antlr\antlr4-runtime\4.10.1\10839f875928f59c622d675091d51a43ea0dc5f7\antlr4-runtime-4.10.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-core\4.0.2\8c29249f6c10f4ee08967783831580b0f5c5360\jaxb-core-4.0.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\2.1.1\88c774ab863a21fb2fc4219af95379fafe499a31\jakarta.activation-api-2.1.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.eclipse.angus\angus-activation\2.0.0\72369f4e2314d38de2dcbb277141ef0226f73151\angus-activation-2.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\4.0.2\24e167be69c29ebb7ee0a3b1f9b546f1dfd111fc\txw2-4.0.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\4.1.1\9b3769c76235bc283b060da4fae2318c6d53f07e\istack-commons-runtime-4.1.1.jar hello.servlet.ServletApplication

. ____ _

/\\ / ___'_ __ (_)_ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

\\/ ___)| |_)| | | | | || (_| | ) ) ) )

' |____| .__|_| |_|_| |_\__, | / / / /

=========|_|==============|___/=/_/_/_/

:: Spring Boot :: (v3.0.6)

2023-07-10T21:21:29.054+09:00 INFO 18224 --- [ main] hello.servlet.ServletApplication : Starting ServletApplication using Java 17.0.2 with PID 18224 (C:\Users\user\Desktop\여름방학\mvc1\servlet\servlet\out\production\classes started by user in C:\Users\user\Desktop\여름방학\mvc1\servlet\servlet)

2023-07-10T21:21:29.057+09:00 INFO 18224 --- [ main] hello.servlet.ServletApplication : No active profile set, falling back to 1 default profile: "default"

2023-07-10T21:21:29.690+09:00 INFO 18224 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.

2023-07-10T21:21:29.722+09:00 INFO 18224 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 21 ms. Found 0 JPA repository interfaces.

2023-07-10T21:21:30.369+09:00 INFO 18224 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)

2023-07-10T21:21:30.380+09:00 INFO 18224 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]

2023-07-10T21:21:30.380+09:00 INFO 18224 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.8]

2023-07-10T21:21:30.613+09:00 INFO 18224 --- [ main] org.apache.jasper.servlet.TldScanner : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

2023-07-10T21:21:30.622+09:00 INFO 18224 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext

2023-07-10T21:21:30.623+09:00 INFO 18224 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1515 ms

2023-07-10T21:21:30.874+09:00 INFO 18224 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...

2023-07-10T21:21:31.055+09:00 INFO 18224 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:2a429fff-9c3c-4c40-906c-f7cb210a3f6a user=SA

2023-07-10T21:21:31.057+09:00 INFO 18224 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.

2023-07-10T21:21:31.109+09:00 INFO 18224 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]

2023-07-10T21:21:31.171+09:00 INFO 18224 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.1.7.Final

2023-07-10T21:21:31.473+09:00 INFO 18224 --- [ main] SQL dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect

2023-07-10T21:21:31.720+09:00 INFO 18224 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]

2023-07-10T21:21:31.734+09:00 INFO 18224 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'

2023-07-10T21:21:31.767+09:00 WARN 18224 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning

2023-07-10T21:21:31.964+09:00 INFO 18224 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: ServletContext resource [/index.html]

2023-07-10T21:21:32.242+09:00 INFO 18224 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''

2023-07-10T21:21:32.251+09:00 INFO 18224 --- [ main] hello.servlet.ServletApplication : Started ServletApplication in 3.565 seconds (process running for 3.966)

2023-07-10T21:21:38.052+09:00 DEBUG 18224 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [0]

2023-07-10T21:21:38.053+09:00 DEBUG 18224 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Received [POST /jsp/members/save.jsp HTTP/1.1

Host: localhost:8080

Connection: keep-alive

Content-Length: 19

Cache-Control: max-age=0

sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"

sec-ch-ua-mobile: ?0

sec-ch-ua-platform: "Windows"

Upgrade-Insecure-Requests: 1

Origin: http://localhost:8080

Content-Type: application/x-www-form-urlencoded

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7

Sec-Fetch-Site: same-origin

Sec-Fetch-Mode: navigate

Sec-Fetch-User: ?1

Sec-Fetch-Dest: document

Referer: http://localhost:8080/jsp/members/new-form.jsp

Accept-Encoding: gzip, deflate, br

Accept-Language: ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7

Cookie: JSESSIONID=3F23CBF50B03D193E74C819FC83D3488

username=kim&age=20]

2023-07-10T21:21:38.623+09:00 ERROR 18224 --- [nio-8080-exec-1] o.a.c.c.C.[.[localhost].[/].[jsp] : Servlet.service() for servlet [jsp] in context with path [] threw exception [Unable to compile class for JSP:

An error occurred at line: [14] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.1494250641129783002\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]

Only a type can be imported. hello.servlet.domain.member.MemberRepository resolves to a package

An error occurred at line: [15] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.1494250641129783002\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]

Only a type can be imported. hello.servlet.domain.member.Member resolves to a package

An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]

MemberRepository cannot be resolved to a type

3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>

4: <%

5: // request, response 사용 가능

6: MemberRepository memberRepository = MemberRepository.getInstance();

7: System.out.println("save.jsp");

8: String username = request.getParameter("username");

9: int age = Integer.parseInt(request.getParameter("age"));

An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]

MemberRepository cannot be resolved

3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>

4: <%

5: // request, response 사용 가능

6: MemberRepository memberRepository = MemberRepository.getInstance();

7: System.out.println("save.jsp");

8: String username = request.getParameter("username");

9: int age = Integer.parseInt(request.getParameter("age"));

An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]

Member cannot be resolved to a type

7: System.out.println("save.jsp");

8: String username = request.getParameter("username");

9: int age = Integer.parseInt(request.getParameter("age"));

10: Member member = new Member(username, age);

11: System.out.println("member = " + member);

12: memberRepository.save(member);

13: %>

An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]

Member cannot be resolved to a type

7: System.out.println("save.jsp");

8: String username = request.getParameter("username");

9: int age = Integer.parseInt(request.getParameter("age"));

10: Member member = new Member(username, age);

11: System.out.println("member = " + member);

12: memberRepository.save(member);

13: %>

Stacktrace:] with root cause

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [14] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.1494250641129783002\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]

Only a type can be imported. hello.servlet.domain.member.MemberRepository resolves to a package

An error occurred at line: [15] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.1494250641129783002\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]

Only a type can be imported. hello.servlet.domain.member.Member resolves to a package

An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]

MemberRepository cannot be resolved to a type

3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>

4: <%

5: // request, response 사용 가능

6: MemberRepository memberRepository = MemberRepository.getInstance();

7: System.out.println("save.jsp");

8: String username = request.getParameter("username");

9: int age = Integer.parseInt(request.getParameter("age"));

An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]

MemberRepository cannot be resolved

3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>

4: <%

5: // request, response 사용 가능

6: MemberRepository memberRepository = MemberRepository.getInstance();

7: System.out.println("save.jsp");

8: String username = request.getParameter("username");

9: int age = Integer.parseInt(request.getParameter("age"));

An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]

Member cannot be resolved to a type

7: System.out.println("save.jsp");

8: String username = request.getParameter("username");

9: int age = Integer.parseInt(request.getParameter("age"));

10: Member member = new Member(username, age);

11: System.out.println("member = " + member);

12: memberRepository.save(member);

13: %>

An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]

Member cannot be resolved to a type

7: System.out.println("save.jsp");

8: String username = request.getParameter("username");

9: int age = Integer.parseInt(request.getParameter("age"));

10: Member member = new Member(username, age);

11: System.out.println("member = " + member);

12: memberRepository.save(member);

13: %>

Stacktrace:

at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:213) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:513) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:402) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:372) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:396) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]

at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614) ~[jakarta.servlet-api-6.0.0.jar:6.0.0]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.8.jar:10.1.8]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.8.jar:6.0.8]

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.8.jar:6.0.8]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.8.jar:6.0.8]

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.8.jar:6.0.8]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.8.jar:6.0.8]

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.8.jar:6.0.8]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:166) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.8.jar:10.1.8]

at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

2023-07-10T21:21:38.633+09:00 INFO 18224 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'

2023-07-10T21:21:38.634+09:00 INFO 18224 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'

2023-07-10T21:21:38.635+09:00 INFO 18224 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms

2023-07-10T21:21:38.743+09:00 DEBUG 18224 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@53f4c2e:org.apache.tomcat.util.net.NioChannel@1e491a57:java.nio.channels.SocketChannel[connected local=/[0:0:0:0:0:0:0:1]:8080 remote=/[0:0:0:0:0:0:0:1]:64023]], Status in: [OPEN_READ], State out: [CLOSED]

 

 

답변 1

0

안녕하세요. 감귤님, 공식 서포터즈 OMG입니다.

save.jsp, MemberRepository, Member클래스 부분에서 문제가 있지 않나 예상이되는데요,

강의와 다른점이 없는지 확인해보시고 해결이 안될 경우 위 3개의 코드 전체를 복사하여 댓글 남겨주세요 :)

감사합니다.

감귤님의 프로필 이미지
감귤
질문자

다시 확인해봤는데 save.jsp, MemberRepository, Member에서 강의와 다른점은 없었습니다.

그리고 서블릿으로 회원가입을 하고 회원목록을 보는것 잘 되는것을 보면 MemberRepository, Member클래스 부분에는 문제가 없는것 같은데 왜 jsp로는 문제가 발생하는지 모르겠습니다.

@@ cannot be resolved to a type에 대해서 검색을 해봤는데도 잘 모르겠습니다.

 

감귤님의 프로필 이미지
감귤
질문자

package hello.servlet.domian.member;

import lombok.Getter;
import lombok.Setter;

@Getter @Setter
public class Member {
    private Long id;
    private String username;
    private int age;

    public Member() {
    }
    public Member(String username, int age) {
        this.username = username;
        this.age = age;
    }
}
감귤님의 프로필 이미지
감귤
질문자

package hello.servlet.domian.member;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MemberRepository {
    private static Map<Long, Member> store = new HashMap<>(); //static 사용
    private static long sequence = 0L; //static 사용

    private static final MemberRepository instance = new MemberRepository();

    public static MemberRepository getInstance() {
        return instance;
    }
    private MemberRepository() {
    }

    public Member save(Member member) {
        member.setId(++sequence);
        store.put(member.getId(), member);
        return member;
    }

    public Member findById(Long id) {
        return store.get(id);
    }

    public List<Member> findAll() {
        return new ArrayList<>(store.values());
    }
    public void clearStore() {
        store.clear();
    }

}
감귤님의 프로필 이미지
감귤
질문자

<%@ page import = "hello.servlet.domain.member.MemberRepository" %>
<%@ page import = "hello.servlet.domain.member.Member" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
// request, response 사용 가능
 MemberRepository memberRepository = MemberRepository.getInstance();
 System.out.println("save.jsp");
 String username = request.getParameter("username");
 int age = Integer.parseInt(request.getParameter("age"));
 Member member = new Member(username, age);
 System.out.println("member = " + member);
 memberRepository.save(member);
 %>
 <html>
 <head>
  <meta charset="UTF-8">
 </head>
 <body>
 성공
 <ul>
  <li>id=<%=member.getId()%></li>
  <li>username=<%=member.getUsername()%></li>
  <li>age=<%=member.getAge()%></li>
 </ul>
 <a href="/index.html">메인</a>
 </body>
 </html>
감귤님의 프로필 이미지
감귤
질문자

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [14] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.9062222886410470356\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]

Only a type can be imported. hello.servlet.domain.member.MemberRepository resolves to a package

An error occurred at line: [15] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.9062222886410470356\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]

Only a type can be imported. hello.servlet.domain.member.Member resolves to a package

이부분이 문제인거 같은데 해결이 안되네요...

 

 

image

첫번째 라인을 보면 패키지가 domain이 아닌, domian으로 되어 있네요 ^^

반면 import는 domain으로 하셨구요.

지금과 같은 오류는 실제 패키지 이름과 import 부분이 다른 경우에 종종 발생하여 확인요청 드렸었는데 동일한 이유인 것 같습니다

domian폴더(패키지)의 이름을 domain으로 변경해주세요 :)

image

 

 

감귤님의 프로필 이미지
감귤
질문자

메인 코드만 비교 했었는데 다음에는 더 자세히 살펴보겠습니다... 감사합니다.

강의 수강 중 강의관련 궁금한 사항은 언제든 질문 남겨주세요 :)

감귤님의 프로필 이미지
감귤

작성한 질문수

질문하기