java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Load the attached sonatype-work directory into nexus, then run the snapshot removal task. This will fail with a class cast exception. The snapshot remover should skip virtual repositories. {quote} 2015-01-15 16:06:44,420-0600 WARN [pxpool-1-thread-1] admin org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover - SnapshotRemover is failed to process path: '/com/foo/project/1.0.3-SNAPSHOT'. java.lang.ClassCastException: org.sonatype.nexus.proxy.item.DefaultStorageLinkItem cannot be cast to org.sonatype.nexus.proxy.item.StorageFileItem at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover$SnapshotRemoverWalkerProcessor.doOnCollectionExit(DefaultSnapshotRemover.java:459) ~[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover$SnapshotRemoverWalkerProcessor.onCollectionExit(DefaultSnapshotRemover.java:387) ~[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.onCollectionExit(DefaultWalker.java:325) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:226) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:231) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:231) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:231) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:231) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walk(DefaultWalker.java:89) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover.removeSnapshotsFromMavenRepository(DefaultSnapshotRemover.java:214) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover.process(DefaultSnapshotRemover.java:157) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover.removeSnapshots(DefaultSnapshotRemover.java:116) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.SnapshotRemoverTask.doRun(SnapshotRemoverTask.java:98) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.SnapshotRemoverTask.doRun(SnapshotRemoverTask.java:28) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.java:151) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.java:418) [nexus-scheduler-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.threads.MDCAwareCallable.call(MDCAwareCallable.java:44) [nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-core-1.2.3.jar:1.2.3] at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-core-1.2.3.jar:1.2.3] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_25] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_25] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_25] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25] {quote}
    via by Rich Seddon,
    • java.lang.ClassCastException: org.sonatype.nexus.proxy.item.DefaultStorageLinkItem cannot be cast to org.sonatype.nexus.proxy.item.StorageFileItem at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover$SnapshotRemoverWalkerProcessor.doOnCollectionExit(DefaultSnapshotRemover.java:459)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover$SnapshotRemoverWalkerProcessor.onCollectionExit(DefaultSnapshotRemover.java:387)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.onCollectionExit(DefaultWalker.java:325)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:226)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:231)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:231)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:231)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:231)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.proxy.walker.DefaultWalker.walk(DefaultWalker.java:89)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover.removeSnapshotsFromMavenRepository(DefaultSnapshotRemover.java:214)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover.process(DefaultSnapshotRemover.java:157)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.DefaultSnapshotRemover.removeSnapshots(DefaultSnapshotRemover.java:116)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.SnapshotRemoverTask.doRun(SnapshotRemoverTask.java:98)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.maven.tasks.SnapshotRemoverTask.doRun(SnapshotRemoverTask.java:28)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.java:151)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.java:418)[nexus-scheduler-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.sonatype.nexus.threads.MDCAwareCallable.call(MDCAwareCallable.java:44)[nexus-core-2.11.2-SNAPSHOT.jar:2.11.2-SNAPSHOT] at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)[shiro-core-1.2.3.jar:1.2.3] at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)[shiro-core-1.2.3.jar:1.2.3] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_25] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0_25] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[na:1.8.0_25] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_25] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_25]
    No Bugmate found.