[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-497) NPE in Pages.createPage

Ryan Dewell (JIRA) jira-events at jboss.com
Mon Nov 13 17:32:41 EST 2006


NPE in Pages.createPage
-----------------------

                 Key: JBSEAM-497
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-497
             Project: JBoss Seam
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.0.BETA2
            Reporter: Ryan Dewell


This did not exist in 1.1.0 beta 1 or previous versions.  It appears to be related to the new per-view configuration file instead of monolithic pages.xml.  

We have our own custom, restful, view handler on top Seam/JSF.  

----
java.lang.NullPointerException
        at org.jboss.seam.core.Pages.createPage(Pages.java:212)
        at org.jboss.seam.core.Pages.getPage(Pages.java:201)
        at org.jboss.seam.core.Pages.getConvertedParameters(Pages.java:363)
----

Presumably this NPE can occur any time replaceExtension returns null.

So a simple fix might be:

----
InputStream stream = null;
String replaced = replaceExtension(viewId, ".page.xml");
if (replaced != null)
   stream = Resources.getResourceAsStream( replaced.substring(1) );

if (stream == null){

[...... etc .... ]
----

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

        



More information about the seam-issues mailing list