Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Snaps-based app doesn't allow welcome files?
Snaps-based app doesn't allow welcome files? [message #817193] Fri, 09 March 2012 19:24 Go to next message
Jason Levine is currently offline Jason LevineFriend
Messages: 12
Registered: July 2009
Junior Member
I'm building a Snaps-based web app as a first project, and have noticed that Snaps doesn't allow me to use a list of welcome files (in the web.xml <welcome-file-list> element) -- from the logs, it appears that a null path request gets shunted through the StaticResourceServlet instead. Is there some configuration I'm missing?

For reference, my snap is configured to respond at /lm/spring/. The request that fails is a request for that same URL. Here's my web.xml, with the root element removed because this forum won't let me post it due to the fact that it includes URLs:

	<display-name>LM Portal Spring Module</display-name>

	<!-- configure our parent application context -->

	<!-- set up the standard Spring context listener -->

	<!-- create our standard Spring dispatcher servlet -->

		<!-- this doesn't appear to work with Virgo Snaps... -->

And my servlet's context (springModule-servlet.xml); same thing, the root element has been removed due to this forum's crankiness:

	<context:component-scan base-package="gov.cancer.ccr.oit.lmportal.spring.web" />

	<!-- configure our view resolver -->
	<bean id="topViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="/WEB-INF/jsp/" />
		<property name="suffix" value=".jsp" />

And finally, here's the log.log entries for the request for /lm/spring/:

[2012-03-09 13:50:26.007] INFO  http-bio-8080-exec-4         org.eclipse.virgo.snaps.core.OsgiSnapRegistry                     Snap 'org.eclipse.virgo.snaps.core.internal.webapp.WebAppSnap@4eb15265' found for context path '/spring' 
[2012-03-09 13:50:26.007] INFO  http-bio-8080-exec-4         o.e.v.s.c.i.w.c.StandardVirtualContainerRequestDispatcher         Servicing request 'null' 
[2012-03-09 13:50:26.007] INFO  http-bio-8080-exec-4         org.eclipse.virgo.snaps.core.internal.webapp.url.PathUrlPattern   Path '/spring/' does not match pattern '/spring/w' 
[2012-03-09 13:50:26.007] INFO  http-bio-8080-exec-4         o.e.virgo.snaps.core.internal.webapp.url.ExtensionUrlPattern      Path '/spring/' does not match pattern 'jsp' 
[2012-03-09 13:50:26.007] INFO  http-bio-8080-exec-4         o.eclipse.virgo.snaps.core.internal.webapp.url.DefaultUrlPattern  Path '/spring/' matches pattern '/' 
[2012-03-09 13:50:26.007] INFO  http-bio-8080-exec-4         o.eclipse.virgo.snaps.core.internal.webapp.url.UrlPatternMatcher  Matched path '/spring/' with mapping '__resource-servlet' 
[2012-03-09 13:50:26.008] INFO  http-bio-8080-exec-4         o.eclipse.virgo.snaps.core.internal.webapp.url.DefaultUrlPattern  Translated path '/spring' to '/' 
[2012-03-09 13:50:26.008] INFO  http-bio-8080-exec-4         o.eclipse.virgo.snaps.core.internal.webapp.StaticResourceServlet  Resource / found 
[2012-03-09 13:50:26.012] ERROR http-bio-8080-exec-4         o.a.c.core.ContainerBase.[Catalina].[localhost].[/lm].[default]   Servlet.service() for servlet [default] in context with path [/lm] threw exception /Users/levineja/Downloads/virgo-tomcat-server-3.0.2.RELEASE/work/org.eclipse.virgo.kernel.deployer_3.0.2.RELEASE/staging/global/bundle/gov.cancer.ccr.oit.lmportal-spring/1.0.0/lmportal-spring-1.0.0.jar/ (No such file or directory)
	at Method)
	at org.eclipse.osgi.framework.util.SecureAction.getFileInputStream(
	at org.eclipse.osgi.baseadaptor.bundlefile.FileBundleEntry.getInputStream(
	at org.eclipse.osgi.framework.internal.core.BundleURLConnection.connect(
	at org.eclipse.osgi.framework.internal.core.BundleURLConnection.getInputStream(
	at org.eclipse.virgo.snaps.core.internal.webapp.StaticResourceServlet.doGet(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.eclipse.virgo.snaps.core.internal.webapp.container.ImmutableFilterChain.doFilter(
	at org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher$1.doWithClassLoader(
	at org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher$1.doWithClassLoader(
	at org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher.doWithThreadContextClassLoader(
	at org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher.service(
	at org.eclipse.virgo.snaps.core.internal.webapp.WebAppSnap.handleRequest(
	at org.eclipse.virgo.snaps.core.RequestRouter.service(
	at org.eclipse.virgo.snaps.core.SnapHostFilter.doFilter(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.valves.AccessLogValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.Http11Processor.process(
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$

Requests for /lm/spring/index.jsp return the index.jsp that's at that location, so that's fine -- it's just the null-path -- /lm/spring/ -- that's failing.
Re: Snaps-based app doesn't allow welcome files? [message #820045 is a reply to message #817193] Tue, 13 March 2012 16:57 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member


Could you show the web.xml for the host as well please. What is the full context path you are requesting as for just "/lm/spring"? Interesting, what makes you think that "null path request gets shunted through the StaticResourceServlet"

Where is "__resource-servlet" defined, I can't see it in the web.xml so I don't know how it's mapped the request to it? I think I'm missing something, want to get this straight before I try and recreate it myself.

Also, how were these bundles deployed, Pickup, Admin Console or through the tooling?


Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.

[Updated on: Tue, 13 March 2012 17:00]

Report message to a moderator

Re: Snaps-based app doesn't allow welcome files? [message #820070 is a reply to message #820045] Tue, 13 March 2012 17:29 Go to previous message
Jason Levine is currently offline Jason LevineFriend
Messages: 12
Registered: July 2009
Junior Member
The web.xml for the host (again minus the root element, because the forum sees the URLs in it and won't let me post links):

<?xml version="1.0" encoding="UTF-8"?>
	<display-name>Virgo Web Portal</display-name>



The host is configured at Web-ContextPath '/lm'.

I'm not sure what you mean by "What is the full context path you are requesting as for just '/lm/spring'?". Guessing, the context should be to my Snap bundle -- called lmportal-spring, and residing in the lmportal-spring.jar file that you see in that log. That bundle's MANIFEST.MF has "Snap-ContextPath: /spring", mapping it to the full context '/lm/spring'.

__resource-servlet comes from Snap's own default web.xml -- in org.eclipse.virgo.snaps.core, in the src/main/resources/META-INF/snaps/default-web.xml file. It maps to Virgo's own StaticResourceServlet (org.eclipse.virgo.snaps.core.internal.webapp.StaticResourceServlet).

These bundles are all deployed via uploading them in the Admin Console.

I believe that Tomcat natively is supposed to handle welcome-file negotiation, so something's happening in Snaps to override this. (It's all spelled out in the Servlet spec, section 9.10 in Servlet 2.4.) Just looking at the log file I posted originally, I suspect that the problem here is that the default configuration for the Snaps host (as spelled out in that default-web.xml, etc.) is claiming control over the root ('/') of all deployed Snaps, rather than allowing Tomcat to try to do its welcome-file dance first.
Previous Topic:**RFC: Supporting PDE/Equinox bundles in Eclipse IDE
Next Topic:Adding a custom command via gogo in Virgo 3
Goto Forum:

Current Time: Wed May 23 22:57:11 GMT 2018

Powered by FUDForum. Page generated in 0.01446 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top