pom.xml
<properties>
	<!-- Generic properties -->
	<java.version>1.7</java.version>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<!-- Web -->
	<jsp.version>2.2</jsp.version>
	<jstl.version>1.2</jstl.version>
	<servlet.version>3.1.0</servlet.version>
	<!-- Spring -->
	<spring-framework.version>3.2.3.RELEASE</spring-framework.version>
	<!-- Hibernate / JPA -->
	<hibernate.version>4.2.1.Final</hibernate.version>
	<!-- Logging -->
	<logback.version>1.0.13</logback.version>
	<slf4j.version>1.7.5</slf4j.version>
	<!-- Test -->
	<junit.version>4.11</junit.version>
</properties>
Added two jar files to pom.xml
pom.xml
<!-- validation-api(Used for input value verification) -->
<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.1.0.Final</version>
</dependency>
<!-- Hibernate(Used for input value verification) -->
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>5.0.1.Final</version>
</dependency>
1, Servlet init () error
HTTP status 500-Servlet dispatcher Servlet Servlet.init()Threw an exception
type exception report
------------------------------------------------------------------------------------------
Message Servlet dispatcherServlet Servlet.init()Threw an exception
Description The server encountered an internal error that prevented it from fulfilling this request.
exception-------------------------------------------------------------------------------------------
javax.servlet.ServletException:Servlet dispatcher Servlet Servlet.init()Threw an exception
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.lang.Thread.run(Thread.java:745)
<!--Omitted below-->
2, @NotEmpty cannot be used
The cause is related to the version of the added jar file If you change pom.xml and update the project again, both will be resolved
pom.xml
<!-- validation-api(Used for input value verification) -->
<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>2.0.1.Final</version>
</dependency>
<!-- Hibernate(Used for input value verification) -->
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>5.3.4.Final</version>
</dependency>
This time I understood that it was related to the version, but I did not reach a fundamental solution, so I will reconsider it at another time
Recommended Posts