数据库报错

--------------------------------------------------------------------------------

com.jfinal.plugin.activerecord.ActiveRecordException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jfinal-api-scaffold-master.wmquestionnaire' doesn't exist

at com.jfinal.plugin.activerecord.Model.paginate(Model.java:283)

at com.jfinal.plugin.activerecord.Model.paginate(Model.java:326)

at com.laiford.treadmill.service.WmQuestionnaireService.selectPage(WmQuestionnaireService.java:25)

at com.laiford.treadmill.api.WmQuestionnaireContmroller.getselectPagelist(WmQuestionnaireContmroller.java:30)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.jfinal.aop.Invocation.invoke(Invocation.java:71)

at com.laiford.treadmill.interceptor.TokenInterceptor.intercept(TokenInterceptor.java:37)

at com.jfinal.aop.Invocation.invoke(Invocation.java:65)

at com.laiford.treadmill.interceptor.ErrorInterceptor.intercept(ErrorInterceptor.java:22)

at com.jfinal.aop.Invocation.invoke(Invocation.java:65)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)

at com.laiford.treadmill.handler.APINotFoundHandler.handle(APINotFoundHandler.java:36)

at com.laiford.treadmill.handler.ContextHandler.handle(ContextHandler.java:16)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:744)

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jfinal-api-scaffold-master.wmquestionnaire' doesn't exist

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)

at com.mysql.jdbc.Util.getInstance(Util.java:360)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:978)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2530)

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1907)

at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2030)

at com.zaxxer.hikari.proxy.PreparedStatementProxy.executeQuery(PreparedStatementProxy.java:45)

at com.jfinal.plugin.activerecord.DbPro.query(DbPro.java:69)

at com.jfinal.plugin.activerecord.Db.query(Db.java:40)

at com.jfinal.plugin.activerecord.Model.paginate(Model.java:298)

at com.jfinal.plugin.activerecord.Model.paginate(Model.java:281)

... 34 more


评论区

JFinal

2016-10-31 11:12

提示jfinal-api-scaffold-master.wmquestionnaire 这张表不存在,检查一下,这里是关键提示部分:Table 'jfinal-api-scaffold-master.wmquestionnaire' doesn't exist

不懂程序

2016-10-31 11:25

@JFinal 但是 数据库 表都是有的啊

不懂程序

2016-10-31 11:26

@JFinal 新加表 数据库服务器 我重新启动了 还是没有

不懂程序

2016-10-31 11:31

@JFinal 实体类 我是 自动生成的

package com.laiford.treadmill.model;


import com.laiford.treadmill.model.base.BaseWmQuestionnaire;


/**
* Generated by JFinal.
*/
@SuppressWarnings("serial")
public class WmQuestionnaire extends BaseWmQuestionnaire {
public static final WmQuestionnaire dao = new WmQuestionnaire();

}
package com.laiford.treadmill.model.base;

import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.IBean;

/**
* Generated by JFinal, do not modify this file.
*/
@SuppressWarnings("serial")
public abstract class BaseWmQuestionnaire> extends Model implements IBean {

public void setPaperID(java.lang.Integer paperID) {
set("paperID", paperID);
}

public java.lang.Integer getPaperID() {
return get("paperID");
}

public void setTitle(java.lang.String title) {
set("title", title);
}

public java.lang.String getTitle() {
return get("title");
}

public void setChoosetype(java.lang.Integer choosetype) {
set("choosetype", choosetype);
}

public java.lang.Integer getChoosetype() {
return get("choosetype");
}

public void setOptionA(java.lang.String optionA) {
set("optionA", optionA);
}

public java.lang.String getOptionA() {
return get("optionA");
}

public void setOptionB(java.lang.String optionB) {
set("optionB", optionB);
}

public java.lang.String getOptionB() {
return get("optionB");
}

public void setOptionC(java.lang.String optionC) {
set("optionC", optionC);
}

public java.lang.String getOptionC() {
return get("optionC");
}

public void setOptionD(java.lang.String optionD) {
set("optionD", optionD);
}

public java.lang.String getOptionD() {
return get("optionD");
}

public void setOptionE(java.lang.String optionE) {
set("optionE", optionE);
}

public java.lang.String getOptionE() {
return get("optionE");
}

public void setOptionF(java.lang.String optionF) {
set("optionF", optionF);
}

public java.lang.String getOptionF() {
return get("optionF");
}

public void setDiagnostic(java.lang.String diagnostic) {
set("diagnostic", diagnostic);
}

public java.lang.String getDiagnostic() {
return get("diagnostic");
}

这样 取不到吗
arp.addMapping("wm_questionnaire", "paperID", WmQuestionnaire.class);

JFinal

2016-10-31 12:28

@不懂程序 注意权限问题,虽然表存在,但是当前用户不一定有权限读取,这个是很常见的问题

热门反馈

扫码入社