Open RIA Services User Support OPEN RIA SERVICES / WCF RIA SERVICES Random Errors  Viewed 30365 time(s), 5 post(s)., 6/18/2014 3:19:57 PM - by PedroFerreira

PedroFerreira
PedroFerreira 6/18/2014 3:22:00 PM

Hi,

We are having some random errors while running our project, in both development and production environment. It only happens sometimes. Usually we have to recompile the project many times to make this error go away. Please note that this only happens at run-time, everything always compiles just fine.

Even when we run our application and everything is working, after long periods of time (several days) the application occasionally fails. If we restart the IIS (or website) then everything works again.

Please take a look at some of those errors; they usually don't happen at the same time:

Example1:
Entity 'BAnesthesic.RIAServicesLibrary.Web.RegistoFluido' has a property 'FluidoReference' with an unsupported type.. ---> System.InvalidOperationException: Entity 'BAnesthesic.RIAServicesLibrary.Web.RegistoFluido' has a property 'FluidoReference' with an unsupported type.

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.AddEntityType(Type entityType)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.AddEntityType(Type entityType)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.AddQueryMethod(DomainOperationEntry method)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.Initialize()

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.CreateDescription(Type domainServiceType)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.<>c__DisplayClass10.<GetDescription>b__f(Type type)

   em System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.GetDescription(Type domainServiceType)

   em OpenRiaServices.DomainServices.Hosting.DomainServiceHost..ctor(Type domainServiceType, Uri[] baseAddresses)

   em OpenRiaServices.DomainServices.Hosting.DomainServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)

   em System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

Example 2:
The Entity 'TipoPrescr' in DomainService 'EpisodiosRecobroDomainService' does not have a key defined. Entity types exposed by DomainService operations must have at least one public property marked with the KeyAttribute.. ---> System.InvalidOperationException: The Entity 'TipoPrescr' in DomainService 'EpisodiosRecobroDomainService' does not have a key defined. Entity types exposed by DomainService operations must have at least one public property marked with the KeyAttribute.

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.ValidateEntityTypes()

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.Initialize()

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.CreateDescription(Type domainServiceType)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.<>c__DisplayClass10.<GetDescription>b__f(Type type)

   em System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.GetDescription(Type domainServiceType)

   em OpenRiaServices.DomainServices.Hosting.DomainServiceHost..ctor(Type domainServiceType, Uri[] baseAddresses)

   em OpenRiaServices.DomainServices.Hosting.DomainServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)

   em System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

Example 3:
Invalid Include specification for member 'RegistoFluido.Fluido'. Non-projection includes can only be specified on members with the AssociationAttribute applied.. ---> System.InvalidOperationException: Invalid Include specification for member 'RegistoFluido.Fluido'. Non-projection includes can only be specified on members with the AssociationAttribute applied.

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.ValidateEntityTypes()

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.Initialize()

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.CreateDescription(Type domainServiceType)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.<>c__DisplayClass10.<GetDescription>b__f(Type type)

   em System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)

   em OpenRiaServices.DomainServices.Server.DomainServiceDescription.GetDescription(Type domainServiceType)

   em OpenRiaServices.DomainServices.Hosting.DomainServiceHost..ctor(Type domainServiceType, Uri[] baseAddresses)

   em OpenRiaServices.DomainServices.Hosting.DomainServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)

   em System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)

<o:p></o:p>

   em System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)


We have recently upgraded from entity framework 5 and WCF Ria Services V1.0 SP2 to entity framework 6.1.0 and Open ria services trying to fix this problem. But we are still seeing the same errors. Our application (Silverlight line of business application) is hosted in IIS 7.5.

Thanks for your help

This content has not been rated yet. 
25 Reputation 3 Total posts
1
ColinBlair
ColinBlair 6/19/2014 2:59:48 PM

That is not an error I have seen before, it looks like at some point the MetadataWorkspace breaks down and the bare entities are exposed to RIA Services. How are your application pools configured? Do they recycle on a daily basis as they are configured by default?

This content has not been rated yet. 
1539 Reputation 130 Total posts
2
PedroFerreira
PedroFerreira 6/27/2014 10:06:04 AM

Hi Colin,

Thanks for your answer.
Yes,  my application pools have all the default values, the app pool recycle is set to 1740 minutes.
I've found some other people reporting what appears to be the same problem that I'm having, please take a look at the following links:

http://social.msdn.microsoft.com/Forums/silverlight/en-US/b426bf2a-cc54-4f15-a210-1fa784b017cd/problem-using-entity-model-in-domain-service-unsupported-type?forum=silverlightwcf
http://social.msdn.microsoft.com/Forums/silverlight/en-US/eefb8838-908e-4938-989d-70abdb34404e/the-service-cannot-be-activated-due-to-an-exception-during-compilation-entity-has-a-property-with?forum=silverlightwcf
http://stackoverflow.com/questions/17783038/entity-does-not-have-a-key-defined-error-in-working-production-code
http://stackoverflow.com/questions/19166780/wcf-ria-service-has-serviceactivationexception-after-app-pool-recycle-with-unusu

Unfortunately the solution proposed in first and second links did not work for me.

This content has not been rated yet. 
25 Reputation 3 Total posts
3
ColinBlair
ColinBlair 6/27/2014 2:42:51 PM

Interesting links. Do you have multiple domain services sharing the same entity? Possibly a DomainService that isn't called very often that may be triggering the problem?

This content has not been rated yet. 
1539 Reputation 130 Total posts
4
PedroFerreira
PedroFerreira 6/27/2014 2:59:48 PM

Yes I do. But those domain services are called very often. Maybe that's why I'm getting this error so many times in development, but once again it only happens sometimes.

This content has not been rated yet. 
25 Reputation 3 Total posts
5