|
版本: |
|
小版本号: |
|
|
|
数据库: |
|
服务器操作系统: |
|
应用服务器: |
|
客户端操作系统: |
|
浏览器: |
|
|
|
java 代码如下:
String Sql = "select a.sCode, a.sName from sa_opperson a where not a.sCode in (select fGH from comtomyfck.yfck_yhgl where fYHLB = '"+ fYHLB +"') and a.sValidState = 1";
Map sqlMap = new HashMap();
sqlMap.put(SQL.DEFAULT_DB_NAME, Sql);
sqlMap.put(DatabaseProduct.MSSQL.name(), Sql);
Table table = SQL.select(sqlMap,null,"/system/data");
Iterator it = table.iterator();
//获取当前时间
SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String fUpdateTime = sDateFormat.format(com.justep.system.util.CommonUtils.getCurrentDateTime());
while(it.hasNext()){
Row row = (Row)it.next();
String name = row.getString("sName");
String code = row.getString("sCode");
String uuid = CommonUtils.createGUID();
StringBuffer insertSql = new StringBuffer();
insertSql.append("insert into yfck_yhgl select '"+ uuid +"', '0', a.sCode, a.sName, a.sCode, a.sMainOrgPostName, '123456', '000565', '"+fUpdateTime+"', null, null, '"+ fYHLB +"' from x5sys.sa_opperson a where a.sCode = '"+ code +"' and a.sValidState = 1");
Map insertSqlMap = new HashMap();
insertSqlMap.put(SQL.DEFAULT_DB_NAME, insertSql.toString());
insertSqlMap.put(DatabaseProduct.MSSQL.name(), insertSql.toString());
SQL.executeUpdate(insertSqlMap, null, "/comtomoa/yfckManager/data");
String shellString = "sudo -s /home/samba/smbd/script/createuser.sh -u "+ name +" -p 123456 -a "+code;
try {
YfckglUtil.invokShell(shellString, fYHLB);
} catch (Exception e1) {
// TODO 自动生成的 catch 块
e1.printStackTrace();
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
错误信息如下:
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 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: 编码: JUSTEP150039; 提示: 执行sql: insert into yfck_yhgl select '651A9542E2CD4188B234D5B1FE6E075F', '0', a.sCode, a.sName, a.sCode, a.sMainOrgPostName, '123456', '000565', '2017-05-26 01:00:01', null, null, 'YFCK' from x5sys.sa_opperson a where a.sCode = '000578' and a.sValidState = 1, binds: []出错
at com.justep.exception.BusinessException.create(Unknown Source)
at com.justep.system.data.SQL.executeUpdate(Unknown Source)
at com.justep.system.data.SQL.executeUpdate(Unknown Source)
at LeaveDaysManager.synPersonToYFCK(LeaveDaysManager.java:410)
at Common.pushLeaveDay(Common.java:174)
... 27 more
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2113)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2049)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2034)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
... 31 more
在本地开发版本中测试没有问题,放到正式环境中,报错?
|
|