[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3849) ClassLoader cannot find xhtml files when scanning page.xml files in an EAR with Multiple WARs

Reind D (JIRA) jira-events at lists.jboss.org
Thu Apr 30 19:47:57 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBSEAM-3849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12465311#action_12465311 ] 

Reind D commented on JBSEAM-3849:
---------------------------------

A possible cause of this bug:

The page.xml files are looked up in:

FileDescriptor:30
this.url = Resources.getResource(name, ServletLifecycle.getServletContext())

ServletLifecycle.ServletContext returns a static ServletContext object that is initialized in ServletLifecycle.beginApplication(ServletContext context)

The last call to ServletLifecycle.beginApplication() will overwrite the ServletContext object returned in ServletLifecycle.getServletContext() and used by FileDescriptor. Therefore, the 1st WAR will try to load resources using the 2nd WAR's ServletContext. Obviously, it won't be able to find the file since it's looking in the wrong WAR's context.



> ClassLoader cannot find xhtml files when scanning page.xml files in an EAR with Multiple WARs
> ---------------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-3849
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3849
>             Project: Seam
>          Issue Type: Bug
>    Affects Versions: 2.1.1.CR2
>         Environment: JBoss AS 5.0.0.GA, JDK6, Seam 2.1.1.CR2
>            Reporter: Reind D
>             Fix For: 2.2.0.CR1
>
>         Attachments: seam3849.ear
>
>
> I have an EAR that contains multiple WAR files. The ear deploys correctly, but on the first web request, during a scan of all *.page.xml files, I get the following output to the log for each page.xml file:
> WARN  [VFSScanner] Error handling item 'login/index.page.xml': java.lang.NullPointerException: Cannot find URL from classLoader for login/index.page.xml, loading from org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader at 1ed964f
> The NPE occurs in this code:
> org.jboss.seam.deployment.FileDescriptor.java
> this.url = classLoader.getResource(name);
> if (this.url == null)
> {
>    throw new NullPointerException("Cannot find URL from classLoader for " + name + ", loading from " + classLoader);
> }
> As a result, none of the page.xml files work. 
> Note that the second WAR works as expected, with all the page.xml files loaded correctly.
> The same project worked in Seam 2.0.2.SP1 and JBoss AS 4.2.3.GA

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

        



More information about the seam-issues mailing list