org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: Unknown column 'viewpoint' in 'field list'
问题描述:当我在model中添加了一下代码以后数据库报错:
添加的代码为:
private Viewpoint viewpoint; public Viewpoint getViewpoint() {
return viewpoint;
} public void setViewpoint(Viewpoint viewpoint) {
this.viewpoint = viewpoint;
}
错误信息为:
-- ::56.473 [http-nio--exec-] ERROR [CsrfFilter:] - doFilter
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'viewpoint' in 'field list'
### The error may exist in com/bim/bdip/cloud/home/mapper/BimWorkflowCollisionMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id_ AS id,viewpoint,guid,workflow_id AS workflowId,zybh,lbbh,yzdjbh,sjzy,zxwz,lcbh,tzhz,th,wtms,yhjy,sjtxgyj,mxyzyj,vp_id AS vpId,vp_picture AS vpPicture,ex_field1 AS exField1,ex_field2 AS exField2,ex_field3 AS exField3,ex_field4 AS exField4,enable_ AS `enable`,remark_ AS remark,create_by AS createBy,create_time AS createTime,update_by AS updateBy,update_time AS updateTime FROM bim_workflow_collision WHERE (workflow_id=?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'viewpoint' in 'field list'
; bad SQL grammar []; nested exception is java.lang.Throwable: Unknown column 'viewpoint' in 'field list'
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:) ~[spring-webmvc-5.0..RC3.jar:5.0..RC3]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:) ~[spring-webmvc-5.0..RC3.jar:5.0..RC3]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:) ~[servlet-api.jar:?]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:) ~[spring-webmvc-5.0..RC3.jar:5.0..RC3]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:) ~[servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[catalina.jar:8.5.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[catalina.jar:8.5.]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:) ~[tomcat-websocket.jar:8.5.]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[catalina.jar:8.5.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[catalina.jar:8.5.]
at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:) ~[spring-session-2.0..M2.jar:?]
at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) ~[spring-session-2.0..M2.jar:?]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:) ~[spring-web-5.0..RC3.jar:5.0..RC3]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:) ~[spring-web-5.0..RC3.jar:5.0..RC3]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[catalina.jar:8.5.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[catalina.jar:8.5.]
at com.bim.bdip.cloud.home.core.filter.XssFilter.doFilter(XssFilter.java:) ~[bim-bdip-cloud-home-common-1.1..jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[catalina.jar:8.5.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[catalina.jar:8.5.]
at com.bim.bdip.cloud.home.core.filter.CsrfFilter.doFilter(CsrfFilter.java:) [bim-bdip-cloud-home-common-1.1..jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [catalina.jar:8.5.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [catalina.jar:8.5.]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:) [spring-web-5.0..RC3.jar:5.0..RC3]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) [spring-web-5.0..RC3.jar:5.0..RC3]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) [catalina.jar:8.5.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) [catalina.jar:8.5.]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:) [catalina.jar:8.5.]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:) [catalina.jar:8.5.]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:) [catalina.jar:8.5.]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:) [catalina.jar:8.5.]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:) [catalina.jar:8.5.]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:) [catalina.jar:8.5.]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:) [catalina.jar:8.5.]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:) [catalina.jar:8.5.]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:) [tomcat-coyote.jar:8.5.]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:) [tomcat-coyote.jar:8.5.]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:) [tomcat-coyote.jar:8.5.]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:) [tomcat-coyote.jar:8.5.]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:) [tomcat-coyote.jar:8.5.]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:) [?:1.8.0_131]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:) [tomcat-util.jar:8.5.]
at java.lang.Thread.run(Thread.java:) [?:1.8.0_131]
Caused by: org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'viewpoint' in 'field list'
### The error may exist in com/bim/bdip/cloud/home/mapper/BimWorkflowCollisionMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id_ AS id,viewpoint,guid,workflow_id AS workflowId,zybh,lbbh,yzdjbh,sjzy,zxwz,lcbh,tzhz,th,wtms,yhjy,sjtxgyj,mxyzyj,vp_id AS vpId,vp_picture AS vpPicture,ex_field1 AS exField1,ex_field2 AS exField2,ex_field3 AS exField3,ex_field4 AS exField4,enable_ AS `enable`,remark_ AS remark,create_by AS createBy,create_time AS createTime,update_by AS updateBy,update_time AS updateTime FROM bim_workflow_collision WHERE (workflow_id=?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'viewpoint' in 'field list'
; bad SQL grammar []; nested exception is java.lang.Throwable: Unknown column 'viewpoint' in 'field list'
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:) ~[spring-jdbc-5.0..RC3.jar:5.0..RC3]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:) ~[spring-jdbc-5.0..RC3.jar:5.0..RC3]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:) ~[mybatis-spring-1.3..jar:1.3.]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:) ~[mybatis-spring-1.3..jar:1.3.]
at com.sun.proxy.$Proxy52.selectList(Unknown Source) ~[?:?]
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:) ~[mybatis-spring-1.3..jar:1.3.]
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:) ~[mybatis-3.4..jar:3.4.]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:) ~[mybatis-3.4..jar:3.4.]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:) ~[mybatis-3.4..jar:3.4.]
at com.sun.proxy.$Proxy93.selectList(Unknown Source) ~[?:?]
at com.bim.bdip.cloud.home.service.BimWorkflowDetailService.getBimWorkflowInfoById(BimWorkflowDetailService.java:) ~[?:?]
at com.bim.bdip.cloud.home.service.BimWorkflowDetailService$$FastClassBySpringCGLIB$$ad33165e.invoke(<generated>) ~[?:?]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:) ~[spring-core-5.0..RC3.jar:5.0..RC3]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:) ~[spring-aop-5.0..RC3.jar:5.0..RC3]
at com.bim.bdip.cloud.home.service.BimWorkflowDetailService$$EnhancerBySpringCGLIB$$ac4e3918.getBimWorkflowInfoById(<generated>) ~[?:?]
at com.bim.bdip.cloud.home.service.BimWorkflowDetailService$$EnhancerBySpringCGLIB$$ac4e3918MethodAccess.invoke(Unknown Source) ~[?:?]
at com.esotericsoftware.reflectasm.MethodAccess.invoke(MethodAccess.java:) ~[reflectasm-1.09.jar:?]
at com.bim.bdip.cloud.home.core.util.InstanceUtil.invokeMethod(InstanceUtil.java:) ~[bim-bdip-cloud-home-common-1.1..jar:?]
at com.bim.bdip.cloud.home.core.base.BaseProviderImpl.execute(BaseProviderImpl.java:) ~[bim-bdip-cloud-home-common-1.1..jar:?]
at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:) ~[?:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:) ~[?:1.8.0_131]
at com.weibo.api.motan.rpc.DefaultProvider.invoke(DefaultProvider.java:) ~[motan-core-0.3..jar:?]
at com.weibo.api.motan.rpc.AbstractProvider.call(AbstractProvider.java:) ~[motan-core-0.3..jar:?]
at com.weibo.api.motan.transport.ProviderMessageRouter.call(ProviderMessageRouter.java:) ~[motan-core-0.3..jar:?]
at com.weibo.api.motan.transport.ProviderProtectedMessageRouter.call(ProviderProtectedMessageRouter.java:) ~[motan-core-0.3..jar:?]
at com.weibo.api.motan.transport.ProviderMessageRouter.handle(ProviderMessageRouter.java:) ~[motan-core-0.3..jar:?]
at com.weibo.api.motan.transport.support.DefaultRpcHeartbeatFactory$HeartMessageHandleWrapper.handle(DefaultRpcHeartbeatFactory.java:) ~[motan-core-0.3..jar:?]
at com.weibo.api.motan.transport.netty.NettyChannelHandler.processRequest(NettyChannelHandler.java:) ~[motan-transport-netty-0.3..jar:?]
at com.weibo.api.motan.transport.netty.NettyChannelHandler.access$(NettyChannelHandler.java:) ~[motan-transport-netty-0.3..jar:?]
at com.weibo.api.motan.transport.netty.NettyChannelHandler$.run(NettyChannelHandler.java:) ~[motan-transport-netty-0.3..jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:) ~[?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:) ~[?:1.8.0_131]
... more
Caused by: java.lang.Throwable: Unknown column 'viewpoint' in 'field list'
原因是mybatis查询以后在数据库找不到这个字段,所以报错了。
解决:
在private ViewPoint viewpoint;加上@TableField(exist = false)这个注解就可以了
@TableField(exist = false)
private Viewpoint viewpoint; public Viewpoint getViewpoint() {
return viewpoint;
} public void setViewpoint(Viewpoint viewpoint) {
this.viewpoint = viewpoint;
}
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: Unknown column 'viewpoint' in 'field list'的更多相关文章
- org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jboss.resteasy.plug
之前做的项目是resteasy的上传,代码没有问题,断点都不进来呢. 我以为可以直接移植到SpringMVC,但是SpringMVC不支持MultipartFormDataInput , 用Multi ...
- error:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
问题:调用的方法在一个接口类中,但我并没有注入那个被调用的类 解决:在UserEntity前加上@Autowired @Controller public class MainController { ...
- org.springframework.web.util.NestedServletException : Handler processing failed; nested exception is java.lang.StackOverflowError
1 ,错误原因,循环冗余检查 result.setNearUsers(userList); Page page = new Page(); pag ...
- Tomcat服务org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: Java heap space
一个运行了很久的项目,最近忽然报错:OOM( java.lang.OutOfMemoryError: Java heap space),异常如下 org.springframework.web.uti ...
- Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed
在使用SpringMVC绑定基本类型(如String,Integer等)参数时,应通过@RequestParam注解指定具体的参数名称,否则,当源代码在非debug模式下编译后,运行时会引发Handl ...
- 部署项目到linux中报Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed
@RequestMapping(value = "/security/login", method = RequestMethod.POST) public ModelAndVie ...
- HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGram
HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGram ...
- Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Multiple representations of the same entity解决方法
1.错误信息 Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUs ...
- 【java异常】org.springframework.web.util.NestedServletException: Handler processing failed;Can't connect to X11 window server using 'localhost:10.0' as the value of th
tomcat工程中创建二维码失败.抛出异常Can't connect to X11 window server using 'localhost:10.0' as the value of th 因为 ...
随机推荐
- (转)Unity3d使用心得(1):ModelImporter的使用、在代码中添加动画片段。
在使用 Unity3d 倒入Fbx模型的时候,动画的动画片段需要自己手动添加模型多了以后会是一个不小的工作量. Unity3d支持 编辑器脚本来控制资源导入的过程.添加一个 AssetPostproc ...
- 六. 异常处理6.try语句的嵌套
Try语句可以被嵌套.也就是说,一个try语句可以在另一个try块内部.每次进入try语句,异常的前后关系都会被推入堆栈.如果一个内部的try语句不含特殊异常的catch处理程序,堆栈将弹出,下一个t ...
- android中的开机自启动
android中的开机自启动 android中的开机自启动可分为两步: 1.写一个BroadcastReceiver: public class BootReceiver extends Broadc ...
- Orchard EventBus 事件总线及 IEventHandler作用
事件总线接口定义: public interface IEventBus : IDependency { IEnumerable Notify(string messageName, IDiction ...
- A Beginner’s Guide to the OUTPUT Clause in SQL Server
原文 A Beginner’s Guide to the OUTPUT Clause in SQL Server T-SQL supports the OUTPUT clause after the ...
- Understanding Memory Technology Devices in Embedded Linux
转: NAND Chip Drivers NAND technology users such as USB pen drives, DOMs, Compact Flash memory, and S ...
- HashMap在高并发下引起的死循环
HashMap事实上并非线程安全的,在高并发的情况下,是非常可能发生死循环的,由此造成CPU 100%,这是非常可怕的.所以在多线程的情况下,用HashMap是非常不妥当的行为,应採用线程安全类Con ...
- ES6里的解构赋值
我们经常定义许多对象和数组,然后有组织地从中提取相关的信息片段.在ES6中添加了可以简化这种任务的新特性:解构.解构是一种打破数据结构,将其拆分为更小部分的过程. 一.引入背景 在ES5中,开发者们为 ...
- Java 7 新功能: 省略finally, 保证资源正常关闭
class MyResource implements Closeable{ @Override public void close() throw IOException{ } } try( myR ...
- shell中set命令
set命令作用主要是显示系统中已经存在的shell变量,以及设置shell变量的新变量值.set命令不能够定义新的shell变量.如果要定义新的变量,可以使用declare命令以变量名=值的格式进行定 ...