现在我收到了这个错误....我仍然不知道如何修复 ....请至少尝试解决这个错误...但是我不能处理 提前.. !!!!!!!!!
HTTP状态500 -
输入例外报告
消息
description服务器遇到阻止的内部错误() 它来自履行这一要求。
例外
org.springframework.web.util.NestedServletException:Request 处理失败;嵌套异常是java.lang.ClassCastException: java.lang.Integer无法强制转换为java.lang.Long org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
根本原因
java.lang.ClassCastException:java.lang.Integer无法强制转换为 java.lang.Long中 com.os.springjpa.controller.BookController.listPaging(BookController.java:102) sun.reflect.NativeMethodAccessorImpl.invoke0(原生方法) sun.reflect.NativeMethodAccessorImpl.invoke(未知来源) sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源) java.lang.reflect.Method.invoke(未知来源) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
注意Apache中提供了根本原因的完整堆栈跟踪 Tomcat / 6。0。20日志。
Apache Tomcat / 6.0.20
答案 0 :(得分:0)
它无法找到您的实体。将此添加到sessionFactory bean声明
<property name="annotatedClasses">
<list>
<value>com.os.springjpa.entity.Book</value>
</list>
</property>
创建更多带注释的实体时,根据需要添加更多值