org.sonatype.nexus.repository.metadata.MetadataHandlerException: java.lang.ClassCastException: java.io.File cannot be cast to java.util.Map

Sonatype JIRA | Brian Demers | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I upgraded RSO to 2.0-M1, got plenty of these in the logs, and 500's while requesting artifacts {noformat} jvm 1 | 2012-01-03 22:24:33 INFO [7-main-thread-1] - org.sonatype.nexus.repositories.metadata.NexusRepositoryMetadataEventInspector - Could not write repository metadata! jvm 1 | org.sonatype.nexus.repository.metadata.MetadataHandlerException: java.lang.ClassCastException: java.io.File cannot be cast to java.util.Map jvm 1 | at org.sonatype.nexus.repository.metadata.DefaultRepositoryMetadataHandler.writeRepositoryMetadata(DefaultRepositoryMetadataHandler.java:121) ~[nexus-repository-metadata-api-1.2.jar:na] jvm 1 | at org.sonatype.nexus.repository.metadata.DefaultRepositoryMetadataHandler.writeRepositoryMetadata(DefaultRepositoryMetadataHandler.java:94) ~[nexus-repository-metadata-api-1.2.jar:na] jvm 1 | at org.sonatype.nexus.repositories.metadata.NexusRepositoryMetadataEventInspector.processRepository(NexusRepositoryMetadataEventInspector.java:201) [nexus-app-2.0-M1.jar:na] jvm 1 | at org.sonatype.nexus.repositories.metadata.NexusRepositoryMetadataEventInspector.inspect(NexusRepositoryMetadataEventInspector.java:86) [nexus-app-2.0-M1.jar:na] jvm 1 | at org.sonatype.nexus.events.DefaultEventInspectorHost$EventInspectorHandler.run(DefaultEventInspectorHost.java:181) [nexus-app-2.0-M1.jar:na] jvm 1 | at org.sonatype.nexus.events.DefaultEventInspectorHost.processEvent(DefaultEventInspectorHost.java:127) [nexus-app-2.0-M1.jar:na] jvm 1 | at org.sonatype.nexus.events.DefaultEventInspectorHost.onEvent(DefaultEventInspectorHost.java:135) [nexus-app-2.0-M1.jar:na] jvm 1 | at org.sonatype.plexus.appevents.AbstractSimpleEventMulticaster.notifyEventListeners(AbstractSimpleEventMulticaster.java:55) [simple-event-multicaster-1.0.0.jar:na] jvm 1 | at org.sonatype.nexus.DefaultNexus.startService(DefaultNexus.java:501) [nexus-app-2.0-M1.jar:na] jvm 1 | at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:419) [nexus-app-2.0-M1.jar:na] {noformat}

    Sonatype JIRA | 5 years ago | Brian Demers
    org.sonatype.nexus.repository.metadata.MetadataHandlerException: java.lang.ClassCastException: java.io.File cannot be cast to java.util.Map

    Root Cause Analysis

    1. org.sonatype.nexus.repository.metadata.MetadataHandlerException

      java.lang.ClassCastException: java.io.File cannot be cast to java.util.Map

      at org.sonatype.nexus.repository.metadata.DefaultRepositoryMetadataHandler.writeRepositoryMetadata()
    2. ${project.groupId}:${project.artifactId}
      DefaultRepositoryMetadataHandler.writeRepositoryMetadata
      1. org.sonatype.nexus.repository.metadata.DefaultRepositoryMetadataHandler.writeRepositoryMetadata(DefaultRepositoryMetadataHandler.java:121)[nexus-repository-metadata-api-1.2.jar:na]
      2. org.sonatype.nexus.repository.metadata.DefaultRepositoryMetadataHandler.writeRepositoryMetadata(DefaultRepositoryMetadataHandler.java:94)[nexus-repository-metadata-api-1.2.jar:na]
      2 frames
    3. ${project.groupId}:${project.artifactId}
      DefaultEventInspectorHost.onEvent
      1. org.sonatype.nexus.repositories.metadata.NexusRepositoryMetadataEventInspector.processRepository(NexusRepositoryMetadataEventInspector.java:201)[nexus-app-2.0-M1.jar:na]
      2. org.sonatype.nexus.repositories.metadata.NexusRepositoryMetadataEventInspector.inspect(NexusRepositoryMetadataEventInspector.java:86)[nexus-app-2.0-M1.jar:na]
      3. org.sonatype.nexus.events.DefaultEventInspectorHost$EventInspectorHandler.run(DefaultEventInspectorHost.java:181)[nexus-app-2.0-M1.jar:na]
      4. org.sonatype.nexus.events.DefaultEventInspectorHost.processEvent(DefaultEventInspectorHost.java:127)[nexus-app-2.0-M1.jar:na]
      5. org.sonatype.nexus.events.DefaultEventInspectorHost.onEvent(DefaultEventInspectorHost.java:135)[nexus-app-2.0-M1.jar:na]
      5 frames
    4. ${project.groupId}:${project.artifactId}
      AbstractSimpleEventMulticaster.notifyEventListeners
      1. org.sonatype.plexus.appevents.AbstractSimpleEventMulticaster.notifyEventListeners(AbstractSimpleEventMulticaster.java:55)[simple-event-multicaster-1.0.0.jar:na]
      1 frame
    5. ${project.groupId}:${project.artifactId}
      DefaultNexus.start
      1. org.sonatype.nexus.DefaultNexus.startService(DefaultNexus.java:501)[nexus-app-2.0-M1.jar:na]
      2. org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:419)[nexus-app-2.0-M1.jar:na]
      2 frames