[jboss-jira] [JBoss JIRA] Commented: (JBVFS-109) Trying to access all classpath resources from a web application fails due to VFS errors

Marius Bogoevici (JIRA) jira-events at lists.jboss.org
Wed Jun 24 09:41:56 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBVFS-109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12473608#action_12473608 ] 

Marius Bogoevici commented on JBVFS-109:
----------------------------------------

Naresh, 

for a solution to the classpath scanning problem, please refer to http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4239767#4239767

This issue is strictly addressing the incorrect internal VFS behaviour and has nothing to do with Spring per se.

Marius

> Trying to access all classpath resources from a web application fails due to VFS errors
> ---------------------------------------------------------------------------------------
>
>                 Key: JBVFS-109
>                 URL: https://jira.jboss.org/jira/browse/JBVFS-109
>             Project: JBoss VFS
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 2.1.1.GA
>            Reporter: Marius Bogoevici
>            Assignee: Ales Justin
>             Fix For: 2.1.2.GA
>
>         Attachments: spring-jboss-jaxws.tar.gz
>
>
> The error has been triggered by using classpath scanning in Spring, but can be reproduced independently.
> The code in the servlet listed below does virtually the same thing as the VFSResourcePatternResolver:
> public class BasicServlet extends HttpServlet{
>     @Override
>     protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
>         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
>         Enumeration<URL> urls = classLoader.getResources("");
>         StringBuffer buffer = new StringBuffer();
>         while (urls.hasMoreElements()) {
>             URL url = urls.nextElement();
>             VirtualFile file = VFS.getRoot(url);
>             buffer.append(file.getPathName() + "\n");
>         }
>         new PrintWriter(resp.getOutputStream()).println(buffer.toString());
>     }
> }
> Trying to access the servlet results in an error when one URL is converted to a VirtualFile by VFS.getRoot(), and here is the resulting exception. The URL that triggers the error differs if the test is repeated.
> 00:45:44,380 ERROR [[resource-servlet]] Servlet.service() for servlet resource-servlet threw exception
> java.io.IOException: Child not found opt/jboss/jboss-5.0.1.GA/server/default/deployers/jbossws.deployer/policy.jar/ for MemoryContextHandler at 555514482[path= context=vfsmemory://3j011-j4xs2m-fuc3y7a8-1-fuc3yl41-9 real=vfsmemory://3j011-j4xs2m-fuc3y7a8-1-fuc3yl41-9], available children: []
> 	at org.jboss.virtual.plugins.registry.DefaultVFSRegistry.findHandler(DefaultVFSRegistry.java:109)
> 	at org.jboss.virtual.plugins.registry.DefaultVFSRegistry.getFile(DefaultVFSRegistry.java:88)
> 	at org.jboss.virtual.plugins.registry.DefaultVFSRegistry.getFile(DefaultVFSRegistry.java:121)
> 	at org.jboss.virtual.VFS.getRoot(VFS.java:276)
> 	at BasicServlet.doGet(BasicServlet.java:22)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
> 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
> 	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
> 	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
> 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> 	at java.lang.Thread.run(Thread.java:619)

-- 
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 jboss-jira mailing list