java.lang.IllegalArgumentException: Schema required

Spring JIRA | Alan Stewart | 6 years ago
  1. 0

    I have an entity derived from a common base class. The id and version are defiend on the base. ROO creates the crud methods on the base aj class, not the subclass. The resulting entity needs to be read only. I performed the following steps in roo. 1. Changed the @RooEntity on the base class (BaseFKItem.java)from @org.springframework.roo.addon.entity.RooEntity to @org.springframework.roo.addon.entity.RooEntity(persistMethod="", removeMethod="", mergeMethod="") 2. Changed the @RooEntity on the subclass (CiLogTypeFKItem.java)in the same way 3. Tried to generate an intergration test for the subclass, I get an error "Persist method required" See stack trace below: ~.entities.cilogs.CiLogTypeFKItem roo> test integration --entity ~.entities.cilogs.CiLogTypeFKItem Created SRC_TEST_JAVA\com\kn\tls\toolkit\entities\cilogs\CiLogTypeFKItemDataOnDemand.java Created SRC_TEST_JAVA\com\kn\tls\toolkit\entities\cilogs\CiLogTypeFKItemIntegrationTest.java Created SRC_TEST_JAVA\com\kn\tls\toolkit\entities\cilogs\CiLogTypeFKItemDataOnDemand_Roo_Configurable.aj Undo create SRC_TEST_JAVA\com\kn\tls\toolkit\entities\cilogs\CiLogTypeFKItemDataOnDemand_Roo_Configurable.aj Undo create SRC_TEST_JAVA\com\kn\tls\toolkit\entities\cilogs\CiLogTypeFKItemIntegrationTest.java Undo create SRC_TEST_JAVA\com\kn\tls\toolkit\entities\cilogs\CiLogTypeFKItemDataOnDemand.java Persist method required java.lang.IllegalArgumentException: Persist method required at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.addon.dod.DataOnDemandMetadata.<init>(DataOnDemandMetadata.java:83) at org.springframework.roo.addon.dod.DataOnDemandMetadataProvider.getMetadata(DataOnDemandMetadataProvider.java:82) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:238) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:103) at org.springframework.roo.metadata.internal.DefaultMetadataService.notify(DefaultMetadataService.java:148) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:256) at org.springframework.roo.classpath.javaparser.JavaParserMetadataProvider.onFileEvent(JavaParserMetadataProvider.java:131) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:333) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanNotified(PollingFileMonitorService.java:212) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:138) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:95) at org.springframework.roo.bootstrap.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:31) at org.springframework.roo.shell.internal.AbstractShell.executeCommand(AbstractShell.java:132) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:158) at org.springframework.roo.bootstrap.Bootstrap.run(Bootstrap.java:114) at org.springframework.roo.bootstrap.Bootstrap.main(Bootstrap.java:53) ~.entities.cilogs.CiLogTypeFKItem roo>

    Spring JIRA | 7 years ago | Tim Taylor
    java.lang.IllegalArgumentException: Persist method required
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    This started cropping up on our project following 1.1.2-RELEASE upgrade this week. Its not providing a lot of context to go by though. The previous lines don't give much clue as to what class its even working on, so I can't isolate it easily. I also can't judge what affect its having, whether its blocking our work with Roo or not. [FelixDispatchQueue] It is recommended to use @DateTimeFormat(style="S-") on cancellationDate to use automatic date conversion in Spring MVC [FelixDispatchQueue] Unable to obtain physical type metdata for type java.lang.Object java.lang.IllegalArgumentException: Unable to obtain physical type metdata for type java.lang.Object at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.addon.web.mvc.controller.converter.ConversionServiceMetadataProvider.findRelevantTypes(ConversionServiceMetadataProvider.java:106) at org.springframework.roo.addon.web.mvc.controller.converter.ConversionServiceMetadataProvider.findDomainTypesRequiringAConverter(ConversionServiceMetadataProvider.java:99) at org.springframework.roo.addon.web.mvc.controller.converter.ConversionServiceMetadataProvider.getMetadata(ConversionServiceMetadataProvider.java:83) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:269) at org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:148) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:82) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:146) at org.springframework.roo.metadata.DefaultMetadataService.notify(DefaultMetadataService.java:235) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:214) 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.project.ProjectPathMonitoringInitializer.notify(ProjectPathMonitoringInitializer.java:86) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:233) at org.springframework.roo.project.MavenProjectMetadataProvider.onFileEvent(MavenProjectMetadataProvider.java:207) 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.MonitoringRequestCommand.callback(MonitoringRequestCommand.java:36) at org.springframework.roo.process.manager.internal.MonitoringRequestCommand.callback(MonitoringRequestCommand.java:15) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:180) at org.springframework.roo.process.manager.internal.DefaultProcessManager.completeStartup(DefaultProcessManager.java:102) at org.springframework.roo.process.manager.internal.DefaultProcessManager.access$100(DefaultProcessManager.java:34) at org.springframework.roo.process.manager.internal.DefaultProcessManager$1.frameworkEvent(DefaultProcessManager.java:55) at org.apache.felix.framework.util.EventDispatcher.invokeFrameworkListenerCallback(EventDispatcher.java:774) at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:725) at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:949) at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:54) at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:106) at java.lang.Thread.run(Unknown Source)

    Spring JIRA | 6 years ago | Brad Murray
    java.lang.IllegalArgumentException: Unable to obtain physical type metdata for type java.lang.Object
  4. 0

    I am moving the @Id setup to the .java to handle integration of pre set up Sequences. Such as: {code:title=Products.java} @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="prod_seq") @SequenceGenerator(name="prod_seq", sequenceName="PRODUCTS_SEQ") @Column(name = "id") private Integer id; public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } {code} This works as expected with roo modifying the entity as such: {code} @@ -25,19 +21,6 @@ @PersistenceContext transient EntityManager Products.entityManager; - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name = "ID") - private BigDecimal Products.id; - - public BigDecimal Products.getId() { - return this.id; - } - - public void Products.setId(BigDecimal id) { - this.id = id; - } - @Transactional public void Products.persist() { if (this.entityManager == null) this.entityManager = entityManager(); @@ -89,7 +72,7 @@ return entityManager().createQuery("SELECT o FROM Products o", Products.class).getResultList(); } - public static Products Products.findProducts(BigDecimal id) { + public static Products Products.findProducts(Integer id) { if (id == null) return null; return entityManager().find(Products.class, id); } {code} Now if I try to create an integration test (roo> test integration --entity ..) I get the following error: {code} Identifier accessor method required java.lang.IllegalArgumentException: Identifier accessor method required at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.addon.dod.DataOnDemandMetadata.<init>(DataOnDemandMetadata.java:75) at org.springframework.roo.addon.dod.DataOnDemandMetadataProvider.getMetadata(DataOnDemandMetadataProvider.java:129) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:269) at org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:148) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:82) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:146) at org.springframework.roo.metadata.DefaultMetadataService.notify(DefaultMetadataService.java:235) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:214) 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.scanNotified(PollingFileMonitorService.java:213) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:189) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:143) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:181) 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:680) {code} I actually noticed this previously in a slightly different situation. I had created my entity with --testautomatically and had already created a controller scaffold for it. After making the @id modification the error pops up every time I launch roo-dev

    Spring JIRA | 6 years ago | Frank Fahs
    java.lang.IllegalArgumentException: Identifier accessor method required

    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

      Schema required

      at org.springframework.roo.support.util.Assert.notNull()
    2. org.springframework.roo
      Assert.notNull
      1. org.springframework.roo.support.util.Assert.notNull(Assert.java:112)
      1 frame
    3. Spring Roo - Annotations (ASLv2 Licensed)
      DbreModelServiceImpl.bindDatabaseListener
      1. org.springframework.roo.addon.dbre.DbreModelServiceImpl.getDatabase(DbreModelServiceImpl.java:146)
      2. org.springframework.roo.addon.dbre.DbreModelServiceImpl.bindDatabaseListener(DbreModelServiceImpl.java:91)
      2 frames