java.lang.ClassCastException: org.springframework.roo.classpath.details.annotations.ArrayAttributeValue cannot be cast to org.springframework.roo.classpath.details.annotations.StringAttributeValue

Spring JIRA | Alan Hamilton | 5 years ago
  1. 0

    A manually created Controller with a RequestMapping with multiple paths causes a ClassCastException when trying to run 'web mvc all'. An example RequestMapping would be: @RequestMapping(value = {"/", "/foo"}) I have tested this in 1.2.0, and looking at the source for ControllerOperationsImpl it looks like it is still a problem with the latest version of Roo. In the roo shell, the error looks like this (with version 1.2.0 of Roo): roo> web mvc all --package ~.web Your controller was created outside of the project's top level package and is therefore not included in the preconfigured component scanning. Please adjust your component scanning manually in webmvc-config.xml org.springframework.roo.classpath.details.annotations.ArrayAttributeValue cannot be cast to org.springframework.roo.classpath.details.annotations.StringAttributeValue java.lang.ClassCastException: org.springframework.roo.classpath.details.annotations.ArrayAttributeValue cannot be cast to org.springframework.roo.classpath.details.annotations.StringAttributeValue at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.getExistingController(ControllerOperationsImpl.java:158) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.createAutomaticController(ControllerOperationsImpl.java:114) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.generateAll(ControllerOperationsImpl.java:102) at org.springframework.roo.addon.web.mvc.controller.ControllerCommands.webMvcAll(ControllerCommands.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:183) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:146) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:205) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:404) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:158) at java.lang.Thread.run(Thread.java:662)

    Spring JIRA | 5 years ago | Alan Hamilton
    java.lang.ClassCastException: org.springframework.roo.classpath.details.annotations.ArrayAttributeValue cannot be cast to org.springframework.roo.classpath.details.annotations.StringAttributeValue
  2. 0

    A manually created Controller with a RequestMapping with multiple paths causes a ClassCastException when trying to run 'web mvc all'. An example RequestMapping would be: @RequestMapping(value = {"/", "/foo"}) I have tested this in 1.2.0, and looking at the source for ControllerOperationsImpl it looks like it is still a problem with the latest version of Roo. In the roo shell, the error looks like this (with version 1.2.0 of Roo): roo> web mvc all --package ~.web Your controller was created outside of the project's top level package and is therefore not included in the preconfigured component scanning. Please adjust your component scanning manually in webmvc-config.xml org.springframework.roo.classpath.details.annotations.ArrayAttributeValue cannot be cast to org.springframework.roo.classpath.details.annotations.StringAttributeValue java.lang.ClassCastException: org.springframework.roo.classpath.details.annotations.ArrayAttributeValue cannot be cast to org.springframework.roo.classpath.details.annotations.StringAttributeValue at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.getExistingController(ControllerOperationsImpl.java:158) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.createAutomaticController(ControllerOperationsImpl.java:114) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.generateAll(ControllerOperationsImpl.java:102) at org.springframework.roo.addon.web.mvc.controller.ControllerCommands.webMvcAll(ControllerCommands.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:183) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:146) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:205) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:404) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:158) at java.lang.Thread.run(Thread.java:662)

    Spring JIRA | 5 years ago | Alan Hamilton
    java.lang.ClassCastException: org.springframework.roo.classpath.details.annotations.ArrayAttributeValue cannot be cast to org.springframework.roo.classpath.details.annotations.StringAttributeValue
  3. 0

    Memcached Java客户端2.6.1发布 - 编程语言 - ITeye资讯

    iteye.com | 1 year ago
    java.lang.ClassCastException: cannot be cast to
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Scala 2.11.5 and Squeryl?

    Google Groups | 2 years ago | Clint Gilbert
    java.lang.ClassCastException: scala.None$ cannot be cast to
  6. 0

    adam2vcf

    Google Groups | 8 months ago | someya sayeh
    java.lang.ClassCastException: org.bdgenomics.formats.avro.Fragment cannot be cast to

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.springframework.roo.classpath.details.annotations.ArrayAttributeValue cannot be cast to org.springframework.roo.classpath.details.annotations.StringAttributeValue

      at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.getExistingController()
    2. org.springframework.roo
      ControllerCommands.webMvcAll
      1. org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.getExistingController(ControllerOperationsImpl.java:158)
      2. org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.createAutomaticController(ControllerOperationsImpl.java:114)
      3. org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.generateAll(ControllerOperationsImpl.java:102)
      4. org.springframework.roo.addon.web.mvc.controller.ControllerCommands.webMvcAll(ControllerCommands.java:65)
      4 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    4. org.springframework.roo
      JLineShell.run
      1. org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191)
      2. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49)
      3. org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:183)
      4. org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:146)
      5. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47)
      6. org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:205)
      7. org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:404)
      8. org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:158)
      8 frames
    5. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:662)
      1 frame