java.lang.IllegalArgumentException: Unable to obtain required element '//span[@id='language']' from element '[div: null]'

Spring JIRA | Dzmitry Barouka | 6 years ago
  1. 0

    Use default language (EN) if there is no <span id="language"/> in the footer.jspx. Otherwise, there can be some exception like this: {code}roo> web mvc install view --path / --viewName about --title About Created SRC_MAIN_WEBAPP\WEB-INF\views\about.jspx Created SRC_MAIN_WEBAPP\WEB-INF\views\index-template.jspx Undo manage SRC_MAIN_WEBAPP\WEB-INF\views\footer.jspx Undo create SRC_MAIN_WEBAPP\WEB-INF\views\index-template.jspx Undo manage SRC_MAIN_WEBAPP\WEB-INF\spring\webmvc-config.xml Undo manage ROOT\pom.xml Undo create SRC_MAIN_WEBAPP\WEB-INF\views\about.jspx Unable to obtain required element '//span[@id='language']' from element '[div: null]' java.lang.IllegalArgumentException: Unable to obtain required element '//span[@id='language']' from element '[div: null]' at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.support.util.XmlUtils.findRequiredElement(XmlUtils.java:208) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installI18n(JspOperationsImpl.java:439) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installCommonViewArtefacts(JspOperationsImpl.java:131) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:177) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:166) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:145) at org.springframework.roo.addon.web.mvc.jsp.JspCommands.installView(JspCommands.java:59) 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:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:32) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:156) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:181) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:107) at java.lang.Thread.run(Thread.java:619){code}

    Spring JIRA | 6 years ago | Dzmitry Barouka
    java.lang.IllegalArgumentException: Unable to obtain required element '//span[@id='language']' from element '[div: null]'
  2. 0

    Use default language (EN) if there is no <span id="language"/> in the footer.jspx. Otherwise, there can be some exception like this: {code}roo> web mvc install view --path / --viewName about --title About Created SRC_MAIN_WEBAPP\WEB-INF\views\about.jspx Created SRC_MAIN_WEBAPP\WEB-INF\views\index-template.jspx Undo manage SRC_MAIN_WEBAPP\WEB-INF\views\footer.jspx Undo create SRC_MAIN_WEBAPP\WEB-INF\views\index-template.jspx Undo manage SRC_MAIN_WEBAPP\WEB-INF\spring\webmvc-config.xml Undo manage ROOT\pom.xml Undo create SRC_MAIN_WEBAPP\WEB-INF\views\about.jspx Unable to obtain required element '//span[@id='language']' from element '[div: null]' java.lang.IllegalArgumentException: Unable to obtain required element '//span[@id='language']' from element '[div: null]' at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.support.util.XmlUtils.findRequiredElement(XmlUtils.java:208) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installI18n(JspOperationsImpl.java:439) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installCommonViewArtefacts(JspOperationsImpl.java:131) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:177) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:166) at org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:145) at org.springframework.roo.addon.web.mvc.jsp.JspCommands.installView(JspCommands.java:59) 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:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:32) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:156) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:181) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:107) at java.lang.Thread.run(Thread.java:619){code}

    Spring JIRA | 6 years ago | Dzmitry Barouka
    java.lang.IllegalArgumentException: Unable to obtain required element '//span[@id='language']' from element '[div: null]'
  3. 0

    The first command to start a project fails. roo> script clinic.roo project --topLevelPackage com.springsource.petclinic Unable to obtain required element '/project/artifactId' from element '[project: null]' java.lang.IllegalArgumentException: Unable to obtain required element '/project/artifactId' from element '[project: null]' at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.support.util.XmlUtils.findRequiredElement(XmlUtils.java:352) at org.springframework.roo.project.MavenOperationsImpl.createProject(MavenOperationsImpl.java:87) at org.springframework.roo.project.MavenCommands.createProject(MavenCommands.java:36) 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:180) 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:191) at org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:131) at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:98) 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:180) 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:191) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:374) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:135) at java.lang.Thread.run(Thread.java:680) Script required 0 second(s) to execute Script execution aborted java.lang.IllegalStateException: Script execution aborted at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:103) 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:180) 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:191) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:374) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:135) at java.lang.Thread.run(Thread.java:680)

    Spring JIRA | 5 years ago | Dirk Joosen
    java.lang.IllegalArgumentException: Unable to obtain required element '/project/artifactId' from element '[project: null]'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The first command to start a project fails. roo> script clinic.roo project --topLevelPackage com.springsource.petclinic Unable to obtain required element '/project/artifactId' from element '[project: null]' java.lang.IllegalArgumentException: Unable to obtain required element '/project/artifactId' from element '[project: null]' at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.support.util.XmlUtils.findRequiredElement(XmlUtils.java:352) at org.springframework.roo.project.MavenOperationsImpl.createProject(MavenOperationsImpl.java:87) at org.springframework.roo.project.MavenCommands.createProject(MavenCommands.java:36) 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:180) 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:191) at org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:131) at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:98) 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:180) 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:191) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:374) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:135) at java.lang.Thread.run(Thread.java:680) Script required 0 second(s) to execute Script execution aborted java.lang.IllegalStateException: Script execution aborted at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:103) 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:180) 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:191) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:374) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:135) at java.lang.Thread.run(Thread.java:680)

    Spring JIRA | 5 years ago | Dirk Joosen
    java.lang.IllegalArgumentException: Unable to obtain required element '/project/artifactId' from element '[project: null]'

    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

      Unable to obtain required element '//span[@id='language']' from element '[div: null]'

      at org.springframework.roo.support.util.Assert.notNull()
    2. org.springframework.roo
      JspCommands.installView
      1. org.springframework.roo.support.util.Assert.notNull(Assert.java:112)
      2. org.springframework.roo.support.util.XmlUtils.findRequiredElement(XmlUtils.java:208)
      3. org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installI18n(JspOperationsImpl.java:439)
      4. org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installCommonViewArtefacts(JspOperationsImpl.java:131)
      5. org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:177)
      6. org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:166)
      7. org.springframework.roo.addon.web.mvc.jsp.JspOperationsImpl.installView(JspOperationsImpl.java:145)
      8. org.springframework.roo.addon.web.mvc.jsp.JspCommands.installView(JspCommands.java:59)
      8 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:177)
      4. org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140)
      5. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:32)
      6. org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:156)
      7. org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:181)
      8. org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:107)
      8 frames