起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 79|回复: 5

[结贴] 启用租户后初始化数据库报错

[复制链接]

24

主题

91

帖子

317

积分

中级会员

Rank: 3Rank: 3

积分
317
QQ
发表于 2019-1-30 09:43:13 | 显示全部楼层 |阅读模式
版本: BeX5V3.5 小版本号:
数据库: MySQL 服务器操作系统: Windows 应用服务器: Tomcat
客户端操作系统: Windows 7 浏览器: Chrome

启用租户后,初始化数据库失败,


TIM截图20190130094035.jpg

数据库连的是云上的数据库,
数据库连接正常,平时开发中已经正常在使用的,报错如下

2019-01-30 09:35:52 执行sql: insert into SA_Log  (sProcessName, sStatusName, sActivity, sAction, sOperatingSystem, version, SID, sProcess, sCreatorPersonName, sCreateTime, sActivityName, sActionName, sParameters, sIP, sTypeName, sDeviceType, $clientName ) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, $clientValue ), binds: [系统调用, 失败, mainActivity, loginAction, 未知, 0, 30629836C8144037976E0BA8B3F86DA3, /SA/OPM/system/systemProcess, init, 2019-01-30 09:35:52.509, 系统, 登录, ******, 127.0.0.1, 操作日志, 未知]失败
java.sql.SQLException: Field 'client_id' doesn't have a default value
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:974)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1113)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1381)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1046)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at com.justep.system.interceptor.LogBefore.execSqlUpdate(Unknown Source)
        at com.justep.system.interceptor.LogBefore.loginLog(Unknown Source)
        at com.justep.system.interceptor.LogBefore.doActionLog(Unknown Source)
        at com.justep.system.interceptor.LogBefore.execute(Unknown Source)
        at com.justep.system.action.EngineInterceptor.excute(Unknown Source)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.justep.micro.service.MicroServiceFilter.doFilter(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
2019-01-30 09:35:52 action:<?xml version="1.0" encoding="UTF-8"?>
<action process="/SA/OPM/system/systemProcess" activity="mainActivity" name="loginAction" execute-context="" content-type="application/xml"><parameters><parameter name="ip"><xbiz:simple xmlns:xbiz="http://www.justep.com/xbiz#" type="http://www.w3.org/2001/XMLSchema#String">127.0.0.1</xbiz:simple></parameter><parameter name="name"><xbiz:simple xmlns:xbiz="http://www.justep.com/xbiz#" type="http://www.w3.org/2001/XMLSchema#String">init</xbiz:simple></parameter><parameter name="options"><xbiz:map xmlns:xbiz="http://www.justep.com/xbiz#"><item key="client"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String">manager</xbiz:simple></item></xbiz:map></parameter><parameter name="loginDate"><xbiz:simple xmlns:xbiz="http://www.justep.com/xbiz#" type="http://www.w3.org/2001/XMLSchema#Date">2019-01-30</xbiz:simple></parameter><parameter name="pwd"><xbiz:simple xmlns:xbiz="http://www.justep.com/xbiz#" type="http://www.w3.org/2001/XMLSchema#String">E10ADC3949BA59ABBE56E057F20F883E</xbiz:simple></parameter><parameter name="lang"><xbiz:simple xmlns:xbiz="http://www.justep.com/xbiz#" type="http://www.w3.org/2001/XMLSchema#String">zh_CN</xbiz:simple></parameter></parameters></action>
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.justep.micro.service.MicroServiceFilter.doFilter(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: INSERT INTO SA_OPOrgVer SA_OPOrgVer(SA_OPOrgVer, SA_OPOrgVer.version, SA_OPOrgVer.sName, SA_OPOrgVer.sCode) VALUES (:SA_OPOrgVer, :version, :sName, :sCode)
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlInsert(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlExecuteUpdate(Unknown Source)
        at com.justep.system.data.KSQL.executeUpdate(Unknown Source)
        at com.justep.system.data.KSQL.executeUpdate(Unknown Source)
        at com.justep.system.data.impl.TableImpl.insert(Unknown Source)
        at com.justep.system.data.impl.TableImpl.save(Unknown Source)
        at com.justep.system.data.impl.TableImpl.save(Unknown Source)
        at com.justep.system.data.impl.TableImpl.save(Unknown Source)
        at com.justep.system.data.impl.TableImpl.save(Unknown Source)
        at com.justep.system.data.impl.TableImpl.save(Unknown Source)
        at com.justep.system.opm.OrgCache.getOrgVer(Unknown Source)
        at com.justep.system.opm.OrgCache.getOrgVersion(Unknown Source)
        at OPMProcedure.login(OPMProcedure.java:181)
        at OPMProcedure.login(OPMProcedure.java:137)
        ... 30 more
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150039; 提示: 执行sql: INSERT INTO SA_Code (SA_Code.sID, SA_Code.VERSION, SA_Code.SNAME, SA_Code.SCODE, SA_Code.sType) VALUES ( ? ,  ? ,  ? ,  ? , ?), binds: [orgVersion, 0, orgVersion, B10F72193DF44351ADE96397CF9ECA71, orgVersion]出错
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.ksql.KSQLUtils.execSqlUpdate(Unknown Source)
        ... 44 more
Caused by: java.sql.SQLException: Field 'client_id' doesn't have a default value
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:974)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1113)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1381)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1046)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        ... 45 more




求解决方案

86

主题

12万

帖子

2万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
26765
发表于 2019-1-31 16:37:26 来自手机 | 显示全部楼层
多租户的平台提供的在system下提供的有使用说明,需要按照平台提供的执行,提示的缺少字段
回复 支持 反对

使用道具 举报

24

主题

91

帖子

317

积分

中级会员

Rank: 3Rank: 3

积分
317
QQ
 楼主| 发表于 7 天前 | 显示全部楼层
jishuang 发表于 2019-1-31 16:37
多租户的平台提供的在system下提供的有使用说明,需要按照平台提供的执行,提示的缺少字段 ...

就是按平台说明文档操作报错的
回复 支持 反对

使用道具 举报

24

主题

91

帖子

317

积分

中级会员

Rank: 3Rank: 3

积分
317
QQ
 楼主| 发表于 7 天前 | 显示全部楼层
jishuang 发表于 2019-1-31 16:37
多租户的平台提供的在system下提供的有使用说明,需要按照平台提供的执行,提示的缺少字段 ...

就是按平台说明文档操作报错的
回复 支持 反对

使用道具 举报

6

主题

4万

帖子

8420

积分

版主

Rank: 7Rank: 7Rank: 7

积分
8420
QQ
发表于 5 天前 | 显示全部楼层
数据库表中没加上  client_id  字段 ,需要所有表中都加上这个字段才行!
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

24

主题

91

帖子

317

积分

中级会员

Rank: 3Rank: 3

积分
317
QQ
 楼主| 发表于 4 天前 | 显示全部楼层
liangyongfei 发表于 2019-2-11 17:54
数据库表中没加上  client_id  字段 ,需要所有表中都加上这个字段才行!

并不是这个问题,不过现在已经可以用了,可以结贴
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2019-2-16 21:01 , Processed in 0.139284 second(s), 31 queries .

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表