java.lang.IllegalArgumentException: Method 'entityManager' already defined in target type 'com.foo.Food' (ITD target 'com.foo.Food_Roo_Entity')

Spring JIRA | Ben Alex | 7 years ago
  1. 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'
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  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. 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')

    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 'entityManager' already defined in target type 'com.foo.Food' (ITD target 'com.foo.Food_Roo_Entity')

      at org.springframework.roo.support.util.Assert.isNull()
    2. org.springframework.roo
      EntityMetadataProvider.getMetadata
      1. org.springframework.roo.support.util.Assert.isNull(Assert.java:89)
      2. org.springframework.roo.classpath.details.DefaultItdTypeDetailsBuilder.addMethod(DefaultItdTypeDetailsBuilder.java:93)
      3. org.springframework.roo.addon.entity.EntityMetadata.<init>(EntityMetadata.java:143)
      4. org.springframework.roo.addon.entity.EntityMetadataProvider.getMetadata(EntityMetadataProvider.java:73)
      4 frames