Skip to main content

[webtier] Re: Classpath issues Sun Java Application Server

11 replies [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ryan Lubke

On 4/6/09 3:18 PM, lincolnbaxter@gmail.com wrote:
> Crud, this is probably a tomcat list question. This hasn't happened
> until recently though, and the only thing that's really changed is
> jsf2 versions
Ok, I'm guessing 6.0.18 is what you're still using (based on your older
mails).

I checked the tomcat code and that line/NPE indicates that the current
Context is null.
One possibility for this value being null is something holding a
reference to
the ServletRequest longer than they should be.

My first inclination would be that when the NPE occurs, the current
FacesContext
is an old one that hasn't been properly released.

I haven't dug through your code, but your filter does eventually invoke
the FacesServlet or do you manage the lifecycle calls yourself?

> Sent from my Verizon Wireless BlackBerry
>
> ------------------------------------------------------------------------
> *From*: Ryan Lubke
> *Date*: Mon, 06 Apr 2009 15:16:11 -0700
> *To*:
> *Subject*: Re: [webtier] JSF/JSF2 Seemingly random
> NullPointerExceptions in request.get/setAttribute() using Filters
> On 4/6/09 3:04 PM, Lincoln Baxter, III wrote:
>> Hi Gurus,
>>
>> Got a question...
> Since it seems that this may be a container issue, what container are
> you using?
>>
>> I'm using PrettyFaces for JSF (trying to update it for JSF2,) and I
>> started getting some NullPointerExceptions that I don't feel like
>> were occurring before.
>>
>> Here are the steps that occur:
>>
>> 1. PrettyFaces intercepts all requests to the WebApp, it checks
>> against a configuration file to determine whether or not that request
>> should be forwarded to JSF.
>>
>> 2. PrettyFaces then constructs a FacesContext in order to do some
>> work with FacesMessages, :
>>
>> public FacesContext getFacesContext(final ServletRequest request,
>> final ServletResponse response)
>> {
>> FacesContext facesContext = FacesContext.getCurrentInstance();
>> if (facesContext != null)
>> {
>> return facesContext;
>> }
>>
>> FacesContextFactory contextFactory = (FacesContextFactory)
>> FactoryFinder
>> .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
>> LifecycleFactory lifecycleFactory = (LifecycleFactory)
>> FactoryFinder
>> .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
>> Lifecycle lifecycle =
>> lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
>>
>> ServletContext servletContext = ((HttpServletRequest)
>> request).getSession().getServletContext();
>> facesContext = contextFactory.getFacesContext(servletContext,
>> request, response, lifecycle);
>> InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
>>
>> return facesContext;
>> }
>>
>> 3. PrettyFaces constructs a PrettyContext and PrettyConfig object,
>> and stores them using request.setAttribute()
>>
>> 4. PrettyFaces forwards to JSF (or not, if not applicable)
>>
>> It seems like these attributes are sometimes lost during the forward
>> to the JSF servlet. This must have something to do with threading and
>> forwards, but I can't seem to narrow it down. Any help would be
>> greatly appreciated.
>>
>> Sometimes the Exceptions occur even before the forward to JSF.
>>
>> Caused by: java.lang.NullPointerException
>> at
>> org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
>> at
>> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
>> at
>> javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)
>> at
>> com.ocpsoft.pretty.PrettyContext.setCurrentInstance(PrettyContext.java:93)
>> at
>> com.ocpsoft.pretty.PrettyContext.getCurrentInstance(PrettyContext.java:84)
>> at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:58)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at
>> com.ocpsoft.socialpm.jsf.filter.DataSetupFilter.doFilter(DataSetupFilter.java:255)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
>> at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>
>>
>> Where and how should I start trying to debug these random NPEs?
>>
>>
>> Thanks,
>> Lincoln
>>
>>
>>
>

[att1.html]

lincolnbaxter@gmail.com

Yes I am. Should I close it out before forwarding?

Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: Ryan Lubke

Date: Mon, 06 Apr 2009 16:32:49
To:
Subject: Re: [webtier] JSF/JSF2 Seemingly random NullPointerExceptions
inrequest.get/setAttribute() using Filters

On 4/6/09 3:18 PM, lincolnbaxter@gmail.com wrote:
> Crud, this is probably a tomcat list question. This hasn't happened
> until recently though, and the only thing that's really changed is
> jsf2 versions
Ok, I'm guessing 6.0.18 is what you're still using (based on your older
mails).

I checked the tomcat code and that line/NPE indicates that the current
Context is null.
One possibility for this value being null is something holding a
reference to
the ServletRequest longer than they should be.

My first inclination would be that when the NPE occurs, the current
FacesContext
is an old one that hasn't been properly released.

I haven't dug through your code, but your filter does eventually invoke
the FacesServlet or do you manage the lifecycle calls yourself?

> Sent from my Verizon Wireless BlackBerry
>
> ------------------------------------------------------------------------
> *From*: Ryan Lubke
> *Date*: Mon, 06 Apr 2009 15:16:11 -0700
> *To*:
> *Subject*: Re: [webtier] JSF/JSF2 Seemingly random
> NullPointerExceptions in request.get/setAttribute() using Filters
> On 4/6/09 3:04 PM, Lincoln Baxter, III wrote:
>> Hi Gurus,
>>
>> Got a question...
> Since it seems that this may be a container issue, what container are
> you using?
>>
>> I'm using PrettyFaces for JSF (trying to update it for JSF2,) and I
>> started getting some NullPointerExceptions that I don't feel like
>> were occurring before.
>>
>> Here are the steps that occur:
>>
>> 1. PrettyFaces intercepts all requests to the WebApp, it checks
>> against a configuration file to determine whether or not that request
>> should be forwarded to JSF.
>>
>> 2. PrettyFaces then constructs a FacesContext in order to do some
>> work with FacesMessages, :
>>
>> public FacesContext getFacesContext(final ServletRequest request,
>> final ServletResponse response)
>> {
>> FacesContext facesContext = FacesContext.getCurrentInstance();
>> if (facesContext != null)
>> {
>> return facesContext;
>> }
>>
>> FacesContextFactory contextFactory = (FacesContextFactory)
>> FactoryFinder
>> .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
>> LifecycleFactory lifecycleFactory = (LifecycleFactory)
>> FactoryFinder
>> .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
>> Lifecycle lifecycle =
>> lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
>>
>> ServletContext servletContext = ((HttpServletRequest)
>> request).getSession().getServletContext();
>> facesContext = contextFactory.getFacesContext(servletContext,
>> request, response, lifecycle);
>> InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
>>
>> return facesContext;
>> }
>>
>> 3. PrettyFaces constructs a PrettyContext and PrettyConfig object,
>> and stores them using request.setAttribute()
>>
>> 4. PrettyFaces forwards to JSF (or not, if not applicable)
>>
>> It seems like these attributes are sometimes lost during the forward
>> to the JSF servlet. This must have something to do with threading and
>> forwards, but I can't seem to narrow it down. Any help would be
>> greatly appreciated.
>>
>> Sometimes the Exceptions occur even before the forward to JSF.
>>
>> Caused by: java.lang.NullPointerException
>> at
>> org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
>> at
>> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
>> at
>> javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)
>> at
>> com.ocpsoft.pretty.PrettyContext.setCurrentInstance(PrettyContext.java:93)
>> at
>> com.ocpsoft.pretty.PrettyContext.getCurrentInstance(PrettyContext.java:84)
>> at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:58)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at
>> com.ocpsoft.socialpm.jsf.filter.DataSetupFilter.doFilter(DataSetupFilter.java:255)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
>> at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>
>>
>> Where and how should I start trying to debug these random NPEs?
>>
>>
>> Thanks,
>> Lincoln
>>
>>
>>
>

[att1.html]

Ryan Lubke

On 4/6/09 4:55 PM, lincolnbaxter@gmail.com wrote:
> Yes I am. Should I close it out before forwarding?
As a first step, yes, I would recommend releasing the
FacesContext prior to forwarding.
>
> Sent from my Verizon Wireless BlackBerry
>
> ------------------------------------------------------------------------
> *From*: Ryan Lubke
> *Date*: Mon, 06 Apr 2009 16:32:49 -0700
> *To*:
> *Subject*: Re: [webtier] JSF/JSF2 Seemingly random
> NullPointerExceptions inrequest.get/setAttribute() using Filters
> On 4/6/09 3:18 PM, lincolnbaxter@gmail.com wrote:
>> Crud, this is probably a tomcat list question. This hasn't happened
>> until recently though, and the only thing that's really changed is
>> jsf2 versions
> Ok, I'm guessing 6.0.18 is what you're still using (based on your
> older mails).
>
> I checked the tomcat code and that line/NPE indicates that the current
> Context is null.
> One possibility for this value being null is something holding a
> reference to
> the ServletRequest longer than they should be.
>
> My first inclination would be that when the NPE occurs, the current
> FacesContext
> is an old one that hasn't been properly released.
>
> I haven't dug through your code, but your filter does eventually invoke
> the FacesServlet or do you manage the lifecycle calls yourself?
>
>
>> Sent from my Verizon Wireless BlackBerry
>>
>> ------------------------------------------------------------------------
>> *From*: Ryan Lubke
>> *Date*: Mon, 06 Apr 2009 15:16:11 -0700
>> *To*:
>> *Subject*: Re: [webtier] JSF/JSF2 Seemingly random
>> NullPointerExceptions in request.get/setAttribute() using Filters
>> On 4/6/09 3:04 PM, Lincoln Baxter, III wrote:
>>> Hi Gurus,
>>>
>>> Got a question...
>> Since it seems that this may be a container issue, what container are
>> you using?
>>>
>>> I'm using PrettyFaces for JSF (trying to update it for JSF2,) and I
>>> started getting some NullPointerExceptions that I don't feel like
>>> were occurring before.
>>>
>>> Here are the steps that occur:
>>>
>>> 1. PrettyFaces intercepts all requests to the WebApp, it checks
>>> against a configuration file to determine whether or not that
>>> request should be forwarded to JSF.
>>>
>>> 2. PrettyFaces then constructs a FacesContext in order to do some
>>> work with FacesMessages, :
>>>
>>> public FacesContext getFacesContext(final ServletRequest
>>> request, final ServletResponse response)
>>> {
>>> FacesContext facesContext = FacesContext.getCurrentInstance();
>>> if (facesContext != null)
>>> {
>>> return facesContext;
>>> }
>>>
>>> FacesContextFactory contextFactory = (FacesContextFactory)
>>> FactoryFinder
>>> .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
>>> LifecycleFactory lifecycleFactory = (LifecycleFactory)
>>> FactoryFinder
>>> .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
>>> Lifecycle lifecycle =
>>> lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
>>>
>>> ServletContext servletContext = ((HttpServletRequest)
>>> request).getSession().getServletContext();
>>> facesContext =
>>> contextFactory.getFacesContext(servletContext, request, response,
>>> lifecycle);
>>>
>>> InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
>>>
>>> return facesContext;
>>> }
>>>
>>> 3. PrettyFaces constructs a PrettyContext and PrettyConfig object,
>>> and stores them using request.setAttribute()
>>>
>>> 4. PrettyFaces forwards to JSF (or not, if not applicable)
>>>
>>> It seems like these attributes are sometimes lost during the forward
>>> to the JSF servlet. This must have something to do with threading
>>> and forwards, but I can't seem to narrow it down. Any help would be
>>> greatly appreciated.
>>>
>>> Sometimes the Exceptions occur even before the forward to JSF.
>>>
>>> Caused by: java.lang.NullPointerException
>>> at
>>> org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
>>> at
>>> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
>>> at
>>> javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)
>>> at
>>> com.ocpsoft.pretty.PrettyContext.setCurrentInstance(PrettyContext.java:93)
>>> at
>>> com.ocpsoft.pretty.PrettyContext.getCurrentInstance(PrettyContext.java:84)
>>> at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:58)
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>> at
>>> com.ocpsoft.socialpm.jsf.filter.DataSetupFilter.doFilter(DataSetupFilter.java:255)
>>> at
>>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>>> at
>>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>> at
>>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
>>> at
>>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>>> at
>>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>>> at
>>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>
>>>
>>> Where and how should I start trying to debug these random NPEs?
>>>
>>>
>>> Thanks,
>>> Lincoln
>>>
>>>
>>>
>>
>

[att1.html]

Lincoln Baxter, III

On Mon, 2009-04-06 at 17:01 -0700, Ryan Lubke wrote:

> As a first step, yes, I would recommend releasing the
> FacesContext prior to forwarding.

Ok, so I tried this, and it didn't quite work, but... I think I have it
narrowed down to a JSF issue... by performing all Faces work after other
direct accesses to the Request object, the nullpointers seem to be
avoided.

I did not try comparing request objects, or throwing the exception as
you suggested

Here is my FacesContext construction logic:

/*
* PrettyFaces is an OpenSource JSF library to create bookmarkable URLs.
*
* Copyright (C) 2008 - Lincoln Baxter, III
*
* This program is free software: you can redistribute it and/or modify
it under
* the terms of the GNU Lesser General Public License as published by
the Free Software
* Foundation, either version 3 of the License, or (at your option) any
later
* version.
*
* This program is distributed in the hope that it will be useful, but
WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
License along with
* this program. If not, see the file COPYING.LESSER or visit the GNU
website at
* .
*/
package com.ocpsoft.pretty.util;

import javax.faces.FactoryFinder;
import javax.faces.context.FacesContext;
import javax.faces.context.FacesContextFactory;
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

public class FacesContextBuilder
{
public FacesContext getFacesContext(final ServletRequest request,
final ServletResponse response)
{
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext != null)
{
return facesContext;
}

FacesContextFactory contextFactory = (FacesContextFactory)
FactoryFinder
.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
LifecycleFactory lifecycleFactory = (LifecycleFactory)
FactoryFinder
.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
Lifecycle lifecycle =
lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);

ServletContext servletContext = ((HttpServletRequest)
request).getSession().getServletContext();
facesContext = contextFactory.getFacesContext(servletContext,
request, response, lifecycle);

InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);

return facesContext;
}

private abstract static class InnerFacesContext extends FacesContext
{
protected static void setFacesContextAsCurrentInstance(final
FacesContext facesContext)
{
FacesContext.setCurrentInstance(facesContext);
}
}

}

[att1.html]

Ryan Lubke

On 4/8/09 6:48 PM, Lincoln Baxter, III wrote:
> On Mon, 2009-04-06 at 17:01 -0700, Ryan Lubke wrote:
>> As a first step, yes, I would recommend releasing the
>> FacesContext prior to forwarding.
>
> Ok, so I tried this, and it didn't quite work, but... I think I have
> it narrowed down to a JSF issue... by performing all Faces work after
> other direct accesses to the Request object, the nullpointers seem to
> be avoided.
>
> I did not try comparing request objects, or throwing the exception as
> you suggested
Any chance of getting a test case for this?
>
> Here is my FacesContext construction logic:
>
>
> /*
> * PrettyFaces is an OpenSource JSF library to create bookmarkable URLs.
> *
> * Copyright (C) 2008 - Lincoln Baxter, III
> >
> *
> * This program is free software: you can redistribute it and/or modify
> it under
> * the terms of the GNU Lesser General Public License as published by
> the Free Software
> * Foundation, either version 3 of the License, or (at your option) any
> later
> * version.
> *
> * This program is distributed in the hope that it will be useful, but
> WITHOUT
> * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
> or FITNESS
> * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
> for more
> * details.
> *
> * You should have received a copy of the GNU Lesser General Public
> License along with
> * this program. If not, see the file COPYING.LESSER or visit the GNU
> website at
> * .
> */
> package com.ocpsoft.pretty.util;
>
> import javax.faces.FactoryFinder;
> import javax.faces.context.FacesContext;
> import javax.faces.context.FacesContextFactory;
> import javax.faces.lifecycle.Lifecycle;
> import javax.faces.lifecycle.LifecycleFactory;
> import javax.servlet.ServletContext;
> import javax.servlet.ServletRequest;
> import javax.servlet.ServletResponse;
> import javax.servlet.http.HttpServletRequest;
>
> public class FacesContextBuilder
> {
> public FacesContext getFacesContext(final ServletRequest request,
> final ServletResponse response)
> {
> FacesContext facesContext = FacesContext.getCurrentInstance();
> if (facesContext != null)
> {
> return facesContext;
> }
>
> FacesContextFactory contextFactory = (FacesContextFactory)
> FactoryFinder
> .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
> LifecycleFactory lifecycleFactory = (LifecycleFactory)
> FactoryFinder
> .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
> Lifecycle lifecycle =
> lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
>
> ServletContext servletContext = ((HttpServletRequest)
> request).getSession().getServletContext();
> facesContext = contextFactory.getFacesContext(servletContext,
> request, response, lifecycle);
> InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
>
> return facesContext;
> }
>
> private abstract static class InnerFacesContext extends FacesContext
> {
> protected static void setFacesContextAsCurrentInstance(final
> FacesContext facesContext)
> {
> FacesContext.setCurrentInstance(facesContext);
> }
> }
>
> }
>

[att1.html]

Jan Luehe

On 04/ 2/09 12:14 PM, glassfish@javadesktop.org wrote:
> Hi I wrote a simple servlet which reads an xml. I placed the xml in SRC folder and loading it using Document doc = docBuilder.parse(new File("tasks.xml"));. But when I run the servlet I get FileNotFound Exception. Please help I might be missing some configuration, i am totally new to Sun App Server
>
>
> java.io.FileNotFoundException: C:\Sun\AppServer\domains\domain1\config\tasks.xml (The system cannot find the file specified)
>

Obviously, any relative file paths are interpreted as being relative to
the domain's config directory.
If you placed your tasks.xml in your webapp's root directory, you should
be able to parse it from
within your servlet like this:

Document doc =
docBuilder.parse(getServletContext().getResourceAsStream("tasks.xml")) ;

Jan

> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.(FileInputStream.java:106)
> at java.io.FileInputStream.(FileInputStream.java:66)
> at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
> at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
> at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:973)
> at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:184)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
> at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)
> at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
> at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:172)
> at gov.hud.util.reader.TaskReader.readXml(TaskReader.java:35)
> at gov.hud.resend.servlet.ResendServlet.doGet(ResendServlet.java:26)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:264)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:178)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
> at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
> at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
> at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
> at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
> [Message sent by forum member 'nutsboltsstruts' (nutsboltsstruts)]
>
> http://forums.java.net/jive/thread.jspa?messageID=340344
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Lincoln Baxter, III

Hi Gurus,

Got a question...

I'm using PrettyFaces for JSF (trying to update it for JSF2,) and I
started getting some NullPointerExceptions that I don't feel like were
occurring before.

Here are the steps that occur:

1. PrettyFaces intercepts all requests to the WebApp, it checks against
a configuration file to determine whether or not that request should be
forwarded to JSF.

2. PrettyFaces then constructs a FacesContext in order to do some work
with FacesMessages, :

public FacesContext getFacesContext(final ServletRequest request,
final ServletResponse response)
{
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext != null)
{
return facesContext;
}

FacesContextFactory contextFactory = (FacesContextFactory)
FactoryFinder
.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
LifecycleFactory lifecycleFactory = (LifecycleFactory)
FactoryFinder
.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
Lifecycle lifecycle =
lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);

ServletContext servletContext = ((HttpServletRequest)
request).getSession().getServletContext();
facesContext = contextFactory.getFacesContext(servletContext,
request, response, lifecycle);

InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);

return facesContext;
}

3. PrettyFaces constructs a PrettyContext and PrettyConfig object, and
stores them using request.setAttribute()

4. PrettyFaces forwards to JSF (or not, if not applicable)

It seems like these attributes are sometimes lost during the forward to
the JSF servlet. This must have something to do with threading and
forwards, but I can't seem to narrow it down. Any help would be greatly
appreciated.

Sometimes the Exceptions occur even before the forward to JSF.

Caused by: java.lang.NullPointerException
at
org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
at
org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
at
javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)
at
com.ocpsoft.pretty.PrettyContext.setCurrentInstance(PrettyContext.java:93)
at
com.ocpsoft.pretty.PrettyContext.getCurrentInstance(PrettyContext.java:84)
at
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:58)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.ocpsoft.socialpm.jsf.filter.DataSetupFilter.doFilter(DataSetupFilter.java:255)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

Where and how should I start trying to debug these random NPEs?

Thanks,
Lincoln

[att1.html]

Ryan Lubke

On 4/6/09 3:04 PM, Lincoln Baxter, III wrote:
> Hi Gurus,
>
> Got a question...
Since it seems that this may be a container issue, what container are
you using?
>
> I'm using PrettyFaces for JSF (trying to update it for JSF2,) and I
> started getting some NullPointerExceptions that I don't feel like were
> occurring before.
>
> Here are the steps that occur:
>
> 1. PrettyFaces intercepts all requests to the WebApp, it checks
> against a configuration file to determine whether or not that request
> should be forwarded to JSF.
>
> 2. PrettyFaces then constructs a FacesContext in order to do some work
> with FacesMessages, :
>
> public FacesContext getFacesContext(final ServletRequest request,
> final ServletResponse response)
> {
> FacesContext facesContext = FacesContext.getCurrentInstance();
> if (facesContext != null)
> {
> return facesContext;
> }
>
> FacesContextFactory contextFactory = (FacesContextFactory)
> FactoryFinder
> .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
> LifecycleFactory lifecycleFactory = (LifecycleFactory)
> FactoryFinder
> .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
> Lifecycle lifecycle =
> lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
>
> ServletContext servletContext = ((HttpServletRequest)
> request).getSession().getServletContext();
> facesContext = contextFactory.getFacesContext(servletContext,
> request, response, lifecycle);
> InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
>
> return facesContext;
> }
>
> 3. PrettyFaces constructs a PrettyContext and PrettyConfig object, and
> stores them using request.setAttribute()
>
> 4. PrettyFaces forwards to JSF (or not, if not applicable)
>
> It seems like these attributes are sometimes lost during the forward
> to the JSF servlet. This must have something to do with threading and
> forwards, but I can't seem to narrow it down. Any help would be
> greatly appreciated.
>
> Sometimes the Exceptions occur even before the forward to JSF.
>
> Caused by: java.lang.NullPointerException
> at
> org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
> at
> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
> at
> javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)
> at
> com.ocpsoft.pretty.PrettyContext.setCurrentInstance(PrettyContext.java:93)
> at
> com.ocpsoft.pretty.PrettyContext.getCurrentInstance(PrettyContext.java:84)
> at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:58)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> com.ocpsoft.socialpm.jsf.filter.DataSetupFilter.doFilter(DataSetupFilter.java:255)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
>
> Where and how should I start trying to debug these random NPEs?
>
>
> Thanks,
> Lincoln
>
>
>

[att1.html]

lincolnbaxter@gmail.com

Crud, this is probably a tomcat list question. This hasn't happened until recently though, and the only thing that's really changed is jsf2 versions

Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: Ryan Lubke

Date: Mon, 06 Apr 2009 15:16:11
To:
Subject: Re: [webtier] JSF/JSF2 Seemingly random NullPointerExceptions in
request.get/setAttribute() using Filters

