Using WcfFacility proxy from web app results in occasional NotSupportedException

434 views
Skip to first unread message

Konstantin Alexandroff

unread,
May 5, 2012, 9:05:08 AM5/5/12
to castle-pro...@googlegroups.com
We register our Wcf proxies as

container.Register(Component.For(t).AsWcfClient(WcfEndpoint.FromConfiguration("*"))
Endpoints defined in web.config.

Everything works great, but once in a while (a week +-) one of the proxies stops working until AppPool is restarted. Before using WcfFacility we used similar custom proxying using ChannelFactory building (new ChannelFactory<T>("*")) without any problem I can recall.

So the question is, as usual, what could be the source of the problem? Perhaps it's a configuration issue (lifestyle required?).

We use Core/Windsor 3.0.0.0.

In logs we see something like this:
System.NotSupportedException: Method VoteForDiscussion is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.
   at Castle.Facilities.WcfIntegration.Proxy.WcfRemotingInterceptor.<>c__DisplayClass1.<PerformInvocation>b__0(WcfInvocation wcfInvocation) in c:\BuildAgent\work\9834359f44c23fee\src\Castle.Facilities.WcfIntegration\Client\Proxy\WcfRemotingInterceptor.cs:line 53
   at Castle.Facilities.WcfIntegration.WcfInvocation.Proceed() in c:\BuildAgent\work\9834359f44c23fee\src\Castle.Facilities.WcfIntegration\WcfInvocation.cs:line 44
   at Castle.Facilities.WcfIntegration.RepairChannelPolicy.Apply(WcfInvocation wcfInvocation) in c:\BuildAgent\work\9834359f44c23fee\src\Castle.Facilities.WcfIntegration\Client\Policies\RepairChannelPolicy.cs:line 31
   at Castle.Facilities.WcfIntegration.Proxy.WcfRemotingInterceptor.PerformInvocation(IInvocation invocation, IWcfChannelHolder channelHolder, Action`1 action) in c:\BuildAgent\work\9834359f44c23fee\src\Castle.Facilities.WcfIntegration\Client\Proxy\WcfRemotingInterceptor.cs:line 72
   at Castle.DynamicProxy.AbstractInvocation.Proceed() in c:\BuildAgent\work\8689a06309d1ab0b\src\Castle.Core\DynamicProxy\AbstractInvocation.cs:line 170
   at Castle.Proxies.IWcfChannelHolderProxy_1.VoteForDiscussion(Guid discussion, Guid argument)
   at Foo.Bar.Web.Specific.Discussions.DiscussionManager.Vote(Guid discussionId, Guid argumentId, HttpContextBase context) in c:\BuildAgent\work\397ad3340da6dda6\Sources\Bar-Web-Specific\Discussions\DiscussionManager.cs:line 42
   at Foo.Bar.Web.Controllers.DiscussionController.Vote(Guid discussionId, Guid argumentId) in c:\BuildAgent\work\397ad3340da6dda6\Sources\Bar-Web\Controllers\DiscussionController.cs:line 53
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at Foo.Bar.Web.Specific.Windsor.WindsorActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) in c:\BuildAgent\work\397ad3340da6dda6\Sources\Bar-Web-Specific\Windsor\WindsorActionInvoker.cs:line 22
   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
   at System.Web.Mvc.Controller.ExecuteCore()
   at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
   at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.<BeginProcessRequest>b__5()
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
   at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.<EndProcessRequest>b__d()
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Krzysztof Koźmic

unread,
May 5, 2012, 7:19:23 PM5/5/12
to castle-pro...@googlegroups.com
Hi Konstantin

Are there any generics involved? When the issue happens once, does it keep happening everytime after that?

The stack trace is quite misleading here. The exception comes from WCF itself, and WCFFacility merely rethrows it (which erases original callstack, unless we force it to preserve it (which requires calling non-public API).


@K
--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/LftLi19j86kJ.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.

Konstantin Alexandroff

unread,
May 10, 2012, 10:35:41 AM5/10/12
to castle-pro...@googlegroups.com
Hi, Krzystof

sorry for delay.

Neither services nor any 'operations' are generic in our case.

When issue happens, every call to every method of that particular service ends with the same failure. Other services work as usual. Until we restart AppPool. After that, everything works again for days/weeks.

If you're saying it's a WCF problem we could try to stress-test it with tracing enabled but It won't be easy due to irregular nature of the situation.

We'll also try to drop xml configuration. But apart from that I'm not sure what else we can do.

K
To post to this group, send email to castle-project-users@googlegroups.com.
To unsubscribe from this group, send email to castle-project-users+unsub...@googlegroups.com.

Krzysztof Koźmic

unread,
May 15, 2012, 6:04:42 AM5/15/12
to castle-pro...@googlegroups.com
Howdy,

Could you try to isolate the issue? A standalone trivial app that you could share that exhibits the problem would really help us understand what the problem is so that we can fix it.

At this point I don't really know what might be the cause or solution to it.

@K
To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/XBoOXTYGgTEJ.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.

Konstantin Alexandroff

unread,
May 15, 2012, 7:38:01 AM5/15/12
to castle-pro...@googlegroups.com
Greetings,

I've tried to isolate the problem really hard but without success, it goes rogue totally unexpected. All I was able to get is that it happens only at the proxy creation but other circumstances are unknown. I ended up moving endpoints configuration to the code, we'll see how it goes now.

Thanks for your help!

K

Krzysztof Koźmic

unread,
May 15, 2012, 7:39:49 AM5/15/12
to castle-pro...@googlegroups.com
ok

keep us posted

@K
To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/mCXG6kVlosAJ.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.

Konstantin Alexandroff

unread,
Jan 19, 2013, 8:15:01 AM1/19/13
to castle-pro...@googlegroups.com
Hi,

we haven't experienced the issue since moving to Windsor 3.1 but i'm not on a project anymore, so i can't say for sure if the problem is gone. That's unfortunately all I can add.

K

On Friday, January 18, 2013 10:14:18 PM UTC+4, Swami Iyer wrote:
Hi,
We have similar issue and I am interested in understand what or how we can resolve the issue.

Thanks,
Swami
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-users+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/XBoOXTYGgTEJ.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-users+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/mCXG6kVlosAJ.
To post to this group, send email to castle-pro...@googlegroups.com.

Frédéric Legrain

unread,
Jan 19, 2013, 8:41:10 AM1/19/13
to castle-pro...@googlegroups.com
Hi Krzysztof,

You told that "The exception comes from WCF itself, and WCFFacility merely rethrows it (which erases original callstack, unless we force it to preserve it (which requires calling non-public API)."
How can one get the complete stack trace?

Cheers,

Frédéric


2013/1/19 Konstantin Alexandroff <k.alex...@gmail.com>

To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.

Krzysztof Kozmic

unread,
Jan 19, 2013, 4:31:17 PM1/19/13
to castle-pro...@googlegroups.com
If you upgrade to v3.1 it already does that

-- 
Krzysztof Kozmic

Frédéric Legrain

unread,
Jan 20, 2013, 12:18:20 PM1/20/13
to castle-pro...@googlegroups.com
Nice!
Thanks

Frédéric

2013/1/19 Krzysztof Kozmic <krzyszto...@gmail.com>
Reply all
Reply to author
Forward
0 new messages