Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.0-alpha-1
-
None
Description
When scanning a repository that has an artifact that has been updated on disk, and exists in the database already, the following exception occurs.
com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry 'commons-httpclient--commons-httpclient-jar-2.0.2' for key 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1169) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:693) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1404) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1318) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1303) at org.jpox.store.rdbms.RDBMSManager.executeStatementUpdate(RDBMSManager.java:572) at org.jpox.store.rdbms.request.InsertRequest.execute(InsertRequest.java:328) at org.jpox.store.rdbms.table.ClassTable.insert(ClassTable.java:2519) at org.jpox.store.StoreManager.insert(StoreManager.java:920) at org.jpox.state.StateManagerImpl.internalMakePersistent(StateManagerImpl.java:3667) at org.jpox.state.StateManagerImpl.makePersistent(StateManagerImpl.java:3646) at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:1198) at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:1261) at org.apache.maven.archiva.database.jdo.JdoAccess.saveObject(JdoAccess.java:196) at org.apache.maven.archiva.database.jdo.JdoAccess.saveObject(JdoAccess.java:169) at org.apache.maven.archiva.database.jdo.JdoArtifactDAO.saveArtifact(JdoArtifactDAO.java:110) at org.apache.maven.archiva.consumers.database.ArtifactUpdateDatabaseConsumer.processFile(ArtifactUpdateDatabaseConsumer.java:195) at org.apache.maven.archiva.repository.scanner.functors.ConsumerProcessFileClosure.execute(ConsumerProcessFileClosure.java:57) at org.apache.commons.collections.functors.IfClosure.execute(IfClosure.java:117) at org.apache.commons.collections.CollectionUtils.forAllDo(CollectionUtils.java:388) at org.apache.maven.archiva.repository.scanner.RepositoryScannerInstance.directoryWalkStep(RepositoryScannerInstance.java:127) at org.codehaus.plexus.util.DirectoryWalker.fireStep(DirectoryWalker.java:173) at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:391) at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385) at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385) at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385) at org.codehaus.plexus.util.DirectoryWalker.scan(DirectoryWalker.java:344) at org.apache.maven.archiva.repository.scanner.DefaultRepositoryScanner.scan(DefaultRepositoryScanner.java:126) at org.apache.maven.archiva.repository.scanner.DefaultRepositoryScanner.scan(DefaultRepositoryScanner.java:65) at org.apache.maven.archiva.scheduled.executors.ArchivaRepositoryScanningTaskExecutor.executeTask(ArchivaRepositoryScanningTaskExecutor.java:105) at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116) at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528) at java.lang.Thread.run(Thread.java:595)
Need logic to prevent the Table constraint violation.
To update the table entry if it exists.
Attachments
Issue Links
- relates to
-
MRM-414 Don't queue a request to scan a repository that is currently being scanned
- Closed