У меня ошибка в моем servlet-context.xml. Он говорит, что он может найти ниже классы, но они действительно существуют в папке projecct.java.lang.ClassNotFoundException: com.springhibernatemvc.dao.PersonDAOImpl
<beans:bean id="personDAO" class="com.springhibernatemvc.dao.PersonDAOImpl">
<beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory" />
</beans:bean>
<beans:bean id="personService" class="com.springbibernate.services.PersonServiceImpl">
<beans:property name="personDAO" ref="personDAO"></beans:property>
</beans:bean>
Он говорит, что этот класс не найден
- Class 'com.springbibernate.services.PersonServiceImpl'
Мой файл сервлет-контекст также определен в моем файле web.xml
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Я добавление сервлета-контекст .xml в корневую папку моего веб-приложения, но все еще существует ошибка.
Полная StackTrace
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.springhibernatemvc.dao.PersonDAOImpl] for bean with name 'personDAO' defined in ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]; nested exception is java.lang.ClassNotFoundException: com.springhibernatemvc.dao.PersonDAOImpl
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.springhibernatemvc.dao.PersonDAOImpl] for bean with name 'personDAO' defined in ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]; nested exception is java.lang.ClassNotFoundException: com.springhibernatemvc.dao.PersonDAOImpl
Что может быть не так?
Я фактически скорректированной, но это не сработало – Blaze
классы присутствуют в WEB-INF папку – Blaze
Confirm это то, что вы ищете WEB-INF/classes/com/springhibernatemvc/dao/PersonDAOImpl.class, а также вы можете вставить последнее сообщение об ошибке. –