find some information on the Internet, some say is a small jar package, the Spring jar package to copy to/web-inf/lib below the line, but this is the MAVEN project, do not need to do this ...
Another reason is that the project is not a MAVEN project, I was a regular web project, just added a pom.xml .
There are two places that need to be modified
1. project file, open with Notepad, add the following code (put the original < buildspec > nodes and < natures > replaced):
<buildSpec> <buildCommand> <name>org.eclipse.wst.jsdt.core.javascriptvalidator</na me> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </argumen ts> </buildCommand> <buildCommand> <name>org.eclipse.wst.common.project.face t.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <argu ments> </arguments> </buildCommand> <buildCommand> <name>or g.eclipse.m2e.core.maven2builder</name> <arguments> </arguments> </build Command> <bUildcommand> <name>org.maven.ide.eclipse.maven2Builder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.ma Ven.ide.eclipse.maven2nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature> & Lt;nature>org.eclipse.jem.workbench.javaemfnature</nature> <nature> Org.eclipse.wst.common.modulecore.modulecorenature</nature> <nature> Org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.jdt.core.javanature </nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature> </natures>
2. In the project root directory, locate the. classpath.
<classpathentry kind= "Con" path= "Org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
to be replaced by:
<classpathentry kind= "Con" path= "Org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER" > <attributes> <attribute name= "org.eclipse.jst.component.dependency" value= "/web-inf/lib"/> </attributes> </classpathentry>
Add a new classpathentry node:
<classpathentry kind= "Con" path= "Org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" > <attributes> <attribute name= "org.eclipse.jst.component.dependency" value= "/web-inf/lib"/> </attributes></ Classpathentry>
OK, to this step is finished, refresh the project into eclipse, then restart Tomcat, the error has been resolved!
in the. classpath file:
<classpathentry kind= "Output" path= "Target/classes"/>
instead:
<classpathentry kind= "Output" path= "Webcontent/web-inf/classes"/>
habit, ^_^, put the compiled file under Web-inf/classes
Maven Project appears java.lang.ClassNotFoundException