Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3526

NullPointerException on javax.faces.application.Resource.toString when using -Dsun.io.serialization.extendedDebugInfo=true

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.5
    • 2.0.14, 2.1.8
    • None
    • None

    Description

      I get a NullPointerException when using the -Dsun.io.serialization.extendedDebugInfo=true on avax.faces.application.Resource.toString()
      The problem seems to be that, toString() uses:
      org.apache.myfaces.shared.resource.BaseResourceHandlerSupport.getFacesServletMapping(context)
      with "context" that might be NULL (which is my case).

      Shouldn't toString method use try-catch to prevent exceptions?

      Problem seems to be present in 2.1.6 but I didn't test it.

      12:09:13,258 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/XXXXXXX].[Spring MVC Dispatcher Servlet]] (http--0.0.0.0-8080-4) Servlet.service() para servlet Spring MVC Dispatcher Servlet lanzó excepción: java.lang.NullPointerException
      at org.apache.myfaces.shared.resource.BaseResourceHandlerSupport.getFacesServletMapping(BaseResourceHandlerSupport.java:155) [myfaces-impl-2.1.5.jar:2.1.5]
      at org.apache.myfaces.shared.resource.BaseResourceHandlerSupport.isExtensionMapping(BaseResourceHandlerSupport.java:119) [myfaces-impl-2.1.5.jar:2.1.5]
      at org.apache.myfaces.shared.resource.ResourceImpl.getRequestPath(ResourceImpl.java:231) [myfaces-impl-2.1.5.jar:2.1.5]
      at org.apache.myfaces.view.facelets.tag.composite.CompositeResouceWrapper.getRequestPath(CompositeResouceWrapper.java:74) [myfaces-impl-2.1.5.jar:2.1.5]
      at javax.faces.application.Resource.toString(Resource.java:91) [classes:1.0.0.0.0-SNAPSHOT]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1387) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at java.util.ArrayList.writeObject(ArrayList.java:570) [rt.jar:1.6.0_26]
      at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source) [:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at java.util.ArrayList.writeObject(ArrayList.java:570) [rt.jar:1.6.0_26]
      at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source) [:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at java.util.ArrayList.writeObject(ArrayList.java:570) [rt.jar:1.6.0_26]
      at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source) [:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at java.util.ArrayList.writeObject(ArrayList.java:570) [rt.jar:1.6.0_26]
      at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source) [:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at java.util.ArrayList.writeObject(ArrayList.java:570) [rt.jar:1.6.0_26]
      at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source) [:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at java.util.HashMap.writeObject(HashMap.java:1001) [rt.jar:1.6.0_26]
      at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source) [:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422) [rt.jar:1.6.0_26]
      at org.springframework.webflow.core.collection.LocalAttributeMap.writeObject(LocalAttributeMap.java:327) [classes:1.0.0.0.0-SNAPSHOT]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_26]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at java.util.HashMap.writeObject(HashMap.java:1001) [rt.jar:1.6.0_26]
      at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source) [:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422) [rt.jar:1.6.0_26]
      at org.springframework.webflow.core.collection.LocalAttributeMap.writeObject(LocalAttributeMap.java:327) [classes:1.0.0.0.0-SNAPSHOT]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_26]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at org.springframework.webflow.engine.impl.FlowSessionImpl.writeExternal(FlowSessionImpl.java:154) [classes:1.0.0.0.0-SNAPSHOT]
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at java.util.LinkedList.writeObject(LinkedList.java:943) [rt.jar:1.6.0_26]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_26]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at org.springframework.webflow.engine.impl.FlowExecutionImpl.writeExternal(FlowExecutionImpl.java:312) [classes:1.0.0.0.0-SNAPSHOT]
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [rt.jar:1.6.0_26]
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [rt.jar:1.6.0_26]
      at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.serialize(SerializedFlowExecutionSnapshot.java:173) [classes:1.0.0.0.0-SNAPSHOT]
      at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.<init>(SerializedFlowExecutionSnapshot.java:70) [classes:1.0.0.0.0-SNAPSHOT]
      at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory.createSnapshot(SerializedFlowExecutionSnapshotFactory.java:70) [classes:1.0.0.0.0-SNAPSHOT]
      at org.springframework.webflow.execution.repository.snapshot.AbstractSnapshottingFlowExecutionRepository.snapshot(AbstractSnapshottingFlowExecutionRepository.java:75) [classes:1.0.0.0.0-SNAPSHOT]
      at org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository.putFlowExecution(DefaultFlowExecutionRepository.java:126) [classes:1.0.0.0.0-SNAPSHOT]
      at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:171) [classes:1.0.0.0.0-SNAPSHOT]
      at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183) [classes:1.0.0.0.0-SNAPSHOT]
      at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:48) [classes:1.0.0.0.0-SNAPSHOT]
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) [spring-webmvc-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) [spring-webmvc-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) [spring-webmvc-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) [spring-webmvc-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368) [spring-security-web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) [spring-security-web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) [spring-security-web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) [spring-security-web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) [spring-security-web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      ...

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            ollbap Pablo Morales Mombiela
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: