[ 
http://issues.apache.org/struts/browse/SHALE-360?page=comments#action_39108 ] 
            
Ken Paulsen commented on SHALE-360:
-----------------------------------

Hi Craig,

I went back and setup the environent that I had which caused this problem and 
reproduced it.  I investigated more to find out what combination of jars / etc. 
where causing the problem.  I found that when I had jsftemplating.jar file w/ a 
"Faces Servlet" mapping of "/resources" (a special mapping for JSFTemplating's 
resource resolution, which is configurable) before any other faces mappings, 
the problem exists.

It appears that Shale Remoting looks for the first Faces Mapping and uses this 
to generate the URL to the resource.  In this particular case, that URL is 
handled in JSFTemplating LayoutViewHandler.createView(...).  However, 
JSFTemplating upon not finding the resource (because "static" is there), logs a 
message (see above... I missed that this was coming from my code, had I seen 
this that night I would have had a clue), then continues.  The context is 
already marked "response complete".

It then appears that Shale's "after phase" listener is invoked which leads to 
the exception.  This doesn't answer why "mappings" is null, though.

Here's some information to help you find out why "mappings" might be null.  
When JSFTemplating receives a "resource" request, it does very little in 
"createView()".  It does still return a UIViewRoot b/c the JSF RI blows up if 
it returns null.  But that UIViewRoot only sets its renderKitId... and it sets 
it to "dummy" b/c it isn't used (except to avoid the NPE in the RI).  In the 
normal flow of things, the "createView" would do the following:

* create UIViewRoot
* Set the viewId on the view root
* Set the locale on the view root
* Set the render kit id on the view root

My impl does a couple more things, but nothing that you might depend on.  Of 
these things, are any of them used to calculate "mappings"?

Do you need to wait until after the restoreView phase for shale remoting to 
execute?

Can you check to see if the response is complete?  If it is, you should not do 
any further processing.  This would have avoided the exception in this case, 
although it still wouldn't have worked as expected... but my code did have a 
useful error message that I ignored, so it could have been debugged.

And finally, is there a way in shale to explicitly specify the mapping to use, 
similar to what JSFTemplating does?  This would avoid the name-space collision 
that occurred here.

Ken

> NPE in shale on GlassFish
> -------------------------
>
>                 Key: SHALE-360
>                 URL: http://issues.apache.org/struts/browse/SHALE-360
>             Project: Shale
>          Issue Type: Bug
>          Components: Remoting
>    Affects Versions: 1.0.3
>         Environment: GlassFish v2 build 28
>            Reporter: Ken Paulsen
>             Fix For: TBD
>
>
> The following are the stack traces I received.  It seemed to be intermittent. 
>  I think another bug occurred in Dynamic Faces related to GlassFish restoring 
> session state across server restarts.  After deserialization, transient 
> variables were not restored... I don't know if something similar is 
> happenning here, but could be.
> [#|2006-12-10T23:13:23.158-0800|INFO|sun-appserver-ee9.1|com.sun.jsftemplating|_ThreadID=12;_ThreadName=httpWorkerThread-8080-0;|WEBUI0004:
>  The requested resource 
> (/static/META-INF/libs/scriptaculous/version1.6.4/prototype.js) is not 
> available.|#]
> [#|2006-12-10T23:13:23.159-0800|WARNING|sun-appserver-ee9.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=12;_ThreadName=httpWorkerThread-8080-0;_RequestID=1de3fe2b-e48e-435e-9976-ce30efc56ed4;|phase(RESTORE_VIEW
>  1,[EMAIL PROTECTED]) threw exception: java.lang.NullPointerException null
> org.apache.shale.remoting.impl.MappingImpl.viewId(MappingImpl.java:300)
> org.apache.shale.remoting.impl.MappingImpl.mapViewId(MappingImpl.java:227)
> org.apache.shale.remoting.faces.RemotingPhaseListener.afterPhase(RemotingPhaseListener.java:94)
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:278)
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
> org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:186)
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1032)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1032)
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:250)
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:618)
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:549)
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:790)
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326)
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:248)
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:199)
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)
> |#]
> I had accidentally missed the Dynamic Faces init parameter... I thought it 
> was related to that (note standard lifecycle above).  But after installing 
> the init-param, clearing the generated directory in GF, and restarting the 
> whole server... I still had an exception from shale:
> [#|2006-12-10T23:18:56.641-0800|INFO|sun-appserver-ee9.1|com.sun.jsftemplating|_ThreadID=12;_ThreadName=httpWorkerThread-8080-0;|WEBUI0004:
>  The requested resource 
> (/static/META-INF/libs/scriptaculous/version1.6.4/prototype.js) is not 
> available.|#]
> [#|2006-12-10T23:18:56.642-0800|WARNING|sun-appserver-ee9.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=12;_ThreadName=httpWorkerThread-8080-0;_RequestID=4921981e-6383-4aa8-9655-f474eec508e3;|phase(RESTORE_VIEW
>  1,[EMAIL PROTECTED]) threw exception: java.lang.NullPointerException null
> org.apache.shale.remoting.impl.MappingImpl.viewId(MappingImpl.java:300) 
> org.apache.shale.remoting.impl.MappingImpl.mapViewId(MappingImpl.java:227) 
> org.apache.shale.remoting.faces.RemotingPhaseListener.afterPhase(RemotingPhaseListener.java:94)
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:278) 
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117) 
> com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:79)
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
> org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
>  
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
>  
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
>  org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:186)
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1032)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1032)
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:250)
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:618)
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:549)
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:790)
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326)
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:248)
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:199)
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)
> I had it working at one point, I don't know if I did something to break it or 
> if it's intermittent.  It might not be shale's fault, it may be Dynamic Faces 
> or the app server which has an error message on startup w/ the init-parm for 
> Dynamic Faces in place:
> [#|2006-12-10T23:24:08.654-0800|WARNING|sun-appserver-ee9.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=10;_ThreadName=main;_RequestID=82a8ab26-627d-4681-8565-5c574f07d7db;|LifecycleId
>  com.sun.faces.lifecycle.PARTIAL does not exist|#]
> [#|2006-12-10T23:24:08.656-0800|SEVERE|sun-appserver-ee9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;_RequestID=82a8ab26-627d-4681-8565-5c574f07d7db;|WebModule[]StandardWrapper.Throwable
> java.lang.IllegalArgumentException: Cant create Lifecycle for id: 
> com.sun.faces.lifecycle.PARTIAL.
>        at 
> com.sun.faces.lifecycle.LifecycleFactoryImpl.getLifecycle(LifecycleFactoryImpl.java:226)
>        at javax.faces.webapp.FacesServlet.init(FacesServlet.java:170)
>        at 
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1165)
>        at 
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:994)
>        at 
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4689)
>        at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:5081)
>        at com.sun.enterprise.web.WebModule.start(WebModule.java:299)
>        at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1189)
>        at org.apache.catalina.core.StandardHost.start(StandardHost.java:924)
>        at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1189)
>        at 
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:520)
>        at org.apache.catalina.startup.Embedded.start(Embedded.java:916)
>        at com.sun.enterprise.web.WebContainer.start(WebContainer.java:839)
>        at 
> com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:750) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to