问答详情
源自:3-7 JSP文件说明

这是什么错呀,老师,没有引错包,还是找不到实体


严重: Servlet.service() for servlet [SpringMVC] in context with path [/SSH2] threw exception [Request processing failed; nested exception is org.hibernate.MappingException: Unknown entity: Person.class] with root cause

org.hibernate.MappingException: Unknown entity: Person.class

at org.hibernate.internal.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:1096)

at org.hibernate.internal.SessionImpl.getOuterJoinLoadable(SessionImpl.java:1758)

at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1663)

at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:380)

at com.imooc.ssh.dao.PersonDao.getPerson(PersonDao.java:30)

at com.imooc.ssh.service.PersonService.getPerson(PersonService.java:21)

at com.imooc.ssh.service.PersonService$$FastClassBySpringCGLIB$$e55347e5.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)

at com.imooc.ssh.service.PersonService$$EnhancerBySpringCGLIB$$cd70b298.getPerson(<generated>)

at com.imooc.ssh.controller.PersonController.getPerson(PersonController.java:27)

这是什么错呀,包也没引错



提问者:慕慕2096226 2018-11-07 16:17

个回答

  • 小啦同学
    2019-05-12 20:03:20

    或许忘记写注解了?

  • PrinceDarkHorse
    2018-11-14 16:10:11

    PersonService.java:21  这个类的21行有错,去看一下