gpt4 book ai didi

java - MySQL:java.sql.BatchUpdateException:键 '242-243' 的重复条目 'PRIMARY'

转载 作者:行者123 更新时间:2023-11-29 06:17:05 25 4
gpt4 key购买 nike

我的 MySQL 有问题,在下午 4 点,我认为我的 webApp 无法访问 MySQL,因为这个错误:

    com.webratio.rtx.RTXException: Unable to perform process transition 'startProcess[startActivityTypeOid:2][parameters:gruppoOid=1, idCliente=2613, scontoOcc={}, barcode=10AA1107]'
at com.webratio.units.bpm.core.ProcessController.handleProcessTransition(ProcessController.java:137)
at com.webratio.units.bpm.services.ProcessUnitService.createUnitBean(ProcessUnitService.java:151)
at com.webratio.units.bpm.services.AbstractBPUnitService.getUnitBean(AbstractBPUnitService.java:144)
at com.webratio.units.bpm.services.AbstractBPUnitService.execute(AbstractBPUnitService.java:107)
at com.webratio.struts.actions.OperationAction.executeOperation(OperationAction.java:393)
at com.webratio.struts.actions.OperationAction.doExecute(OperationAction.java:249)
at com.webratio.struts.actions.OperationAction.execute(OperationAction.java:74)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at com.webratio.struts.servlets.WRActionServlet.process(WRActionServlet.java:155)
at com.webratio.struts.servlets.WRActionServlet.doPost(WRActionServlet.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:719)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:465)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:390)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:317)
at com.webratio.struts.chain.commands.PerformForward2.handleAsForward(PerformForward2.java:101)
at com.webratio.struts.chain.commands.PerformForward2.perform(PerformForward2.java:83)
at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at com.webratio.struts.servlets.WRActionServlet.process(WRActionServlet.java:155)
at com.webratio.struts.servlets.WRActionServlet.doPost(WRActionServlet.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.webratio.struts.filters.StaticResourceFilter.doFilter(StaticResourceFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
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:521)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)



Caused by: com.webratio.rtx.RTXException: Unable to start process (startEventOid:2)
at com.webratio.units.bpm.core.ProcessController$StartProcessCommand.computeOperations(ProcessController.java:557)
at com.webratio.units.bpm.core.ProcessCommand.execute(ProcessCommand.java:184)
at com.webratio.units.bpm.core.ProcessController.handleProcessTransition(ProcessController.java:107)
... 64 more
Caused by: java.lang.reflect.UndeclaredThrowableException
at com.webratio.units.bpm.core.$Proxy3.flush(Unknown Source)
at com.webratio.units.bpm.core.handlers.ProcessHandler.connectActivityInstances(ProcessHandler.java:1007)
at com.webratio.units.bpm.core.handlers.ProcessHandler.normalFlow(ProcessHandler.java:256)
at com.webratio.units.bpm.core.handlers.ProcessHandler.normalFlow(ProcessHandler.java:122)
at com.webratio.units.bpm.core.handlers.ProcessHandler.startProcess(ProcessHandler.java:109)
at com.webratio.units.bpm.core.ProcessController$StartProcessCommand.computeOperations(ProcessController.java:550)
... 66 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor234.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.webratio.units.bpm.core.TXSession$SessionInvocationHandler.invoke(TXSession.java:206)
... 72 more
Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:262)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:181)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
... 76 more
Caused by: java.sql.BatchUpdateException: Duplicate entry '242-243' for key 'PRIMARY'
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2020)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1451)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 81 more

我不知道它是什么,因为它从未发生在我身上。我坚持这一点,所以我提前感谢你的一些建议。

最佳答案

就像错误状态一样:

Caused by: java.sql.BatchUpdateException: Duplicate entry '242-243' for key 'PRIMARY'

您正在尝试插入一个与现有主键 ('242-243') 具有相同主键的值。主键是唯一的,不能有任何重复。

关于java - MySQL:java.sql.BatchUpdateException:键 '242-243' 的重复条目 'PRIMARY',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35242855/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com