请求商品信息的时候显示500错误

来源:5-3 代码层读写分离的实现A

deerdevil

2019-04-08

<!doctype html><html><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: </p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>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 &#39;point&#39; in &#39;field list&#39;

### The error may exist in file [C:\Users\Alienware\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\o2o\WEB-INF\classes\mapper\ProductDao.xml]

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: SELECT   product_id,   product_name,   product_desc,   img_addr,   normal_price,   promotion_price,   priority,   create_time,   last_edit_time,   enable_status,   point,   product_category_id,   shop_id   FROM   tb_product    WHERE  shop_id = ?                         and enable_status = ?    ORDER BY   priority DESC   LIMIT ?,?;

### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column &#39;point&#39; in &#39;field list&#39;

; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column &#39;point&#39; in &#39;field list&#39;

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)

javax.servlet.http.HttpServlet.service(HttpServlet.java:635)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

</pre><p><b>Root Cause</b></p><pre>org.springframework.jdbc.BadSqlGrammarException: 

### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column &#39;point&#39; in &#39;field list&#39;

### The error may exist in file [C:\Users\Alienware\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\o2o\WEB-INF\classes\mapper\ProductDao.xml]

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: SELECT   product_id,   product_name,   product_desc,   img_addr,   normal_price,   promotion_price,   priority,   create_time,   last_edit_time,   enable_status,   point,   product_category_id,   shop_id   FROM   tb_product    WHERE  shop_id = ?                         and enable_status = ?    ORDER BY   priority DESC   LIMIT ?,?;

### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column &#39;point&#39; in &#39;field list&#39;

; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column &#39;point&#39; in &#39;field list&#39;

org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)

org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)

org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)

org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)

com.sun.proxy.$Proxy15.selectList(Unknown Source)

org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)

org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)

org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)

org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)

com.sun.proxy.$Proxy26.queryProductList(Unknown Source)

com.imooc.o2o.service.impl.ProductServiceImpl.getProductList(ProductServiceImpl.java:35)

sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy29.getProductList(Unknown Source)

com.imooc.o2o.web.frontend.ShopDetailController.listProductsByShop(ShopDetailController.java:88)

sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)

javax.servlet.http.HttpServlet.service(HttpServlet.java:635)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

</pre><p><b>Root Cause</b></p><pre>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column &#39;point&#39; in &#39;field list&#39;

sun.reflect.GeneratedConstructorAccessor43.newInstance(Unknown Source)

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

java.lang.reflect.Constructor.newInstance(Unknown Source)

com.mysql.jdbc.Util.handleNewInstance(Util.java:404)

com.mysql.jdbc.Util.getInstance(Util.java:387)

com.mysql.jdbc.SQLError.createSQLException(SQLError.java:941)

com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870)

com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806)

com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470)

com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617)

com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550)

com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)

com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)

com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:989)

sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)

com.sun.proxy.$Proxy47.execute(Unknown Source)

org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)

org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)

org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)

org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)

org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)

org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)

org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)

sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)

com.imooc.o2o.dao.split.DynamicDataSourceInterceptor.intercept(DynamicDataSourceInterceptor.java:57)

org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)

com.sun.proxy.$Proxy44.query(Unknown Source)

org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)

org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)

sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)

com.sun.proxy.$Proxy15.selectList(Unknown Source)

org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)

org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)

org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)

org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)

com.sun.proxy.$Proxy26.queryProductList(Unknown Source)

com.imooc.o2o.service.impl.ProductServiceImpl.getProductList(ProductServiceImpl.java:35)

sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy29.getProductList(Unknown Source)

com.imooc.o2o.web.frontend.ShopDetailController.listProductsByShop(ShopDetailController.java:88)

sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)

javax.servlet.http.HttpServlet.service(HttpServlet.java:635)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/8.5.32</h3></body></html>


写回答

1回答

翔仔

2019-04-09

同学好,这里的问题比较明显,说的是

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column &#39;point

就是说数据库tb_product里面缺少point字段,可以添加相关字段或者在mapper对应的sql里面去掉point

0
0

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5127 学习 · 8148 问题

查看课程