On 4/6/09 3:04 PM, Lincoln Baxter, III wrote:
> Hi Gurus,
>
> Got a question...
Since it seems that this may be a container issue, what container are
you using?
>
> I'm using PrettyFaces for JSF (trying to update it for JSF2,) and I
> started getting some NullPointerExceptions that I don't feel like were
> occurring before.
>
> Here are the steps that occur:
>
> 1. PrettyFaces intercepts all requests to the WebApp, it checks
> against a configuration file to determine whether or not that request
> should be forwarded to JSF.
>
> 2. PrettyFaces then constructs a FacesContext in order to do some work
> with FacesMessages, :
>
> public FacesContext getFacesContext(final ServletRequest request,
> final ServletResponse response)
> {
> FacesContext facesContext = FacesContext.getCurrentInstance();
> if (facesContext != null)
> {
> return facesContext;
> }
>
> FacesContextFactory contextFactory = (FacesContextFactory)
> FactoryFinder
> .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
> LifecycleFactory lifecycleFactory = (LifecycleFactory)
> FactoryFinder
> .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
> Lifecycle lifecycle =
> lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
>
> ServletContext servletContext = ((HttpServletRequest)
> request).getSession().getServletContext();
> facesContext = contextFactory.getFacesContext(servletContext,
> request, response, lifecycle);
> InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
>
> return facesContext;
> }
>
> 3. PrettyFaces constructs a PrettyContext and PrettyConfig object, and
> stores them using request.setAttribute()
>
> 4. PrettyFaces forwards to JSF (or not, if not applicable)
>
> It seems like these attributes are sometimes lost during the forward
> to the JSF servlet. This must have something to do with threading and
> forwards, but I can't seem to narrow it down. Any help would be
> greatly appreciated.
>
> Sometimes the Exceptions occur even before the forward to JSF.
>
> Caused by: java.lang.NullPointerException
> at
> org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
> at
> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
> at
> javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)
> at
> com.ocpsoft.pretty.PrettyContext.setCurrentInstance(PrettyContext.java:93)
> at
> com.ocpsoft.pretty.PrettyContext.getCurrentInstance(PrettyContext.java:84)
> at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:58)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> com.ocpsoft.socialpm.jsf.filter.DataSetupFilter.doFilter(DataSetupFilter.java:255)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
>
> Where and how should I start trying to debug these random NPEs?
>
>
> Thanks,
> Lincoln
>
>
>

[att1.html]

Ryan Lubke

On 4/6/09 3:18 PM, lincolnbaxter@gmail.com wrote:
> Crud, this is probably a tomcat list question. This hasn't happened
> until recently though, and the only thing that's really changed is
> jsf2 versions
You can still share the version of Tomcat though, yes?
>
> Sent from my Verizon Wireless BlackBerry
>
> ------------------------------------------------------------------------
> *From*: Ryan Lubke
> *Date*: Mon, 06 Apr 2009 15:16:11 -0700
> *To*:
> *Subject*: Re: [webtier] JSF/JSF2 Seemingly random
> NullPointerExceptions in request.get/setAttribute() using Filters
> On 4/6/09 3:04 PM, Lincoln Baxter, III wrote:
>> Hi Gurus,
>>
>> Got a question...
> Since it seems that this may be a container issue, what container are
> you using?
>>
>> I'm using PrettyFaces for JSF (trying to update it for JSF2,) and I
>> started getting some NullPointerExceptions that I don't feel like
>> were occurring before.
>>
>> Here are the steps that occur:
>>
>> 1. PrettyFaces intercepts all requests to the WebApp, it checks
>> against a configuration file to determine whether or not that request
>> should be forwarded to JSF.
>>
>> 2. PrettyFaces then constructs a FacesContext in order to do some
>> work with FacesMessages, :
>>
>> public FacesContext getFacesContext(final ServletRequest request,
>> final ServletResponse response)
>> {
>> FacesContext facesContext = FacesContext.getCurrentInstance();
>> if (facesContext != null)
>> {
>> return facesContext;
>> }
>>
>> FacesContextFactory contextFactory = (FacesContextFactory)
>> FactoryFinder
>> .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
>> LifecycleFactory lifecycleFactory = (LifecycleFactory)
>> FactoryFinder
>> .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
>> Lifecycle lifecycle =
>> lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
>>
>> ServletContext servletContext = ((HttpServletRequest)
>> request).getSession().getServletContext();
>> facesContext = contextFactory.getFacesContext(servletContext,
>> request, response, lifecycle);
>> InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
>>
>> return facesContext;
>> }
>>
>> 3. PrettyFaces constructs a PrettyContext and PrettyConfig object,
>> and stores them using request.setAttribute()
>>
>> 4. PrettyFaces forwards to JSF (or not, if not applicable)
>>
>> It seems like these attributes are sometimes lost during the forward
>> to the JSF servlet. This must have something to do with threading and
>> forwards, but I can't seem to narrow it down. Any help would be
>> greatly appreciated.
>>
>> Sometimes the Exceptions occur even before the forward to JSF.
>>
>> Caused by: java.lang.NullPointerException
>> at
>> org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
>> at
>> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
>> at
>> javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)
>> at
>> com.ocpsoft.pretty.PrettyContext.setCurrentInstance(PrettyContext.java:93)
>> at
>> com.ocpsoft.pretty.PrettyContext.getCurrentInstance(PrettyContext.java:84)
>> at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:58)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at
>> com.ocpsoft.socialpm.jsf.filter.DataSetupFilter.doFilter(DataSetupFilter.java:255)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
>> at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>
>>
>> Where and how should I start trying to debug these random NPEs?
>>
>>
>> Thanks,
>> Lincoln
>>
>>
>>
>

