Error in Jobs Intermediate Module
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
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
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;
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
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
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:
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
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 (www.sitefinity.com/.../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
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
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.
I take it back - this error showed back up after I resolved the localization issue.
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
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
>
var query = SitefinityQuery.Get<JobsModel>(
this
,MethodBase.GetCurrentMethod())<br> .Where(b => b.ApplicationName == appName);
Any help for Suzanne? I have the same issue (...extnt...) when I create my first module :(
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=""$(LibrariesDir)VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" -signAssembly "-keyFile:$(ProjectDir)$(AssemblyOriginatorKeyFile)" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'!=''" />
<Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command=""$(LibrariesDir)VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'==''" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(IntermediateOutputPath)" />
<Copy SourceFiles="$(PdbFile)" DestinationFolder="$(IntermediateOutputPath)" ContinueOnError="true" />
</Target>
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
>
Invalid object name 'job_application'.
Statement(s) could not be prepared.
[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
I finally managed to get the Intermediate Jobs module to work. Here's what I changed.
1. Make sure the path to VEnhance.exe, Mono.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.