Announcement Announcement Module
Collapse
No announcement yet.
LocaleContextHolder throws NullPointerException with DWR Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • LocaleContextHolder throws NullPointerException with DWR

    We are using Spring version 2.0 with Webflow 1.0 running on a WebSphere server version 6.1.

    On one of our pages we use DWR to populate some drop downs. The DWR call references the same code that populates the page on entry. That code uses LocaleContextHolder to resolve the current locale.

    Occasionally, when we make the DWR call we get this:
    Code:
    org.directwebremoting.impl.DefaultRemoter - Method execution failed: 
    java.lang.NullPointerException
    at com.ibm.ws.webcontainer.srt.SRTServletRequest$SRTServletRequestHelper.access$1900(SRTServletRequest.java:2232)
    at com.ibm.ws.webcontainer.srt.SRTServletRequest.processLocales(SRTServletRequest.java:1745)
    at com.ibm.ws.webcontainer.srt.SRTServletRequest.getLocale(SRTServletRequest.java:496)
    at org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver.resolveLocale(AcceptHeaderLocaleResolver.java:41)
    at org.springframework.web.servlet.DispatcherServlet$1.getLocale(DispatcherServlet.java:767)
    at org.springframework.context.i18n.LocaleContextHolder.getLocale(LocaleContextHolder.java:82)
    at com.shelter.ca.web.quote.dwr.actions.VinInfoAction.addSelectAndNotListed(VinInfoAction.java:812)
    On the front end, all we see an an alert box with the word "error"

    Does anyone know why we might be getting this?

  • #2
    Seeing same problem - any solutions ?

    Linkbew, did you ever resolve this problem ? We are seeing the same thing (although triggered from a different place, the error is the same). Did you ever get to the bottom of the cause. Any pointers you or any one else can give appreciated ....

    Comment


    • #3
      We did figure something out. Since DWR requests are not always in the same thread, we couldn't use the LocaleContextHolder to get the locale. What we had to do was for DWR request, we pass the locale in the DWR request. This means that we had to pass it to the front-end first, which is annoying but necessary.

      Comment

      Working...
      X