[att1.html]

lincolnbaxter@gmail.com

6.0.18

Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: Ryan Lubke

Date: Mon, 06 Apr 2009 15:27:05
To:
Subject: Re: [webtier] JSF/JSF2 Seemingly random NullPointerExceptions
inrequest.get/setAttribute() using Filters

On 4/6/09 3:18 PM, lincolnbaxter@gmail.com wrote:
> Crud, this is probably a tomcat list question. This hasn't happened
> until recently though, and the only thing that's really changed is
> jsf2 versions
You can still share the version of Tomcat though, yes?
>
> Sent from my Verizon Wireless BlackBerry
>
> ------------------------------------------------------------------------
> *From*: Ryan Lubke
> *Date*: Mon, 06 Apr 2009 15:16:11 -0700
> *To*:
> *Subject*: Re: [webtier] JSF/JSF2 Seemingly random
> NullPointerExceptions in request.get/setAttribute() using Filters
> On 4/6/09 3:04 PM, Lincoln Baxter, III wrote:
>> Hi Gurus,
>>
>> Got a question...
> Since it seems that this may be a container issue, what container are
> you using?
>>
>> I'm using PrettyFaces for JSF (trying to update it for JSF2,) and I
>> started getting some NullPointerExceptions that I don't feel like
>> were occurring before.
>>
>> Here are the steps that occur:
>>
>> 1. PrettyFaces intercepts all requests to the WebApp, it checks
>> against a configuration file to determine whether or not that request
>> should be forwarded to JSF.
>>
>> 2. PrettyFaces then constructs a FacesContext in order to do some
>> work with FacesMessages, :
>>
>> public FacesContext getFacesContext(final ServletRequest request,
>> final ServletResponse response)
>> {
>> FacesContext facesContext = FacesContext.getCurrentInstance();
>> if (facesContext != null)
>> {
>> return facesContext;
>> }
>>
>> FacesContextFactory contextFactory = (FacesContextFactory)
>> FactoryFinder
>> .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
>> LifecycleFactory lifecycleFactory = (LifecycleFactory)
>> FactoryFinder
>> .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
>> Lifecycle lifecycle =
>> lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
>>
>> ServletContext servletContext = ((HttpServletRequest)
>> request).getSession().getServletContext();
>> facesContext = contextFactory.getFacesContext(servletContext,
>> request, response, lifecycle);
>> InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
>>
>> return facesContext;
>> }
>>
>> 3. PrettyFaces constructs a PrettyContext and PrettyConfig object,
>> and stores them using request.setAttribute()
>>
>> 4. PrettyFaces forwards to JSF (or not, if not applicable)
>>
>> It seems like these attributes are sometimes lost during the forward
>> to the JSF servlet. This must have something to do with threading and
>> forwards, but I can't seem to narrow it down. Any help would be
>> greatly appreciated.
>>
>> Sometimes the Exceptions occur even before the forward to JSF.
>>
>> Caused by: java.lang.NullPointerException
>> at
>> org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
>> at
>> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
>> at
>> javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)
>> at
>> com.ocpsoft.pretty.PrettyContext.setCurrentInstance(PrettyContext.java:93)
>> at
>> com.ocpsoft.pretty.PrettyContext.getCurrentInstance(PrettyContext.java:84)
>> at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:58)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at
>> com.ocpsoft.socialpm.jsf.filter.DataSetupFilter.doFilter(DataSetupFilter.java:255)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
>> at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
>> at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>
>>
>> Where and how should I start trying to debug these random NPEs?
>>
>>
>> Thanks,
>> Lincoln
>>
>>
>>
>

[att1.html]