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

Spring JIRA | Ramnivas Laddad | 7 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  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

    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