Cocoon
  1. Cocoon
  2. COCOON-2277

NPE in DynamicURLStreamHandlerFactory (Cocoon JNET)

    Details

    • Urgency:
      Urgent
    • Affects version (Component):
      Servlet Service Framework - 1.1.0-dev

      Description

      From time to time after more heavy of our cocoon 2.2 based application (which is not yet in production) I am getting this exception from cocoon jnet. after this exception occurs we have to restart the web application as this exception keeps coming and noone can do anything with the webapp....

      java.lang.NullPointerException
                      java.util.LinkedList.remove(LinkedList.java:646)
                      java.util.LinkedList.remove(LinkedList.java:360)
                      org.apache.cocoon.jnet.DynamicURLStreamHandlerFactory.pop(DynamicURLStreamHandlerFactory.java:30)
                      org.apache.cocoon.jnet.URLHandlerFactoryCollector.popUrlHandlerFactories(URLHandlerFactoryCollector.java:57)
                      org.apache.cocoon.jnet.URLHandlerFactoryCollector.installURLHandlers(URLHandlerFactoryCollector.java:39)
                      sun.reflect.GeneratedMethodAccessor516.invoke(Unknown Source)
                      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      java.lang.reflect.Method.invoke(Method.java:585)
                      org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
                      org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
                      org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
                      org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
                      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
                      $Proxy34.service(Unknown Source)
                      org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:481)
                      org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:455)
                      org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:245)
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
                      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
                      $Proxy94.service(Unknown Source)
                      org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)
                      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                      org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:131)

      *NOTE* that another open source project reported similar problems:
      http://jira.dspace.org/jira/browse/DS-253?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        334d 16h 17m 1 Reinhard Poetz 03/Jan/11 23:49
        Reinhard Poetz made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Reinhard Poetz added a comment -
        Patch applied as suggest by me and confirmed by others.
        Show
        Reinhard Poetz added a comment - Patch applied as suggest by me and confirmed by others.
        Reinhard Poetz made changes -
        Field Original Value New Value
        Assignee Reinhard Poetz [ reinhard@apache.org ]
        Hide
        Sands Fish added a comment -
        Show
        Sands Fish added a comment - For reference, here is the mailing list suggestion: http://mail-archives.apache.org/mod_mbox/cocoon-users/201002.mbox/%3c4B6B1DF2.1080806@apache.org%3e
        Hide
        Gabriel Gruber added a comment -
        I applied Reinhard Pötz's suggested patch, as written on the mailing list:

        change line 42 of o.a.c.jnet.DynamicURLStreamHandlerFactory to

        list = Collections.synchronizedList(new
            LinkedList<URLStreamHandlerFactory>())

        The synchronization actually solved it for me...
        Show
        Gabriel Gruber added a comment - I applied Reinhard Pötz's suggested patch, as written on the mailing list: change line 42 of o.a.c.jnet.DynamicURLStreamHandlerFactory to list = Collections.synchronizedList(new     LinkedList<URLStreamHandlerFactory>()) The synchronization actually solved it for me...
        Hide
        Sands Fish added a comment -
        I'm from the "other open source project", and I want to confirm that this bug is biting us very hard. I work on MIT's DSpace repository, and we are seeing regular occurrences of up to 3 or 4 times per day on our production instance.

        I was able to reproduce the condition by stressing our server with a large amount of concurrent requests on the same URL. Particularly, on a URL that throws an exception during pipeline processing, though this is correct behavior for our application.

        We received the exact same exception as listed above and this is happening on a regular basis due to the amount of traffic from spiders + normal traffic.

        Could someone please comment on the status of this fix and the anticipated resolution time? There are some hacks on the JIRA ticket for DSpace listed above.
        Show
        Sands Fish added a comment - I'm from the "other open source project", and I want to confirm that this bug is biting us very hard. I work on MIT's DSpace repository, and we are seeing regular occurrences of up to 3 or 4 times per day on our production instance. I was able to reproduce the condition by stressing our server with a large amount of concurrent requests on the same URL. Particularly, on a URL that throws an exception during pipeline processing, though this is correct behavior for our application. We received the exact same exception as listed above and this is happening on a regular basis due to the amount of traffic from spiders + normal traffic. Could someone please comment on the status of this fix and the anticipated resolution time? There are some hacks on the JIRA ticket for DSpace listed above.
        Gabriel Gruber created issue -

          People

          • Assignee:
            Reinhard Poetz
            Reporter:
            Gabriel Gruber
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development