[
https://issues.jboss.org/browse/JBSEAM-4932?page=com.atlassian.jira.plugi...
]
Marek Schmidt edited comment on JBSEAM-4932 at 5/9/12 12:27 PM:
----------------------------------------------------------------
I can reproduce it on three different JDKs...
After adding a few additional logging statements, the problem seems to be that sometimes
there is a non-null instance of FacesContext available in
org.jboss.seam.faces.ResourceLoader, which isn't (yet?) initialized and throw NPE
trying to call getResourceAsStream on it, so the
org.jboss.seam.util.Resources::getResourceAsStream(String resource, String stripped) is
used to read the resource, which doesn't read from servlet context, instead of the
usual org.jboss.seam.core.ResourceLoader, which uses servlet context. I suspect this used
to work on previous AS versions, as the content of WEB-INF used to be available through
Classloader.
Not working log (note that the NPE is normally silently eaten in
org.jboss.seam.util.FacesResources)
{noformat}
18:02:20,924 DEBUG [org.jboss.seam.faces.ResourceLoader] (MSC service thread 1-4) reading
resource as stream from faces external context:
com.sun.faces.config.InitFacesContext$ServletContextAdapter@50876af1
18:02:20,925 DEBUG [org.jboss.seam.util.FacesResources] (MSC service thread 1-4) exception
calling context.getResourceAsStream:: java.lang.NullPointerException
at
com.sun.faces.config.InitFacesContext$ServletContextAdapter.getResourceAsStream(InitFacesContext.java:422)
[jsf-impl-2.1.7-redhat-1.jar:2.1.7-redhat-1]
at org.jboss.seam.util.FacesResources.getResourceAsStream(FacesResources.java:26)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.faces.ResourceLoader.getResourceAsStream(ResourceLoader.java:39)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.navigation.Pages.initialize(Pages.java:134)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.navigation.Pages.create(Pages.java:111)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.Component.callComponentMethod(Component.java:2275)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.Component.callCreateMethod(Component.java:2198)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.Component.newInstance(Component.java:2158)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:343)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:317)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at
org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.init.Initialization.init(Initialization.java:744)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392)
[jbossweb-7.0.15.Final-redhat-1.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850)
[jbossweb-7.0.15.Final-redhat-1.jar:]
at
org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
[jboss-as-web-7.1.1.Final-redhat-1.jar:7.1.1.Final-redhat-1]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[rt.jar:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[rt.jar:1.7.0]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]
18:02:20,927 DEBUG [org.jboss.seam.util.FacesResources] (MSC service thread 1-4) stream is
null, fallback to Resources.getResourceAsStream
18:02:20,927 DEBUG [org.jboss.seam.util.Resources] (MSC service thread 1-4) stream is
still null, resource not loaded
18:02:20,927 DEBUG [org.jboss.seam.navigation.Pages] (MSC service thread 1-4) no pages.xml
file found: /WEB-INF/pages.xml
{noformat}
Working log:
{noformat}
17:59:57,797 DEBUG [org.jboss.seam.contexts.Contexts] (MSC service thread 1-1) starting
up: org.jboss.seam.navigation.pages
17:59:57,799 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) instantiating Seam
component: org.jboss.seam.navigation.pages
17:59:57,799 TRACE [org.jboss.seam.core.Events] (MSC service thread 1-1) Processing
event:org.jboss.seam.preSetVariable.org.jboss.seam.navigation.pages
17:59:57,800 TRACE [org.jboss.seam.core.Events] (MSC service thread 1-1) Processing
event:org.jboss.seam.postSetVariable.org.jboss.seam.navigation.pages
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) initializing new
instance of: org.jboss.seam.navigation.pages
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) done initializing:
org.jboss.seam.navigation.pages
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) instantiating Seam
component: org.jboss.seam.core.resourceLoader
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) initializing new
instance of: org.jboss.seam.core.resourceLoader
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) done initializing:
org.jboss.seam.core.resourceLoader
17:59:57,800 DEBUG [org.jboss.seam.faces.ResourceLoader] (MSC service thread 1-1) faces
external context is null.
17:59:57,801 DEBUG [org.jboss.seam.core.ResourceLoader] (MSC service thread 1-1) reading
resource as stream from /jboss-seam-jpa
17:59:57,801 DEBUG [org.jboss.seam.util.Resources] (MSC service thread 1-1)
getResourceAsStream pre servlet context
17:59:57,801 DEBUG [org.jboss.seam.util.Resources] (MSC service thread 1-1) Loaded
resource from servlet context: /WEB-INF/pages.xml
17:59:57,801 DEBUG [org.jboss.seam.util.Resources] (MSC service thread 1-1)
getResourceAsStream post servlet context
17:59:57,801 DEBUG [org.jboss.seam.navigation.Pages] (MSC service thread 1-1) reading
pages.xml file: /WEB-INF/pages.xml
{noformat}
was (Author: maschmid):
I can reproduce it on three different JDKs...
After adding a few additional logging statements, the problem seems to be that sometimes
there is a non-null instance of FacesContext available in
org.jboss.seam.faces.ResourceLoader, which isn't (yet?) initialized, so the
org.jboss.seam.util.Resources::getResourceAsStream(String resource, String stripped) is
used to read the resource, which doesn't read from servlet context, instead of the
usual org.jboss.seam.core.ResourceLoader, which uses servlet context. I suspect this used
to work on previous AS versions, as the content of WEB-INF used to be available through
Classloader.
Not working log (note that the NPE is normally silently eaten in
org.jboss.seam.util.FacesResources)
{noformat}
18:02:20,924 DEBUG [org.jboss.seam.faces.ResourceLoader] (MSC service thread 1-4) reading
resource as stream from faces external context:
com.sun.faces.config.InitFacesContext$ServletContextAdapter@50876af1
18:02:20,925 DEBUG [org.jboss.seam.util.FacesResources] (MSC service thread 1-4) exception
calling context.getResourceAsStream:: java.lang.NullPointerException
at
com.sun.faces.config.InitFacesContext$ServletContextAdapter.getResourceAsStream(InitFacesContext.java:422)
[jsf-impl-2.1.7-redhat-1.jar:2.1.7-redhat-1]
at org.jboss.seam.util.FacesResources.getResourceAsStream(FacesResources.java:26)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.faces.ResourceLoader.getResourceAsStream(ResourceLoader.java:39)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.navigation.Pages.initialize(Pages.java:134)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.navigation.Pages.create(Pages.java:111)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.Component.callComponentMethod(Component.java:2275)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.Component.callCreateMethod(Component.java:2198)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.Component.newInstance(Component.java:2158)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:343)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:317)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at
org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.init.Initialization.init(Initialization.java:744)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
[jboss-seam.jar:2.3.0.Beta2-SNAPSHOT]
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392)
[jbossweb-7.0.15.Final-redhat-1.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850)
[jbossweb-7.0.15.Final-redhat-1.jar:]
at
org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
[jboss-as-web-7.1.1.Final-redhat-1.jar:7.1.1.Final-redhat-1]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[rt.jar:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[rt.jar:1.7.0]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]
18:02:20,927 DEBUG [org.jboss.seam.util.FacesResources] (MSC service thread 1-4) stream is
null, fallback to Resources.getResourceAsStream
18:02:20,927 DEBUG [org.jboss.seam.util.Resources] (MSC service thread 1-4) stream is
still null, resource not loaded
18:02:20,927 DEBUG [org.jboss.seam.navigation.Pages] (MSC service thread 1-4) no pages.xml
file found: /WEB-INF/pages.xml
{noformat}
Working log:
{noformat}
17:59:57,797 DEBUG [org.jboss.seam.contexts.Contexts] (MSC service thread 1-1) starting
up: org.jboss.seam.navigation.pages
17:59:57,799 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) instantiating Seam
component: org.jboss.seam.navigation.pages
17:59:57,799 TRACE [org.jboss.seam.core.Events] (MSC service thread 1-1) Processing
event:org.jboss.seam.preSetVariable.org.jboss.seam.navigation.pages
17:59:57,800 TRACE [org.jboss.seam.core.Events] (MSC service thread 1-1) Processing
event:org.jboss.seam.postSetVariable.org.jboss.seam.navigation.pages
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) initializing new
instance of: org.jboss.seam.navigation.pages
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) done initializing:
org.jboss.seam.navigation.pages
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) instantiating Seam
component: org.jboss.seam.core.resourceLoader
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) initializing new
instance of: org.jboss.seam.core.resourceLoader
17:59:57,800 TRACE [org.jboss.seam.Component] (MSC service thread 1-1) done initializing:
org.jboss.seam.core.resourceLoader
17:59:57,800 DEBUG [org.jboss.seam.faces.ResourceLoader] (MSC service thread 1-1) faces
external context is null.
17:59:57,801 DEBUG [org.jboss.seam.core.ResourceLoader] (MSC service thread 1-1) reading
resource as stream from /jboss-seam-jpa
17:59:57,801 DEBUG [org.jboss.seam.util.Resources] (MSC service thread 1-1)
getResourceAsStream pre servlet context
17:59:57,801 DEBUG [org.jboss.seam.util.Resources] (MSC service thread 1-1) Loaded
resource from servlet context: /WEB-INF/pages.xml
17:59:57,801 DEBUG [org.jboss.seam.util.Resources] (MSC service thread 1-1)
getResourceAsStream post servlet context
17:59:57,801 DEBUG [org.jboss.seam.navigation.Pages] (MSC service thread 1-1) reading
pages.xml file: /WEB-INF/pages.xml
{noformat}
pages.xml is sometimes not loaded
---------------------------------
Key: JBSEAM-4932
URL:
https://issues.jboss.org/browse/JBSEAM-4932
Project: Seam 2
Issue Type: Bug
Components: Core
Affects Versions: 2.3.0.BETA1
Environment: AS7.1.1.Final
Reporter: Marek Schmidt
Fix For: 2.3.0.BETA2
Attachments: server.log
Sometimes on deployment of examples on AS7.1.1.Final the pages.xml is not loaded and
navigation doesn't work in the example. Redeploying seems to fix the problem.
Attaching a DEBUG log where the following line is found during the last deployment of the
jpa example:
{noformat}
18:32:09,163 DEBUG [org.jboss.seam.navigation.Pages] (MSC service thread 1-2) no
pages.xml file found: /WEB-INF/pages.xml
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira