java.lang.IllegalArgumentException: Unable to obtain required element '/web-app/context-param[param-value='classpath:applicationContext.xml']/param-value' from element '[web-app: null]'

Spring JIRA | Ben Alex | 8 years ago
  1. 0

    Crash in Dao constructor

    GitHub | 1 year ago | davidbilik
    java.lang.IllegalArgumentException: DatabaseErrorHandler param value can't be null.
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    This does not work: {code} @GET public String doGet(@Uri("http://oracle.com/{template}") WebTarget webTarget2) { System.out.println("This code is not even reached."); String uriString = webTarget2.resolveTemplate("template", "abc").getUri().toString(); } {code} Exception is thrown during injection of 'webTarget2'. This currently only works if {template} is path parameter (see UriTest.java in server tests). In that case it is resolved automatically during injection and user gets already resolved web target. But it should be possible to use templates and resolve them in the user code as shown above. Exception stack trace: {code} 3. java.lang.IllegalStateException: Unable to create or inject org.glassfish.jersey.server.internal.inject.UriTest$Resource2 at org.jvnet.hk2.internal.Collector.throwIfErrors(Collector.java:79) at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:191) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:272) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:429) at org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:157) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:1932) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:568) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:555) at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:189) at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185) at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:105) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:118) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:121) at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:102) at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:62) at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:198) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:183) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:852) at org.glassfish.jersey.server.ApplicationHandler.apply(ApplicationHandler.java:721) at org.glassfish.jersey.server.ApplicationHandler.apply(ApplicationHandler.java:699) ... 28 more Caused by: java.lang.IllegalArgumentException: The template variable, param, has no value at org.glassfish.jersey.uri.UriTemplate.templateVariableHasNoValue(UriTemplate.java:831) at org.glassfish.jersey.uri.UriTemplate.createURIComponent(UriTemplate.java:766) at org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:709) at org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:578) at org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:541) at org.glassfish.jersey.uri.internal.JerseyUriBuilder._buildFromMap(JerseyUriBuilder.java:797) at org.glassfish.jersey.uri.internal.JerseyUriBuilder.buildFromEncodedMap(JerseyUriBuilder.java:786) at org.glassfish.jersey.server.internal.inject.WebTargetValueFactoryProvider$WebTargetValueFactory.get(WebTargetValueFactoryProvider.java:264) at org.glassfish.jersey.server.internal.inject.WebTargetValueFactoryProvider$WebTargetValueFactory.get(WebTargetValueFactoryProvider.java:248) at org.glassfish.jersey.server.internal.inject.AbstractHttpContextValueFactory.provide(AbstractHttpContextValueFactory.java:67) at org.glassfish.jersey.server.internal.inject.ParamInjectionResolver.resolve(ParamInjectionResolver.java:134) at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:153) at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:176) ... 51 more {code}

    Java.net JIRA | 4 years ago | Miroslav Fuksa
    java.lang.IllegalStateException: Unable to create or inject org.glassfish.jersey.server.internal.inject.UriTest$Resource2
  4. 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]'

    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 '/web-app/context-param[param-value='classpath:applicationContext.xml']/param-value' from element '[web-app: null]'

      at org.springframework.roo.support.util.Assert.notNull()
    2. org.springframework.roo
      XmlUtils.findRequiredElement
      1. org.springframework.roo.support.util.Assert.notNull(Assert.java:112)
      2. org.springframework.roo.support.util.XmlUtils.findRequiredElement(XmlUtils.java:230)
      2 frames
    3. Spring Roo - Annotations (ASLv2 Licensed)
      SecurityOperations.installSecurity
      1. org.springframework.roo.addon.security.SecurityOperations.installSecurity(SecurityOperations.java:101)
      1 frame