Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » dispatcher inside snap not finding path.(MVC inside snap not finding path.)
dispatcher inside snap not finding path. [message #699397] Thu, 21 July 2011 13:47 Go to next message
David  is currently offline David Friend
Messages: 6
Registered: July 2011
Junior Member
My dispatcherservlet inside my snap is getting called but it is not finding the path no matter what and I was wondering if there was an issue loading my bean. Here is the only Error message in the log.

Quote:
ERROR start-signalling-6 System.err
INFO: Intializing Spring FrameworkServlet 'standard'


Then when I go to my page I get

Quote:
Matched path '/web/index.htm' with mapping 'standard'
Did not translate path '/web/index.htm'
No mapping found for HTTP request with URI [/web/index.htm] in DispatcherServlet with name 'standard'


But I do have a RequestMapping("/web/index") and I tried it with a RequestMapping of "/index"
Re: dispatcher inside snap not finding path. [message #699415 is a reply to message #699397] Thu, 21 July 2011 14:07 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

The Error you see in the log can be ignored, it's just a INFO level message getting output to system.err by tomcat for some reason, we are looking in to it. You RequestMapping should be fine assuming it comes straight after the mapping for your DispatcherServlet and that comes straight after the Snap path. So in your browser, you should be entering a path like this http://myServer.com:port/hostPath/snapsFilter/snapPath/DispatcherServlet/requestMapping. The snapPath is the one defined in your manifest header.

If this is all correct then check the Snaps filter in the host, it needs to cover all the dispatchers, otherwise the snap won't be able to find your requested view, a jsp for example.

	<filter-mapping>
		<filter-name>host-filter</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>


Let me know it goes,
Thanks, Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: dispatcher inside snap not finding path. [message #699432 is a reply to message #699415] Thu, 21 July 2011 14:33 Go to previous messageGo to next message
David  is currently offline David Friend
Messages: 6
Registered: July 2011
Junior Member
Thanks Chris,

My host path is the root "/"
My snap path is "web"
My snaps filter is /*
My dispatch filter is *.htm
My request mapping is "/web/index.htm"
My filter mapping is just like yours and the snaps with static resources are working fine

What I am entering is localhost:8080/web/index.htm

Re: dispatcher inside snap not finding path. [message #699444 is a reply to message #699432] Thu, 21 July 2011 14:44 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

So, your dispatcher servlet will only get the index.htm part as the Snap path works just like the contextPath for a normal web app. I would say give a RequestMapping of index.htm a go as you have already tried just "/index". If that doesn't work you need to start working backwards, fortunately you don't have far to go if static resources in the snap are working. Try a request mapping of /* and get it to do some logging so you can confirm that the controller is getting called. If it is then the problem may be with finding the view. If not, then I'm running out of ideas Smile

Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: dispatcher inside snap not finding path. [message #699512 is a reply to message #699444] Thu, 21 July 2011 17:06 Go to previous messageGo to next message
David  is currently offline David Friend
Messages: 6
Registered: July 2011
Junior Member
Thank you for a way forward. I put a log statement in the zero parameter constructor of the controller and it never appeared in the logs so I am thinking that my bean was never creating the object even though in the logs it says FrameworkServlet 'standard' : initialization completed in 1714 ms. I will try to look at my contexts and bean and see what I am doing wrong. Thanks
Re: dispatcher inside snap not finding path. [message #699600 is a reply to message #699512] Thu, 21 July 2011 21:42 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

So we are in Spring MVC now, the message "FrameworkServlet 'standard' : initialization completed in 1714 ms" Simply means it found the context definition for the DispatcherServlet and initialized it with no problems.

The question is why it hasn't found your controllers. If your using annotation based configuration, have you got the correct annotations (@Controller) in place and scanned for the right package to find them as defined in the DispatcherServlet context?

Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: dispatcher inside snap not finding path. [message #701887 is a reply to message #699600] Mon, 25 July 2011 17:57 Go to previous messageGo to next message
David  is currently offline David Friend
Messages: 6
Registered: July 2011
Junior Member
The issue turned out to be that I had to set the Bundle-Classpath to . but from the forum that I got that from it said it was a bad idea and that I should be compiling to the classes directory. Is there a way in eclipse to set it compile to that directory.
Re: dispatcher inside snap not finding path. [message #702337 is a reply to message #701887] Tue, 26 July 2011 08:28 Go to previous message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Your bundle class-path should be set to something like '., ./classes' for web bundles. In the project settings, go to the build information and configure the source directories. At the bottom of that page you can configure the output directory. By default it's 'bin' but we tend to use something like 'target/classes'. I'm not sure how this will affect the build from Eclipse though, we use an external build process to produce our bundles. I suspect it will work as long as your project is both an OSGi bundle project and a WTP 'Dynamic Web Project' then it should all be fine.

------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Previous Topic:OSGi vs Maven version numbers
Next Topic:Virgo 3.0.0.RC1 available, including snaps
Goto Forum:
  


Current Time: Fri Mar 29 00:21:08 GMT 2024

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

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

Back to the top