PDA

View Full Version : Resource not found 404 error



snelson
02-12-2007, 01:27 PM
Hello,

I'm having trouble getting my aspx pages to be found using Spring. I cam certain its a misconfiguration issue by myself but after many hours of looking I'm not having a lot of luck tracking it down. I'm hoping a fresh pair of (more competent) eyes can help me out.

I have this in my web.config:



<system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
</httpHandlers>
</system.web>


When deploying the app I cannot view any aspx pages. I've verified they are there under the path I am requesting. I found that taking out the httpHandler above and they work (obviously without the DI).

My web.config references a pages.xml containing page definitions. This is like:



<resource uri="~/Config/pages.xml"/>


This file is stored in the web application under the config directory.

Each page which requires DI is listed as:



<object type="Login.aspx">
<property name="Authenticator" ref="authenticationService"/>
</object>


As an aside do I need to specifiy every page whether it uses DI or not? I am thinking so as I presume the httpHandler is using this xml file to perform a lookup.

Every page is request is getting a 404 error. In addition I cannot seem to get log4net running to give me a clue where things are going wrong!

If you can help me that'd be great. Once I get up to speed with Spring.net I'll try to re-pay by helping some others out.

Many thanks

Stephen

Erich Eichinger
02-12-2007, 08:53 PM
Hi,

Since I can't see any obvious problem with the lines you've posted: can you please post your <context> configuration or - much better - your whole web.config?



As an aside do I need to specifiy every page whether it uses DI or not? I am thinking so as I presume the httpHandler is using this xml file to perform a lookup.

No. You don't have to configure every page in your <objects> section. Only those pages, that need to get some dependencies injected must be configured. All other page requests are simply delegated to the original builtin PageHandlerFactory.

cheers,
Erich

snelson
02-12-2007, 09:48 PM
Hi Erich,

Thanks once again for your help. I've managed to sort the problem out myself by using the Spring sourcecode and stepping through (once again open source rules over closed). It turned out I had a typo in my page definition xml file. :rolleyes: I had updateCustomers.aspx when the file was called updateCustomer.aspx. The exception I was getting back was pretty cryptic though so I might see if I can submit a patch to provide more info in the exception. Is that possible for me to do?

Also many thanks for the clarification on describing pages in the xml file. That'll definitely save some typing!

Cheers

Stephen

Erich Eichinger
02-12-2007, 10:40 PM
Hi Stephen,

glad your prob is solved.

Of course you can always submit a patch. Just post it here on the forum or attach it to a JIRA (http://opensource.atlassian.com/projects/spring/secure/BrowseProject.jspa?id=10020) issue. If you don't have a Jira account yet, just register and you may submit bug reports/feature requests at any time. We're always happy to find a helping hand :)

cheers,
Erich