javax.el.ELException: Cannot convert [sql] of type [class java.lang.String] to [class java.lang.Lon

之前项目一直是正常的,最近添加了一些数据,结果点击资源列表就报错了。

org.apache.jasper.JasperException: javax.el.ELException: Cannot convert [sql] of type [class java.lang.String] to [class java.lang.Long]

Message javax.el.ELException: Cannot convert [sql] of type [class java.lang.String] to [class java.lang.Long]

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.apache.jasper.JasperException: javax.el.ELException: Cannot convert [sql] of type [class java.lang.String] to [class java.lang.Long]
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:579)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:495)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:209)
	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:266)
	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1225)
	org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1012)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
	Root Cause

javax.el.ELException: Cannot convert [sql] of type [class java.lang.String] to [class java.lang.Long]
	org.apache.el.lang.ELSupport.coerceToNumber(ELSupport.java:400)
	org.apache.el.lang.ELSupport.coerceToNumber(ELSupport.java:379)
	org.apache.el.lang.ELSupport.equals(ELSupport.java:172)
	org.apache.el.parser.AstEqual.getValue(AstEqual.java:39)
	org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
	org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:944)
	org.apache.jsp.WEB_002dINF.admin.resource.resource1_jsp._jspx_meth_c_005fwhen_005f0(resource1_jsp.java:463)
	org.apache.jsp.WEB_002dINF.admin.resource.resource1_jsp._jspx_meth_c_005fchoose_005f0(resource1_jsp.java:424)
	org.apache.jsp.WEB_002dINF.admin.resource.resource1_jsp._jspx_meth_c_005fforEach_005f0(resource1_jsp.java:351)
	org.apache.jsp.WEB_002dINF.admin.resource.resource1_jsp._jspService(resource1_jsp.java:250)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:209)
	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:266)
	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1225)
	org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1012)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
Note The full stack trace of the root cause is available in the server logs.

最后是因为,数据库表在设计的时候考虑不周全。设置字段类型为varchar,长度为10.
javax.el.ELException: Cannot convert [sql] of type [class java.lang.String] to [class java.lang.Lon_第1张图片
最后将长度由11改为255,就解决了。

你可能感兴趣的:(javax.el.ELException: Cannot convert [sql] of type [class java.lang.String] to [class java.lang.Lon)