Hi Tim, Helix,
Thanks for your help, I have fixed this by setting the cocoon.handled
level to FATAL and changed the xsl as you suggested. Since the errors
are cocoon handled, they will appear in the UI where appropriate, but
better than filling the logs up. I managed to create almost 2G of logs
yesterday.
Thanks
Ian


On 14 December 2012 09:56, Ian Boston <[email protected]> wrote:
> Hi Tim,
> Thank you.
> Could you give me a pointer to where the DSpace page is rendered?
>
>  Looking at the Coocon code it should be done by [1], but in DSpace
> that doesnt take the blindest bit of notice of the setting
> org.apache.cocoon.manageexceptions, which if set to false should just
> set the status.
>
> Incidentally, in the code I am looking at the status is set correctly
> when managed, at least in the cocoon codebase. If a
> ResourceNotFoundException appears as a 404 with html content, see [2],
> and the log message is issued at warn level.
>
> I am looking at the section of the stack below where think the
> ResourceNotFoundException is handled (line 189 in
> org.apache.cocoon.servlet.RequestProcessor )
>
>
>         at 
> org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:351)
>         at 
> org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)
>         at 
> org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
>
>
> Thanks
> Ian
>
>
>
> 1 org.apache.cocoon.servlet.RequestUtil.manageException(HttpServletRequest,
> HttpServletResponse, Environment, String, int, String, String, String,
> Exception, ServletSettings, boolean, Object)
>
> 2 org.apache.cocoon.servlet.RequestProcessor line 200:
>
>             RequestUtil.manageException(request, res, env, uri,
>                                         HttpServletResponse.SC_NOT_FOUND,
>                                         "Resource Not Found",
>                                         "Resource Not Found",
>                                         "The requested resource \"" +
> request.getRequestURI() + "\" could not be found",
>                                         e,
>                                         this.servletSettings,
> getLogger(), this);
>             return;
>
> On 14 December 2012 02:21, Tim Donohue <[email protected]> wrote:
>> Hi Ian,
>>
>> Just now saw this thread about the ugly 404 error page & logs in DSpace
>> XMLUI / Cocoon.
>>
>> You may already be aware of when/why this came about. But, I figured I'd
>> fill in some "history" just in case you (or others) are not.
>>
>> Essentially, prior to DSpace 1.8.x, DSpace XMLUI actually had a nicer
>> looking XMLUI "Page Not Found" Error page. It just simply said "page not
>> found" and looked like every other page in your XMLUI theme.
>>
>> However, then we discovered that Apache Cocoon was responding with "200 OK"
>> on *every error page* in the XMLUI, see this ticket
>> https://jira.duraspace.org/browse/DS-768
>>
>> Essentially, the only resolution we were able to come up with was to
>> actually patch Apache Cocoon to throw the proper 404 error. So we created a
>> patched copy of the Cocoon code which was throwing 200 instead of 404.  That
>> patched code is maintained here:
>> https://github.com/DSpace/dspace-cocoon-servlet-service-impl
>>
>> Unfortunately though, in our patching of this Cocoon bug, we were not able
>> to get our nicer looking "Page Not Found" error page to display
>> again...instead, we were left with the ugly error page you see now. That
>> patch to Cocoon may have also been the cause of the messages you are seeing
>> in the Cocoon.log.
>>
>> There may be ways to fix this & clean up both the "Page Not Found" error
>> page and limit the output in the Cocoon.log. I haven't looked into it in
>> some time. But, if you find anything that works for you, I'd highly
>> encourage you to send us a Pull Request or a patch -- I think this is
>> something we'd all like to see fixed.
>>
>> Not sure if this info will be of help. But, at least know you know the full
>> story of where this issue began.
>>
>> - Tim
>>
>>
>> On 12/12/2012 3:42 AM, Ian Boston wrote:
>>>
>>> On 12 December 2012 20:15, helix84 <[email protected]> wrote:
>>>>
>>>> Hi Ian,
>>>>
>>>> I don't know about shortening the stacktrace, but that's a pretty
>>>> generic Java question so you may try googling around.
>>>
>>>
>>> I dont think there is a way other than changing the Cocoon code,
>>> blocking the logger or not throwing the exception and setting a 404
>>> status code in the Dspace code. I might just do the latter.
>>>
>>>>
>>>> To answer at least a part of your question, this is where 404s are
>>>> handled in Cocoon. You may want to edit the XSL to filter what you
>>>> send to the user for specific exceptions and leave the rest (the
>>>> unexpected ones) as stacktraces.
>>>>
>>>>
>>>> https://github.com/DSpace/DSpace/blob/dspace-3_x/dspace-xmlui/src/main/webapp/sitemap.xmap#L673
>>>>
>>>
>>> Ok, thanks for the pointer.
>>>
>>> Ian
>>>
>>>
>>>>
>>>> Regards,
>>>> ~~helix84
>>>>
>>>> Compulsory reading: DSpace Mailing List Etiquette
>>>> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>>> Remotely access PCs and mobile devices and provide instant support
>>> Improve your efficiency, and focus on delivering more value-add services
>>> Discover what IT Professionals Know. Rescue delivers
>>> http://p.sf.net/sfu/logmein_12329d2d
>>> _______________________________________________
>>> DSpace-tech mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>> List Etiquette:
>>> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>>>
>>

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to