+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Error in Jobs Intermediate Module

Error in Jobs Intermediate Module

17 posts, 0 answered
  1. William
    William avatar
    42 posts
    Registered:
    17 May 2007
    09 Feb 2011
    Link to this post
    Hey folks,

    I have a need on a project to manage some specific data with a CRUD approach, so for instance let's say that data had to do with promotions which include various text fields, images, etc.  I went through the Jobs sample included in the final release documentation and found it a bit lacking.  I took a look at the Products module and found it too much.  So I'm trying to register Jobs Intermediate as a module to see what it has inside it.

    I tossed the files, as they existed, into my project.  I changed the database config to match my SQLEXPRESS info.

    First error caused me to have to change the template names in both Public Control files from Jobs. to JobsIntermediate. to match the project namespace.

    Second error caused me to have to have to add [assembly: AssemblyVersion("1.0.*")] into the assemblyinfo.cs instead of the existing [assembly: AssemblyVersion("1.0.0.0")].

    I should also note that though this module is registered in SystemConfig, it did not show up automatically in ToolboxesConfig.

    What I'm getting now is the following error:

    No class found for extent "extnt".
    Original Query: DEFINE EXTENT extnt FOR JobsIntermediate.Model.JobApplication; SELECT * FROM extnt AS t1  WHERE t1.appName =  $1

    And I've hit a dead end.

    So two questions.  Firstly, can you help me debug this further so that I can take a look at it in my application?

    Secondly, is there some example of a module that simply does CRUD features for an admin on some custom data?

    Thanks much.

    - William
  2. William
    William avatar
    42 posts
    Registered:
    17 May 2007
    11 Feb 2011
    Link to this post
    Can anyone point me to why this might be happening?

    So far, I've tried to register and get working all three of the sample projects into mine.  To date, Jobs is the only one that has worked.  JobsIntermediate failed as shown in this post.  Products is simply not registering at all, but that'll be another forum post.  I'm a bit frustrated.

    As a side note, as a developer of a licensed Sitefinity Professional product for a client, do I have access to any official support in the form of a ticketing system?  I'd love to move some of these items into somewhere that I can get fast support as we move forward.

    Thanks.  You guys have solved 100 percent of my problems so far.  I'm hoping to get these modules resolved as quickly too.

    - William
  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    14 Feb 2011
    Link to this post
    Hi William,

    It seems that you are trying to perform a query and your property is not added to the persisted fields. Can you please make sure that your custom module has a reverence to the VEnhance.exe file and that you have marked field aliases for your properties, e.g.:
    /// <summary>
    /// Gets or sets the phone.
    /// </summary>
    /// <value>The phone.</value>
    [FieldAlias("phone")]
    public string Phone
    {
        get
        {
            return this.phone;
        }
        set
        {
            this.phone = value;
        }
    }
    ...
    private string phone;


    All the best,
    Radoslav Georgiev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  4. William
    William avatar
    42 posts
    Registered:
    17 May 2007
    14 Feb 2011
    Link to this post
    Hi Radoslav,

    Actually, I didn't write the module at all.  This is the Jobs Intermediate module that is included in your samples, shipped with the final release.  So the code references those properties the way you wrote it.

    I'm not sure what the VEnhance.exe file is.  Can you explain more?

    All I really did was copy the files into my project, compile and try to run them.

    - William
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Feb 2011
    Link to this post
    Hi William,

    The VEnhance.exe file is an executable for OpenAccess which enables the ORM to handle your persistent classes. You can find more information here.

    Greetings,
    Radoslav Georgiev
    the Telerik team
  6. Christian Calderon
    Christian Calderon avatar
    5 posts
    Registered:
    06 Nov 2009
    19 Feb 2011
    Link to this post
    I have tried also to install the Jobs-Intermediate, and no luck so far. Corrected the VEnhance Path on the project file, changed a bunch of stuff and nothing. I'm completely lost as to what would it take to get this one example running. The sample is the one that came with the Sitefinity installation and is under
    C:\Program Files\telerik\Sitefinity 4.0\Samples\CS\

    Help? :-S

    Regards

    System.Reflection.TargetInvocationException was unhandled by user code
      Message=Exception has been thrown by the target of an invocation.
      Source=mscorlib
      StackTrace:
           at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
           at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
           at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
           at System.Activator.CreateInstance[T]()
           at Telerik.Sitefinity.Data.ManagerBase`1.GetManager[T](String providerName, String transactionName)
           at Telerik.Sitefinity.Data.ManagerBase`1.GetManager[T](String providerName)
           at JobsIntermediate.JobsManager.GetManager(String providerName) in C:\Program Files\telerik\Sitefinity 4.0\Samples\CS\Jobs Intermediate\JobsManager.cs:line 96
      InnerException: Telerik.OpenAccess.Exceptions.MetadataException
           Message=Persistence-capable-superclass 'Telerik.Sitefinity.GenericContent.Model.Content' not declared in meta data. --> JobsIntermediate, Version=1.0.4067.16112, Culture=neutral, PublicKeyToken=null/namespace[JobsIntermediate.Model]/class[JobsIntermediate.Model.JobApplication]
           Source=Unity_ILEmit_DynamicClasses
           CanRetry=true
           ClassName=Telerik.Sitefinity.GenericContent.Model.Content
           Column=0
           Context=--> JobsIntermediate, Version=1.0.4067.16112, Culture=neutral, PublicKeyToken=null/namespace[JobsIntermediate.Model]/class[JobsIntermediate.Model.JobApplication]
           ErrorId=0
           IsWarning=false
           Line=0
           StackTrace:
                at DynamicModule.ns.Wrapped_OpenAccessJobsDataProvider_23663548744d4ed7876024fd86b3ab74.Initialize(String providerName, NameValueCollection config, Type managerType)
                at Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, Type providerType, ExceptionPolicyName policy, ManagerBase`1 manager)
                at Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, ExceptionPolicyName policy, ManagerBase`1 manager)
                at Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName)
                at Telerik.Sitefinity.Data.ManagerBase`1..ctor(String providerName, String transactionName)
                at Telerik.Sitefinity.Data.ManagerBase`1..ctor(String providerName)
                at Telerik.Sitefinity.Modules.GenericContent.ContentManagerBase`1..ctor(String providerName)
                at JobsIntermediate.JobsManager..ctor(String providerName) in C:\Program Files\telerik\Sitefinity 4.0\Samples\CS\Jobs Intermediate\JobsManager.cs:line 29
                at JobsIntermediate.JobsManager..ctor() in C:\Program Files\telerik\Sitefinity 4.0\Samples\CS\Jobs Intermediate\JobsManager.cs:line 20
           InnerException:
  7. William
    William avatar
    42 posts
    Registered:
    17 May 2007
    22 Feb 2011
    Link to this post
    Christian,

    Just so you know.  I've even reinstalled Sitefinity, gone the ticket route, and nothing.  It makes the custom modules unusable here.

    Now I can't even get Jobs, let alone Jobs Intermediate to embed.  I'm about to pull my hair out.

    - William
  8. William
    William avatar
    42 posts
    Registered:
    17 May 2007
    23 Feb 2011
    Link to this post
    Just an add on to this thread.

    I've found that if you add the following into SystemConfig.config (modified for your module):

    <add title="JobsIntermediate" description="" resourceClassId="JobsResources" type="JobsIntermediate.JobsModule" startupType="OnApplicationStart" version="" name="JobsIntermediate" />

    I can add as many modules as I want.  Note that the version is left blank.  If I fill in a version there, I cannot register.  Leaving it blank, I can register fine.

    For stubborn cases, I've also had luck doing the above and then going into the configuration as described in the documentation (http://www.sitefinity.com/4.0/documentation/how-to-create-an-intermediate-module/register-the-module.aspx).  JobsIntermediate (or whatever your module is called) is present.  Editing it and simply resaving it also seems to help in cases where registration is stuck.

    I'm hoping that helps get somebody else over that hurdle at least.

    - William

  9. Hristo Borisov
    Hristo Borisov avatar
    190 posts
    Registered:
    07 Sep 2016
    28 Feb 2011
    Link to this post
    Hello William Cooper,

    You are absolutely right that such example on how to reinitialize your module is compulsory. We are currently reorganizing the Developers Manual to accommodate all the feedback we have received from customers, and this is absolutely something to be present.

    I have included your request in our documentation backlog and we will do our best to include it as soon as possible.

    Best wishes,
    Hristo Borisov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  10. Suzanne
    Suzanne avatar
    43 posts
    Registered:
    12 Jul 2012
    15 Mar 2011
    Link to this post
    Hey William,

    I just went through this same issue and figured out a solution.  In your Sitefinity Web App project, add a reference to VEnhance.exe

    If you look in .../Program Files/Telerik/Sitefinity 4.0/Libraries you will find the executable.  You can copy this to the bin folder of your project if you want to keep it all together.

    This resolved this particular issue for me, and now I'm stuck on Resource localization.
  11. Suzanne
    Suzanne avatar
    43 posts
    Registered:
    12 Jul 2012
    15 Mar 2011
    Link to this post
    I take it back - this error showed back up after I resolved the localization issue.
  12. Pavel Iliev
    Pavel Iliev avatar
    140 posts
    Registered:
    18 Jul 2016
    21 Mar 2011
    Link to this post
    Hello Suzanne,

    Do you still have a problem? If the issue persists could you provide more information about the error and the steps you use to replicate the issue.

    Best wishes,
    Pavel
    the Telerik team
  13. Suzanne
    Suzanne avatar
    43 posts
    Registered:
    12 Jul 2012
    30 Mar 2011
    Link to this post
    Yes, I'm still having this error.  Here's how I reproduce:

    1) Log into Sitefinity (after module is installed)
    2) Select Content->Jobs and the following error is displayed:

    No class found for extent "extnt".<br>Original Query: DEFINE EXTENT extnt FOR Job.Model.JobsModel; SELECT * FROM extnt AS t1  WHERE t1.appName =  $1<br>


    When I debug the code, it's failing in the JobsDataProvider class, on this line:

    var query = SitefinityQuery.Get<JobsModel>(this,MethodBase.GetCurrentMethod())<br>                                        .Where(b => b.ApplicationName == appName);
  14. mstoffel
    mstoffel avatar
    27 posts
    Registered:
    13 Jul 2005
    08 Apr 2011
    Link to this post


    Any help for Suzanne? I have the same issue (...extnt...) when I create my first module :(


  15. Suzanne
    Suzanne avatar
    43 posts
    Registered:
    12 Jul 2012
    08 Apr 2011
    Link to this post
    Michel,

    This issue, for me, was due to not having the correct path to the OpenAccess VEnhance.exe in my project file.  In your module project, edit the project file and confirm the path to VEhance.exe is correct.  In my example below, I added a property in my project file called LibrariesDir, which stores the relative path to VEhance.exe ("..\Libraries") for my solution.  

    <Target Name="EnhanceAssembly" Condition="'$(_AssemblyTimestampBeforeCompile)'!='$(_AssemblyTimestampAfterCompile)'">
        <Copy SourceFiles="$(TargetPath)" DestinationFiles="$(TargetPath).notenhanced" />
        <Copy SourceFiles="$(PdbFile)" DestinationFiles="$(PdbFile).notenhanced" ContinueOnError="true" />
        <Message Text="$(TargetDir)" Importance="high" />
        <Message Text="Solution = $(SolutionDir)" Importance="high" />
        <Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command="&quot;$(LibrariesDir)VEnhance.exe&quot; -verboseMode:2 &quot;-config:$(ProjectDir)App.config&quot; -signAssembly &quot;-keyFile:$(ProjectDir)$(AssemblyOriginatorKeyFile)&quot; &quot;-assembly:$(TargetPath)&quot;" Condition="'$(AssemblyOriginatorKeyFile)'!=''" />
        <Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command="&quot;$(LibrariesDir)VEnhance.exe&quot; -verboseMode:2 &quot;-config:$(ProjectDir)App.config&quot; &quot;-assembly:$(TargetPath)&quot;" Condition="'$(AssemblyOriginatorKeyFile)'==''" />
        <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(IntermediateOutputPath)" />
        <Copy SourceFiles="$(PdbFile)" DestinationFolder="$(IntermediateOutputPath)" ContinueOnError="true" />
      </Target>
  16. martani
    martani avatar
    27 posts
    Registered:
    24 Jan 2011
    08 Apr 2011
    Link to this post
    I did everything possible, corrected the VEnhance.exe issue, played around with the namespaces but without a result at all.

    Just to be sure, in the App.config file, what are the sections that must be changed? to my understanding I changed only these :
    <databasename>MY_DB</databasename>
    <servername>SOME_PC\SQLEXPRESS</servername>

    Now I'am getting this error :
    Invalid object name 'job_application'.
    Statement(s) could not be prepared.

    Stack Trace :
    [SQLException: Invalid object name 'job_application'.
    Statement(s) could not be prepared.]
       Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery() +573
       OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery() +117
       OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute() +89
     
    [DataStoreException: Error executing query: Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'job_application'.
    Statement(s) could not be prepared.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
       at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
       at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
    SQL:
    SELECT a.[content_id] AS COL1, a.[first_name] AS COL2, a.[last_name] AS COL3, a.[phone] AS COL4, a.[referral] AS COL5, a.[txt] AS COL6, a.[description_] AS COL7, a.[title_] AS COL8, a.[url_name_] AS COL9, a.[allow_comments] AS COL10, a.[allow_track_backs] AS COL11, a.[app_name] AS COL12, a.[approve_comments] AS COL13, a.[content_state] AS COL14, a.[date_created] AS COL15, a.[default_page_id] AS COL16, a.[draft_culture] AS COL17, a.[email_author] AS COL18, a.[expiration_date] AS COL19, a.[last_modified] AS COL20, a.[last_modified_by] AS COL21, a.[original_content_id] AS COL22, a.[ownr] AS COL23, a.[post_rights] AS COL24, a.[publication_date] AS COL25, a.[source_key] AS COL26, a.[status] AS COL27, a.[vrsion] AS COL28, a.[views_count] AS COL29, a.[visible] AS COL30, a.[votes_count] AS COL31, a.[votes_sum] AS COL32, a.[voa_version] AS COL33 FROM [job_application] a WHERE a.[app_name] = ?                        Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'job_application'.
    Statement(s) could not be prepared.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
       at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
       at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()]
       Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +13
       OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount) +585
       OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam) +364
       Telerik.OpenAccess.RT.ListEnumerator.setCurrent(Int32 _pos) +58
       Telerik.OpenAccess.RT.ListEnumerator.Move(Int32 relative) +107
       Telerik.Web.UI.GridResolveEnumerable.GetCollectionItemType(Boolean noItemsInEnumerator, Type& collectionItemType, Object& collectionFirstObject) +530
       Telerik.Web.UI.GridResolveEnumerable.ParseProperties() +200
       Telerik.Web.UI.GridResolveEnumerable.Initialize() +16
       Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +29
       Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +224
       Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +204
       Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +305
       Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +46
       System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +94
       System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +171
       Telerik.Web.UI.GridTableView.PerformSelect() +206
       Telerik.Web.UI.GridTableView.DataBind() +432
       Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +2361
       Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +254
       System.Web.UI.Control.LoadRecursive() +95
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +732
       System.Web.UI.Control.EnsureChildControls() +182
       System.Web.UI.Control.PreRenderRecursiveInternal() +73
       System.Web.UI.Control.PreRenderRecursiveInternal() +240
       System.Web.UI.Control.PreRenderRecursiveInternal() +240
       System.Web.UI.Control.PreRenderRecursiveInternal() +240
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3914


  17. martani
    martani avatar
    27 posts
    Registered:
    24 Jan 2011
    09 Apr 2011
    Link to this post
    I finally managed to get the Intermediate Jobs module to work. Here's what I changed.

    1. Make sure the path to  VEnhance.exeMono.Cecil.dll and Mono.Cecil.Pdb.dll points to the correct path (..\Telerik\Sitefinity 4.0\Libraries\) in Jobs-Intermediate.csproj

    2. Change the default namespace in the project properties from Jobs to JobsIntermediat

    3. Change [ManagerType("Jobs.JobsManager, Jobs")] in JobApplication.cs (the model) to [ManagerType("JobsIntermediate.JobsManager, JobsIntermediate")]

    4. Change the layoutTemplate in the PublicControls classes to 
    layoutTemplateName = "JobsIntermediate.Resources.Views.JobApplicationUpload.ascx"; instead of "Jobs.Resources.Views.JobApplicationUpload.ascx"

    5. In App.config change <namespace name="Jobs.Model"> to <namespace name="JobsIntermediate.Model">

    I hope this works for you too.
17 posts, 0 answered