java.lang.IllegalArgumentException: Method 'update' already defined in target type de.controllerpushintest.web.FooController' (ITD target 'de.controllerpushintest.web.FooController_Roo_Controller')

Spring JIRA | Stefan Ocke | 6 years ago
  1. 0

    I created a simple project with one entity "Foo" and one field. Then I scaffolded the controller with controller all. Now, I did 'push-in-refactoring' for the "update" method of the controller. The Roo shell gives following exception then: [Spring Roo Process Manager Background Polling Thread] Method 'update' already defined in target type 'de.controllerpushintest.web.Foo Controller' (ITD target 'de.controllerpushintest.web.FooController_Roo_Controller') java.lang.IllegalArgumentException: Method 'update' already defined in target type de.controllerpushintest.web.FooController' (ITD target 'de.controllerpushintest.web.FooController_Roo_Controller') at org.springframework.roo.support.util.Assert.isNull(Assert.java:89) at org.springframework.roo.classpath.details.ItdTypeDetailsBuilder.onAddMethod(ItdTypeDetailsBuilder.java:84) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:138) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:156) at org.springframework.roo.addon.web.mvc.controller.scaffold.mvc.WebScaffoldMetadata.<init>(WebScaffoldMetadata.java:105) ... Afterwards, the Roo shell seems not to react on changes applied to the controller at all. It's critical, since one cannot customize controllers anymore.

    Spring JIRA | 6 years ago | Stefan Ocke
    java.lang.IllegalArgumentException: Method 'update' already defined in target type de.controllerpushintest.web.FooController' (ITD target 'de.controllerpushintest.web.FooController_Roo_Controller')
  2. 0

    I created a simple project with one entity "Foo" and one field. Then I scaffolded the controller with controller all. Now, I did 'push-in-refactoring' for the "update" method of the controller. The Roo shell gives following exception then: [Spring Roo Process Manager Background Polling Thread] Method 'update' already defined in target type 'de.controllerpushintest.web.Foo Controller' (ITD target 'de.controllerpushintest.web.FooController_Roo_Controller') java.lang.IllegalArgumentException: Method 'update' already defined in target type de.controllerpushintest.web.FooController' (ITD target 'de.controllerpushintest.web.FooController_Roo_Controller') at org.springframework.roo.support.util.Assert.isNull(Assert.java:89) at org.springframework.roo.classpath.details.ItdTypeDetailsBuilder.onAddMethod(ItdTypeDetailsBuilder.java:84) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:138) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:156) at org.springframework.roo.addon.web.mvc.controller.scaffold.mvc.WebScaffoldMetadata.<init>(WebScaffoldMetadata.java:105) ... Afterwards, the Roo shell seems not to react on changes applied to the controller at all. It's critical, since one cannot customize controllers anymore.

    Spring JIRA | 6 years ago | Stefan Ocke
    java.lang.IllegalArgumentException: Method 'update' already defined in target type de.controllerpushintest.web.FooController' (ITD target 'de.controllerpushintest.web.FooController_Roo_Controller')
  3. 0

    For example pushing in setUsername in the stock expenses project causes the following: {code} java.lang.IllegalArgumentException: Method 'setUserName' already defined in ITD (ITD target 'org.springsource.roo.extrack.server.domain.EmployeeDataOnDemand_Roo_DataOnDemand' java.lang.IllegalStateException: java.lang.IllegalArgumentException: Method 'setUserName' already defined in ITD (ITD target 'org.springsource.roo.extrack.server.domain.EmployeeDataOnDemand_Roo_DataOnDemand' at org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:178) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:81) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:216) at org.springframework.roo.addon.test.IntegrationTestMetadataProviderImpl.getMetadata(IntegrationTestMetadataProviderImpl.java:69) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:269) at org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:147) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:81) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:147) at org.springframework.roo.metadata.DefaultMetadataService.notify(DefaultMetadataService.java:236) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:191) at org.springframework.roo.classpath.javaparser.JavaParserMetadataProvider.onFileEvent(JavaParserMetadataProvider.java:131) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:330) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanAll(PollingFileMonitorService.java:304) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:178) at org.springframework.roo.process.manager.internal.DefaultProcessManager.backgroundPoll(DefaultProcessManager.java:125) at org.springframework.roo.process.manager.internal.DefaultProcessManager.timerBasedPoll(DefaultProcessManager.java:240) at org.springframework.roo.process.manager.internal.DefaultProcessManager$2.run(DefaultProcessManager.java:68) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.IllegalArgumentException: Method 'setUserName' already defined in ITD (ITD target 'org.springsource.roo.extrack.server.domain.EmployeeDataOnDemand_Roo_DataOnDemand' at org.springframework.roo.support.util.Assert.isNull(Assert.java:89) at org.springframework.roo.classpath.details.ItdTypeDetailsBuilder.onAddMethod(ItdTypeDetailsBuilder.java:100) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:183) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:207) at org.springframework.roo.addon.dod.DataOnDemandMetadata.addFieldMutatorMethodsToBuilder(DataOnDemandMetadata.java:426) at org.springframework.roo.addon.dod.DataOnDemandMetadata.<init>(DataOnDemandMetadata.java:120) at org.springframework.roo.addon.dod.DataOnDemandMetadataProviderImpl.getMetadata(DataOnDemandMetadataProviderImpl.java:130) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:269) at org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:147) ... 17 more {code}

    Spring JIRA | 5 years ago | James Tyrrell
    java.lang.IllegalStateException: java.lang.IllegalArgumentException: Method 'setUserName' already defined in ITD (ITD target 'org.springsource.roo.extrack.server.domain.EmployeeDataOnDemand_Roo_DataOnDemand'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    If a JPA Entity is annotated with @Embeddable, Roo fails to generate ApplicationConversionServiceFactoryBean_Roo_ConversionService (ultimately resulting in no Roo files being generated). Steps to reproduce: // Spring Roo 1.3.1.RELEASE [rev f4f5256] log opened at 2015-04-20 11:58:19 project --topLevelPackage com.foo jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY entity jpa --class ~.Bar // At this point, add @Embeddable annotation to the class, then continue: web mvc setup web mvc scaffold --class ~.Bar // [failed] web mvc scaffold --class ~.BarController With 'development mode' turned on, error message looks like this: Method 'getBarToStringConverter' already defined in ITD (ITD target 'com.foo.ApplicationConversionServiceFactoryBean_Roo_ConversionService') java.lang.IllegalArgumentException: Method 'getBarToStringConverter' already defined in ITD (ITD target 'com.foo.ApplicationConversionServiceFactoryBean_Roo_ConversionService') at org.apache.commons.lang3.Validate.isTrue(Validate.java:155) at org.springframework.roo.classpath.details.ItdTypeDetailsBuilder.onAddMethod(ItdTypeDetailsBuilder.java:286) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:187) at org.springframework.roo.addon.web.mvc.controller.converter.ConversionServiceMetadata.getInstallEmbeddableConvertersMethod(ConversionServiceMetadata.java:141) at org.springframework.roo.addon.web.mvc.controller.converter.ConversionServiceMetadata.<init>(ConversionServiceMetadata.java:123) at org.springframework.roo.addon.web.mvc.controller.converter.ConversionServiceMetadataProviderImpl.getMetadata(ConversionServiceMetadataProviderImpl.java:220) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:264) at org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:212) at org.springframework.roo.metadata.DefaultMetadataService.evictAndGet(DefaultMetadataService.java:121) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:601) at org.springframework.roo.metadata.DefaultMetadataService.notify(DefaultMetadataService.java:325) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:200) at org.springframework.roo.classpath.DefaultPhysicalTypeMetadataProvider.onFileEvent(DefaultPhysicalTypeMetadataProvider.java:250) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:433) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publishRequestedFileEvents(PollingFileMonitorService.java:456) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanNotified(PollingFileMonitorService.java:660) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:335) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:71) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:44) at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:242) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:421) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:539) at java.lang.Thread.run(Thread.java:745)

    Spring JIRA | 2 years ago | Alan Hamilton
    java.lang.IllegalArgumentException: Method 'getBarToStringConverter' already defined in ITD (ITD target 'com.foo.ApplicationConversionServiceFactoryBean_Roo_ConversionService')
  6. 0

    I'm using Roo 1.1.1 from git, and on launching in an existing Roo 1.1.0 managed project I get an exception (below). I have been able to reduce this to a simple repeatable test case, which fails on the final line:- [Roo script] project --topLevelPackage com.example.treenode.webscaffold persistence setup --provider ECLIPSELINK --database HYPERSONIC_IN_MEMORY entity --class ~.domain.TreeNode --testAutomatically field string name --notNull --sizeMax 30 field reference --fieldName parent --type ~.domain.TreeNode --cardinality ONE_TO_ONE field set --fieldName children --type ~.domain.TreeNode --cardinality ONE_TO_MANY --mappedBy parent controller scaffold --class ~.web.roo.TreeNodeController --entity ~.domain.TreeNode [Exception] java.lang.IllegalArgumentException: Method 'getTreeNodeConverter' already defined in ITD (ITD target 'com.example.treenode.webscaffold.web.roo.TreeNodeController_Roo_Controller' at org.springframework.roo.support.util.Assert.isNull(Assert.java:89) at org.springframework.roo.classpath.details.ItdTypeDetailsBuilder.onAddMethod(ItdTypeDetailsBuilder.java:78) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:105) at org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:123) at org.springframework.roo.addon.web.mvc.controller.WebScaffoldMetadata.getRegisterConvertersMethod(WebScaffoldMetadata.java:948) at org.springframework.roo.addon.web.mvc.controller.WebScaffoldMetadata.<init>(WebScaffoldMetadata.java:137) at org.springframework.roo.addon.web.mvc.controller.WebScaffoldMetadataProviderImpl.getMetadata(WebScaffoldMetadataProviderImpl.java:76) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:251) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:139) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:125) at org.springframework.roo.metadata.DefaultMetadataService.notify(DefaultMetadataService.java:179) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:262) at org.springframework.roo.classpath.javaparser.JavaParserMetadataProvider.onFileEvent(JavaParserMetadataProvider.java:138) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:344) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanNotified(PollingFileMonitorService.java:217) at org.springframework.roo.process.manager.internal.DefaultFileManager.scan(DefaultFileManager.java:195) at org.springframework.roo.addon.web.mvc.controller.WebMvcOperationsImpl.createWebApplicationContext(WebMvcOperationsImpl.java:151) at org.springframework.roo.addon.web.mvc.controller.WebMvcOperationsImpl.installMinmalWebArtefacts(WebMvcOperationsImpl.java:48) at org.springframework.roo.addon.web.mvc.controller.WebMvcOperationsImpl.installAllWebMvcArtifacts(WebMvcOperationsImpl.java:54) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.createAutomaticController(ControllerOperationsImpl.java:123) at org.springframework.roo.addon.web.mvc.controller.ControllerCommands.newController(ControllerCommands.java:93) 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:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:165) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:358) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:132) at java.lang.Thread.run(Thread.java:619)

    Spring JIRA | 6 years ago | Jim Smart
    java.lang.IllegalArgumentException: Method 'getTreeNodeConverter' already defined in ITD (ITD target 'com.example.treenode.webscaffold.web.roo.TreeNodeController_Roo_Controller'

    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.IllegalArgumentException

      Method 'update' already defined in target type de.controllerpushintest.web.FooController' (ITD target 'de.controllerpushintest.web.FooController_Roo_Controller')

      at org.springframework.roo.support.util.Assert.isNull()
    2. org.springframework.roo
      WebScaffoldMetadata.<init>
      1. org.springframework.roo.support.util.Assert.isNull(Assert.java:89)
      2. org.springframework.roo.classpath.details.ItdTypeDetailsBuilder.onAddMethod(ItdTypeDetailsBuilder.java:84)
      3. org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:138)
      4. org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetailsBuilder.addMethod(AbstractMemberHoldingTypeDetailsBuilder.java:156)
      5. org.springframework.roo.addon.web.mvc.controller.scaffold.mvc.WebScaffoldMetadata.<init>(WebScaffoldMetadata.java:105)
      5 frames