Springmvc problem xxx is not mapped [from XX] or unknown Entity:com.spring.main.pojo.Person
It took a day till the wee hours to find a place not configured
At the beginning of the HQL statement is wrong, but found no, online search to search is said Pojo class name written in the table name, so that the low-level error may have, examined n times, found not, but why will still report the same error? This error was found when I used the Get method to get database records instead unknown Entity:com.spring.main.pojo.Person, later found that is not the mapping note is wrong, then what happened, depressed for a long time long, long time ......
Last start line look at the Spring config file, by the way, I found the datasourse need to scan this damn bean.
<property name= "Packagestoscan" value= "com.spring." ></property>
<!--configuration Sessionfactory--><bean id= "Sessionfactory" class= " Org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean "><property name=" DataSource " ref= "DataSource"/><!--start the annotation function of spring MVC, complete the mapping of the annotations Pojo No such sentence will not be used HQL inquiry, the error is reported without mapping--><property name= " Packagestoscan "value=" com.spring. " ></property><property name= "hibernateproperties" ><props><prop key= "Hibernate.dialect" >org.hibernate.dialect.oracledialect</prop><prop key= "Hibernate.show_sql" >true</prop>< Prop key= "Hibernate.generate_statistics" >true</prop></props></property></bean>
Problem solving
Springmvc problem xxx is not mapped [from XX] or unknown Entity:com.spring.main.pojo.Person