java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists

Spring JIRA | Ramnivas Laddad | 7 years ago
  1. 0

    I need a way to switch the current entity. I restarted Roo shell for a project and want to add fields to ~.domain.Worker. If I do {code} roo> entity ~.domain.Worker {code} I get a stack trace {code} SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists at org.springframework.roo.support.util.Assert.isTrue(Assert.java:65) at org.springframework.roo.classpath.operations.ClasspathOperationsImpl.generateClassFile(ClasspathOperationsImpl.java:117) at org.springframework.roo.classpath.operations.ClasspathCommands.newPersistenceClassJpa(ClasspathCommands.java:258) 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:34) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:164) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:127) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:32) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:195) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:122) at java.lang.Thread.run(Thread.java:637) ~.domain.Worker roo> {code} While the switching of the current entity took place, the stack trace could be avoided. This used to work in 1.0.x, BTW (i.e. no stack trace) Ideally, the message could be changed (and no stack trace) to: SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists; making it the current entity Alternatively, a new command could be added to switch the current entity.

    Spring JIRA | 7 years ago | Ramnivas Laddad
    java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists
  2. 0

    I need a way to switch the current entity. I restarted Roo shell for a project and want to add fields to ~.domain.Worker. If I do {code} roo> entity ~.domain.Worker {code} I get a stack trace {code} SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists at org.springframework.roo.support.util.Assert.isTrue(Assert.java:65) at org.springframework.roo.classpath.operations.ClasspathOperationsImpl.generateClassFile(ClasspathOperationsImpl.java:117) at org.springframework.roo.classpath.operations.ClasspathCommands.newPersistenceClassJpa(ClasspathCommands.java:258) 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:34) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:164) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:127) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:32) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:195) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:122) at java.lang.Thread.run(Thread.java:637) ~.domain.Worker roo> {code} While the switching of the current entity took place, the stack trace could be avoided. This used to work in 1.0.x, BTW (i.e. no stack trace) Ideally, the message could be changed (and no stack trace) to: SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists; making it the current entity Alternatively, a new command could be added to switch the current entity.

    Spring JIRA | 7 years ago | Ramnivas Laddad
    java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists
  3. 0

    Using Roo 1.1.1 snapshot, I'm getting this exception: controller scaffold --class ~.web.ChangeUserDataController --entity ~.domain.ChangeUserData --disallowedOperations update,delete [...] controller all --package ~.web SRC_MAIN_JAVA/com/myapp/web/ChangeUserDataController.java already exists java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/lbpoker/selfcare/web/ChangeUserDataController.java already exists at org.springframework.roo.support.util.Assert.isTrue(Assert.java:65) at org.springframework.roo.classpath.operations.ClasspathOperationsImpl.generateClassFile(ClasspathOperationsImpl.java:119) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.createAutomaticController(ControllerOperationsImpl.java:116) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.generateAll(ControllerOperationsImpl.java:75) at org.springframework.roo.addon.web.mvc.controller.ControllerCommands.generateAll(ControllerCommands.java:52) 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:662) This seems to contradict the documentation... roo> help controller all Keyword: controller all Description: Scaffold a controller for all entities without an existing controlle,

    Spring JIRA | 6 years ago | Ludovic Claude
    java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/lbpoker/selfcare/web/ChangeUserDataController.java already exists
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Using Roo 1.1.1 snapshot, I'm getting this exception: controller scaffold --class ~.web.ChangeUserDataController --entity ~.domain.ChangeUserData --disallowedOperations update,delete [...] controller all --package ~.web SRC_MAIN_JAVA/com/myapp/web/ChangeUserDataController.java already exists java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/lbpoker/selfcare/web/ChangeUserDataController.java already exists at org.springframework.roo.support.util.Assert.isTrue(Assert.java:65) at org.springframework.roo.classpath.operations.ClasspathOperationsImpl.generateClassFile(ClasspathOperationsImpl.java:119) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.createAutomaticController(ControllerOperationsImpl.java:116) at org.springframework.roo.addon.web.mvc.controller.ControllerOperationsImpl.generateAll(ControllerOperationsImpl.java:75) at org.springframework.roo.addon.web.mvc.controller.ControllerCommands.generateAll(ControllerCommands.java:52) 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:662) This seems to contradict the documentation... roo> help controller all Keyword: controller all Description: Scaffold a controller for all entities without an existing controlle,

    Spring JIRA | 6 years ago | Ludovic Claude
    java.lang.IllegalArgumentException: SRC_MAIN_JAVA/com/lbpoker/selfcare/web/ChangeUserDataController.java already exists
  6. 0

    Got exception after refactoring apply

    YouTrack | 6 years ago
    java.lang.IllegalArgumentException: Association already exists [__CUSTOM_FIELD__Subsystem_8]

    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

      SRC_MAIN_JAVA/com/mycompany/hr/domain/Worker.java already exists

      at org.springframework.roo.support.util.Assert.isTrue()
    2. org.springframework.roo
      ClasspathCommands.newPersistenceClassJpa
      1. org.springframework.roo.support.util.Assert.isTrue(Assert.java:65)
      2. org.springframework.roo.classpath.operations.ClasspathOperationsImpl.generateClassFile(ClasspathOperationsImpl.java:117)
      3. org.springframework.roo.classpath.operations.ClasspathCommands.newPersistenceClassJpa(ClasspathCommands.java:258)
      3 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:34)
      3. org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:164)
      4. org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:127)
      5. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:32)
      6. org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149)
      7. org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:195)
      8. org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:122)
      8 frames
    5. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:637)
      1 frame