1. 程式人生 > >java web程式中報錯原因總結

java web程式中報錯原因總結

1.
FeedbackManagerTest.test_insert_success
initializationError(org.junit.runner.manipulation.Filter)
(問題原因:沒有在相應的測試方法上加@Test)



*********************************************************************************************************************************
2.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admin.manager.FeedbackManagerTest': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [admin.manager.FeedbackManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}

(問題原因:在ApplicationContext_test.xml中增加關於feedbackManager的bean)
**************************************************************************************************************************************


3.
 Cannot find class [admin.manager.impl。FeedbackManagerImpl] for bean with name 'feedbackManager' defined in class path resource [applicationContext-test.xml]; nested exception is java.lang.ClassNotFoundException: com.taobao.kelude.admin.manager.impl。FeedbackManagerImpl


(問題原因:寫類的路徑時.寫成了。)
*********************************************************


org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): admin.mapper.FeedbackMapper.insert
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:178)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:38)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)



(問題原因:在增加了對映檔案Feedback.xml,未在admin/dal/mybatis.xml中增加相應的對映到該對映檔案)
**********************************************************************************************************
4.
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'islike' in 'class com.taobao.kelude.admin.model.Feedback'

(問題原因:Feedback.java中的islike寫的是isLike,與Feedback.xml中的islike不一樣,無法自動注入)