Unable to cast object of type 'Factory' to type 'Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactory'

8 posts, 0 answers
  1. Saeid Kdaimati
    Saeid Kdaimati avatar
    48 posts
    Member since:
    May 2006

    Posted 29 Jan 2014 Link to this post

    Hi,

    After updating to version 2013.3.1320.1, I start getting this error:

    Unable to cast object of type 'Factory' to type 'Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactory'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.InvalidCastException: Unable to cast object of type 'Factory' to type 'Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactory'.

    Source Error: 

    Line 143: get
    Line 144: {
    Line 145: return this.GetAll<AdministeringOffice>();
    Line 146: }
    Line 147: }
    Source File: 

    Stack Trace: 

    [InvalidCastException: Unable to cast object of type 'Factory' to type 'Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactory'.]
    Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactoryRegistry.getFactory(String name) +273

    [OpenAccessException: Unable to create RelationalKeyGeneratorFactory instance Telerik.OpenAccess.Runtime.KeyGenerator.HighLowRelationalKeyGenerator+Factory]
    OpenAccessRuntime.ExceptionWrapper.Throw() +13
    OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL() +550
    OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createStorageManagerFactory() +398
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryImp.createStorageManagerFactory() +589
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryBase.init() +897
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryImp.init() +46
    OpenAccessRuntime.DataObjects.BootstrapPMF.getPersistenceManagerFactory(PropertySet props) +325
    OpenAccessRuntime.Helper.getPersistenceManagerFactory(PropertySet props) +458
    OpenAccessRuntime.DatabaseAdapter.AssertPersistenceManagerFactory(String usr, String password, Boolean open) +1583
    OpenAccessRuntime.DatabaseAdapter.GetObjectScope(TransactionProvider provider) +38
    Telerik.OpenAccess.OpenAccessContextBase.GetScope() +57
    Telerik.OpenAccess.OpenAccessContext.GetAllCore() +15
    BridgeData.EntitiesModel.get_AdministeringOffices() in c:\Users\saeed\SkyDrive\Projects\Bridge\BridgeData\EntitiesModel.cs:145
    Transactions.TransactionsDefault.BindBasicData() in c:\Users\saeed\skydrive\projects\Bridge\Bridge.V2.UI\Transactions\Default.aspx.cs:44
    Transactions.TransactionsDefault.Page_Load(Object sender, EventArgs e) in c:\Users\saeed\skydrive\projects\Bridge\Bridge.V2.UI\Transactions\Default.aspx.cs:24
    System.Web.UI.Control.LoadRecursive() +71
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178


    Can you help please?



  2. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 29 Jan 2014 Link to this post

    Hello Saeid,
    The reported error is a problem of mismatched assembly versions.

    You could use the Upgrade References command in order to upgrade all of the DataAccess assembly reference in your project with the latest installed. If this does not help, you need to ensure that you have replaced all locally deployed DataAccess assemblies with the latest version.

    Hope this helps.
    Feel free to ask in case you have any other question.

    Regards,
    Ralph Waldenmaier
    Telerik
    Telerik has recently updated some of its product names. You can check out the Telerik Product Map here (www.telerik.com/name-mapping). OpenAccess ORM is now renamed to Telerik Data Access.
  3. DevCraft banner
  4. Saeid Kdaimati
    Saeid Kdaimati avatar
    48 posts
    Member since:
    May 2006

    Posted 29 Jan 2014 in reply to Ralph Waldenmaier Link to this post

    Thank you Ralph, I it is ok now. I've deleted all open access dlls then built the solution.

    Best
  5. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 29 Jan 2014 Link to this post

    Hi Saeid,
    I am glad that you were able to resolve this issue.

    Do come back in case you need further assistance.

    Regards,
    Ralph Waldenmaier
    Telerik
    Telerik has recently updated some of its product names. You can check out the Telerik Product Map here (www.telerik.com/name-mapping). OpenAccess ORM is now renamed to Telerik Data Access.
  6. Andrei
    Andrei avatar
    2 posts
    Member since:
    Sep 2014

    Posted 29 Dec 2014 Link to this post

    Hi,

    After updating to version 2014.3.1209.1, I start getting this error:

    Unable to cast object of type 'Factory' to type 'Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactory'.

    Description: An
    unhandled exception occurred during the execution of the current web
    request. Please review the stack trace for more information about the
    error and where it originated in the code.

    Exception Details: System.InvalidCastException:
    Unable to cast object of type 'Factory' to type
    'Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactory'.

    Source Error:

    Line 103: get
    Line 104: {
    Line 105: return this.GetAll<daCategory>();
    Line 106: }
    Line 107: }

    Source File: G:\SearchPortal\SearchEngines.Data\EntitiesModel.cs    Line: 105

    Stack Trace:

    [InvalidCastException: Unable to cast object of type 'Factory' to type 'Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactory'.]
    Telerik.OpenAccess.Runtime.KeyGenerator.RelationalKeyGeneratorFactoryRegistry.getFactory(String name) +266

    [OpenAccessException: Unable to create RelationalKeyGeneratorFactory instance Telerik.OpenAccess.Runtime.KeyGenerator.HighLowRelationalKeyGenerator+Factory]
    Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28
    OpenAccessRuntime.ExceptionWrapper.Throw() +42
    OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL() +419
    OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createStorageManagerFactory() +451
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryImp.createStorageManagerFactory() +630
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryBase.init() +935
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryImp.init() +95
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryImp..ctor(PropertySet properties, Object classloader) +73
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryImp.getPersistenceManagerFactory(PropertySet props) +54
    OpenAccessRuntime.DataObjects.BootstrapPMF.getPersistenceManagerFactory(PropertySet props) +268
    OpenAccessRuntime.Helper.getPersistenceManagerFactory(PropertySet props) +414
    OpenAccessRuntime.DatabaseAdapter.AssertPersistenceManagerFactory(String usr, String password, Boolean open) +1854
    OpenAccessRuntime.DatabaseAdapter.GetObjectScope(TransactionProvider provider) +88
    Telerik.OpenAccess.Database.GetObjectScope(TransactionProvider provider) +45
    Telerik.OpenAccess.OpenAccessContextBase.GetScope() +85
    Telerik.OpenAccess.OpenAccessContext.GetAllCore() +48
    Telerik.OpenAccess.OpenAccessContext.GetAll() +92
    SearchEngines.Data.EntitiesModel.get_daCategories() in g:\Projects\Danemarka\SearchPortal\SearchEngines.Data\EntitiesModel.cs:105
    SearchEngines.Controllers.HomeController.Index() in g:\Projects\Danemarka\SearchPortal\SearchEngines\Controllers\HomeController.cs:32
    lambda_method(Closure , ControllerBase , Object[] ) +101
    System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
    System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +211
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
    System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
    System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
    System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
    System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
    System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
    System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
    System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
    System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
    System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
    System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
    System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
    System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
    System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9514812
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

    I did Upgrade References, but it did not solve the problem.

    Can you help please?

  7. Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    291 posts

    Posted 30 Dec 2014 Link to this post

    Hi Andrei,

    Have you tried the method suggested by Ralph a few posts below for all projects that are defining and using an entities model? If you have missed a single project that could lead to the exception you are experiencing. Also make sure to restart Visual Studio after the "Upgrade References" process is done and then rebuild the whole solution.

    If all these steps do not help, please give us more details about the original version of Telerik Data Access that you were using previously, the method of referencing our assemblies in your project (were you using the simple references and the default targets file or you were using the No Installation method or NuGets).

    Regards and Happy New year,
    Viktor Zhivkov
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  8. Andrei
    Andrei avatar
    2 posts
    Member since:
    Sep 2014

    Posted 31 Dec 2014 in reply to Viktor Zhivkov Link to this post

    Hi Viktor,
    I resolve this issue.

    Thank you! :)
  9. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 05 Jan 2015 Link to this post

    Hello Andrei,

    Thank you for the feedback. I am glad that currently things are working on your side.

    Do let us know, if you experience further issues or need additional information.


    Regards,
    Doroteya
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
Back to Top
DevCraft banner