Thanks Jan (Jan and I work together on this project).

Can anyone explain why we cannot use a component within a mail view/template?

On Wed, Sep 24, 2008 at 4:20 AM, Jan Limpens <[EMAIL PROTECTED]> wrote:
> Hi Ayende,
>
> my test skills are quite mediocre, I did not find out how to create a
> unit test for this. (and could not inspire myself on the castle
> sourcecode from where I am now)
> However I did create a solution that does nothing else than reproduce
> the error in isolation. Maybe have a look at this :)
>
> --
> Jan
>
> On Tue, Sep 23, 2008 at 2:34 PM, Ayende Rahien <[EMAIL PROTECTED]> wrote:
>> Please create a test case that shows the issue.
>>
>> On Tue, Sep 23, 2008 at 6:25 PM, Jamie Fraser <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> Is it possible to use a Component within a mail template? When I do so
>>> I get a NullRefException
>>>
>>> My mail/info.brail contains:
>>>
>>> <% component OrderConfirmation, [EMAIL PROTECTED]: order, @isWeb: isWeb} %>
>>>
>>> The error I get, when calling RenderMailMessage(view, layout,
>>> parameters); (with "Info", "Mail" and some parameters) is
>>>
>>> MonoRailException
>>>
>>> Message:
>>> Exception on process view: mail\Info
>>> Last accessed variable: isWeb
>>>
>>>
>>> StackTrace:
>>>   at Castle.MonoRail.Views.Brail.BooViewEngine.HandleException(String
>>> templateName, BrailBase view, Exception e) in
>>>
>>> c:\data\castle\castle\trunk\MonoRail\Castle.MonoRail.Views.Brail\BooViewEngine.cs:line
>>> 289
>>>   at Castle.MonoRail.Views.Brail.BooViewEngine.RenderView(String
>>> templateName, BrailBase view) in
>>>
>>> c:\data\castle\castle\trunk\MonoRail\Castle.MonoRail.Views.Brail\BooViewEngine.cs:line
>>> 165
>>>   at Castle.MonoRail.Views.Brail.BooViewEngine.Process(String
>>> templateName, TextWriter output, IEngineContext context, IController
>>> controller, IControllerContext controllerContext) in
>>>
>>> c:\data\castle\castle\trunk\MonoRail\Castle.MonoRail.Views.Brail\BooViewEngine.cs:line
>>> 146
>>>   at Castle.MonoRail.Views.Brail.BooViewEngine.Process(String
>>> templateName, String layoutName, TextWriter output, IDictionary`2
>>> parameters) in
>>> c:\data\castle\castle\trunk\MonoRail\Castle.MonoRail.Views.Brail\BooViewEngine.cs:line
>>> 197
>>>   at
>>> Castle.MonoRail.Framework.Services.DefaultViewEngineManager.Process(String
>>> templateName, String layoutName, TextWriter output, IDictionary`2
>>> parameters) in
>>> c:\data\castle\castle\trunk\MonoRail\Castle.MonoRail.Framework\Services\DefaultViewEngineManager.cs:line
>>> 179
>>>   at
>>> Castle.MonoRail.Framework.EmailTemplateService.RenderMailMessage(String
>>> templateName, String layoutName, IDictionary parameters) in
>>>
>>> c:\data\castle\castle\trunk\MonoRail\Castle.MonoRail.Framework\Services\EmailTemplateService.cs:line
>>> 140
>>>   at Castle.MonoRail.Framework.Controller.RenderMailMessage(String
>>> templateName, String layoutName, IDictionary parameters) in
>>>
>>> c:\data\castle\castle\trunk\MonoRail\Castle.MonoRail.Framework\Controller.cs:line
>>> 1415
>>>   at
>>> FestaExpress.Web.Site.MVC.Controllers.BaseController.RenderExtEmailMessage(String
>>> view, String layout, IDictionary parameters) in
>>>
>>> C:\CODE\fexdev\FestaExpress\branches\1.5\FestaExpress.Web.Site.MVC\Controllers\BaseController.cs:line
>>> 128
>>>   at FestaExpress.Web.Site.MVC.Controllers.DebugController.SendOrderMail()
>>> in
>>> C:\CODE\fexdev\FestaExpress\branches\1.5\FestaExpress.Web.Site.MVC\Controllers\DebugController.cs:line
>>> 30
>>>   at
>>> FestaExpress.Web.Site.MVC.Controllers.DebugController.ViewOrderInfo(Int32
>>> orderId) in
>>> C:\CODE\fexdev\FestaExpress\branches\1.5\FestaExpress.Web.Site.MVC\Controllers\DebugController.cs:line
>>> 72
>>>
>>>
>>>
>>> Inner exception:
>>>
>>> NullReferenceException
>>>
>>> Message:
>>> Object reference not set to an instance of an object.
>>>
>>>
>>> StackTrace:
>>>   at BrailView_Info.Run()
>>>   at Castle.MonoRail.Views.Brail.BooViewEngine.RenderView(String
>>> templateName, BrailBase view) in
>>>
>>> c:\data\castle\castle\trunk\MonoRail\Castle.MonoRail.Views.Brail\BooViewEngine.cs:line
>>> 161
>>>
>>>
>>>
>>> I have tried this even with a simple Component (one with no
>>> parameters) and get the same error.
>>>
>>> Any ideas?
>>>
>>> -Jamie
>>>
>>>
>>
>>
>> >>
>>
>
>
>
> --
> Jan
> ___________________
> [EMAIL PROTECTED]
> www.limpens.com
> +55 (11) 3082-1087
> +55 (11) 3097-8339
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to