Spring MVC classes not found
-
27-04-2021 - |
문제
I'm trying to run a Spring MVC project in STS with Tomcat 6.0 server. But I have these 2 errors which I can't resolve:
Class 'org.springframework.jdbc.datasource.DriverManagerDataSource' not found [config set: projectName/web-context] root-context.xml /projectName/src/main/webapp/WEB-INF/spring Spring Beans Problem
Class 'org.springframework.web.servlet.view.InternalResourceViewResolver' not found [config set: projectName/web-context] servlet-context.xml /projectName/src/main/webapp/WEB-INF/spring/appServlet Spring Beans Problem
I suspect this has to do with the build path. Any suggestions?
해결책
These problems were solved by right clicking project name in Package Explorer->Spring Tools->Add Spring Project Nature. (Don't know what really happened, only that problems were gone afterwards.)
다른 팁
For me it was resolved by disabling Maven Workspace Resolution. Most of these kind of minor issues were caused because of enabling Maven Workspace Resolution.
Id suggest to do yourself a favor by disabling it.
I had the same problem. I resolved this issue deleting this mapping in the spring config-file. The class didn't exist, but the mapping remained. The mapping was old. Delete the old mapping in the spring config-file and spring will work.