- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在运行生产环境时遇到以下异常。但在本地工作正常。
ing bean with name 'jobLauncher' defined in class path resource [config/spring/batch/lms-draw-result-batch-jobs-context.xml]: Cannot resolve reference to bean 'jobRepository' while setting bean property 'jobRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobRepository' defined in class path resource [config/spring/batch/lms-draw-result-batch-jobs-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [config/spring/lms-txnconfig-context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [config/spring/lms-dbconfig-context.xml]: Invocation of init method failed; nested exception is `liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/db.changelog-1.7.xml:`:update-draw-id-to-winning_result::Mohamed Musni:
Reason: liquibase.exception.DatabaseException: Duplicate entry '1340' for key 'draw_id' [Failed SQL: ALTER TABLE lms_staging.winning_result ADD UNIQUE (draw_id)]
2017-08-01 15:06:35 [localhost-startStop-1] INFO SchedulerFactoryBean:765 - Shutting down Quartz Scheduler
2017-08-01 15:06:35 [localhost-startStop-1] INFO QuartzScheduler:694 - Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED shutting down.
2017-08-01 15:06:35 [localhost-startStop-1] INFO QuartzScheduler:613 - Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED paused.
2017-08-01 15:06:35 [localhost-startStop-1] INFO QuartzScheduler:771 - Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED shutdown complete.
2017-08-01 15:06:35 [localhost-startStop-1] INFO ThreadPoolTaskScheduler:203 - Shutting down ExecutorService 'messageBrokerTaskScheduler'
2017-08-01 15:06:35 [localhost-startStop-1] INFO ThreadPoolTaskExecutor:203 - Shutting down ExecutorService 'brokerChannelExecutor'
2017-08-01 15:06:35 [localhost-startStop-1] INFO ThreadPoolTaskExecutor:203 - Shutting down ExecutorService 'clientOutboundChannelExecutor'
2017-08-01 15:06:35 [localhost-startStop-1] INFO ThreadPoolTaskExecutor:203 - Shutting down ExecutorService 'clientInboundChannelExecutor'
2017-08-01 15:06:35 [localhost-startStop-1] INFO ThreadPoolTaskExecutor:203 - Shutting down ExecutorService 'taskExecutor'
2017-08-01 15:06:35 [localhost-startStop-1] ERROR ContextLoader:353 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schedulerController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.auxenta.lms.service.DrawManagementService com.auxenta.lms.controller.web.v1.SchedulerController.drawManagementService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'drawManagementServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.springframework.batch.core.launch.JobLauncher com.auxenta.lms.service.Impl.DrawManagementServiceImpl.jobLauncher; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobLauncher' defined in class path resource [config/spring/batch/lms-draw-result-batch-jobs-context.xml]: Cannot resolve reference to bean 'jobRepository' while setting bean property 'jobRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobRepository' defined in class path resource [config/spring/batch/lms-draw-result-batch-jobs-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [config/spring/lms-txnconfig-context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [config/spring/lms-dbconfig-context.xml]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/db.changelog-1.7.xml::update-draw-id-to-winning_result::Mohamed Musni:
Reason: liquibase.exception.DatabaseException: Duplicate entry '1340' for key 'draw_id' [Failed SQL: ALTER TABLE lms_staging.winning_result ADD UNIQUE (draw_id)]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4961)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5455)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:634)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1074)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
这是我的 createTable xml 文件
<changeSet author="zzzzzzzzzz" id="1-create-winning_result">
<createTable tableName="winning_result">
<column autoIncrement="true" name="id" type="INT">
<constraints primaryKey="true"/>
</column>
<column name="draw_id" type="INT"/>
<column name="winning_numbers" type="VARCHAR(45)"/>
<column name="bonus_numbers" type="VARCHAR(45)"/>
<column name="special_numbers" type="VARCHAR(45)"/>
<column name="approved" type="BIT(1)"/>
<column name="timestamp" type="datetime"/>
</createTable>
</changeSet>
这也是ForeignKeyConstraint,
<changeSet author="zzzzzzzzzz" id="2-add-foreign-constraint">
<addForeignKeyConstraint baseColumnNames="draw_id"
baseTableName="winning_result"
constraintName="fk_draw_winning_result"
deferrable="false"
initiallyDeferred="false" onDelete="NO ACTION"
onUpdate="NO ACTION" referencedColumnNames="id"
referencedTableName="draw"/>
</changeSet>
我需要将draw_id设置为unique.my (db/changelog/db.changelog-1.7.xml)文件 --->
<addUniqueConstraint
columnNames="draw_id"
deferrable="true"
disabled="true"
initiallyDeferred="true"
tableName="winning_result"/>
</changeSet>
是这个数据库版本问题还是其他问题。任何人都可以帮助我。
最佳答案
向包含预先存在的数据的表添加限制是一个危险的游戏。
您的 Winning_result 表可能已经包含一些数据,并且您尝试设置唯一的列 (draw_id) 多次包含值 1340。
您必须在添加约束之前修复数据(删除重复的数据(第 1340 章可能有其他值)),或者放弃添加约束。
关于java - liquibase.异常.DatabaseException : Duplicate entry,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45437473/
我有一个内部表,里面有 108 个条目。从 9 到 9 个条目重复条目,我想删除这些重复项。由于它们完全相同,我使用了 delete adjacent duplicates from itab com
在 Team Foundation Server (TFS) 中链接两个工作项 (WI) 时,在什么情况下将“Duplicate”和“Duplicate Of”区分为“链接类型”是有意义的? 如何处理
ld: duplicate symbol _velocityX in \ /Users/Student/Library/Developer/Xcode/DerivedData/finalproject
我使用 PHP 和 Mysql。 此 SQL 有效: INSERT INTO products (id, title, description) VALUES (10, 'va
我有一个大数据框 (120000x40),我尝试在每一行中找到重复项并显示它们。这就是我的尝试: 创建数据框 import pandas as pd df = pd.DataFrame({'col1'
我是 mySQL 和 PHP 的新手,请多多包涵。 如果我的查询有重复字段,我该如何做到这一点,检索到的数据将具有重复查询字段的重复数据。 一个例子是这样的: 查询 id = 34, 54, 21,
我一直遇到这个错误,但我无法理解它,因为它提示一个值恰好出现一次。 Exception in thread "main" java.lang.IllegalStateException: Duplic
我有一个带有 Vuejs 和 Laravel 的 Web 应用程序 我想使用 CKEditor 5 我安装了依赖项 npm install --save @ckeditor/ckeditor5-vue
我有一个包含以下数据的 csv 文件: Id,Name,Type,date 1,name1,employee,25/04/2017 2,name2,contrator,26/04/2017 3,nam
import CKEditor from '@ckeditor/ckeditor5-react'; import ClassicEditor from '@ckeditor/ckeditor5-bui
表定义: CREATE TABLE PositionalDataNGS ( Date DATE, Time TIME(3) , X FLOAT(5), Y FLOAT(5), D FLOAT(5) ,
我目前正在做一个项目,我要处理数以千计的数据包。现在,我记录每个数据包的 IP 和 MAC 地址以及一些其他信息。为了存储所有这些,我使用 MySQL 并且我的脚本是用 Node.js 编写的。目前我
I am using MySQL 5.1.56, MyISAM. My table looks like this:我使用的是MySQL 5.1.56,MyISAM。我的桌子是这样的: CR
我是新来的,对 SQL 比较陌生。我有一个类似这样的表: [Pk], [Case_No], [Status], [Open_Date], [Close_Date], [Case_Age], [Repo
为什么会收到此警告? warning No duplicate props allowed react/jsx-no-duplicate-props# 它显示的是第28行,但没有使用 Prop 。 最
是否有任何函数或方法可以在 python 2.7 中递归实现此目的? Input : ['and', ['or', 'P', '-R', 'P'], ['or', '-Q', '-R', 'P']]
我正在分析 hadoop 中的数据。有一些重复条目,其中 A、B 列重复,而 C 列不同。我想要做的是仅识别 A、B 重复项,然后为每个重复项打印出 C 列的不同值。 示例数据: row, data
您好,感谢阅读并可能对我有所帮助 我的问题的简要说明: 我正在将数据从一个 Firebird 数据库复制到另一个(称为 V14),并且我正在使用 IBExpert 来执行此操作。这些表的名称相同并且具
我想制作一张很像下面的图片: 我想使用 seaborn 使图表看起来漂亮,并让我自己以后更容易使用 facetgrids(我有十个不同的数据集,我想在同一个图表中显示。) 我在 seaborn 中找到
我在两列“user_id”和“project_id”上有一个复合唯一键。 当我尝试对单行或多行运行 DELETE 查询时,出现错误。 ERROR 1062: 1062: Duplicate entry
我是一名优秀的程序员,十分优秀!