Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find constructor warning in logs #4

Open
rangler2 opened this issue Feb 17, 2014 · 7 comments
Open

Could not find constructor warning in logs #4

rangler2 opened this issue Feb 17, 2014 · 7 comments

Comments

@rangler2
Copy link

Hi,

Since using the module I have Lots of these warnings in the Sitecore logs:

ManagedPoolThread #10 15:20:11 WARN Could not find constructor in ReflectionUtil.CreateObject: JCore.SitecoreModules.ImageCropping.Data.Fields.ExtendedImageField. The constructor parameters may not match or it may be an abstract class. Parameter info: Count: 1. Parameter types: Sitecore.Data.Fields.Field

Not sure exactly when they occur but seem to be a lot when installing packaged items. Have you had this in your logs?
Thanks

@jcore
Copy link
Owner

jcore commented Feb 25, 2014

I added a constructor with Field signature which should eliminate the exception. However, I need to look more into the reason why this constructor is required, because none of other custom fields seem to need it.

@rangler2
Copy link
Author

Hi,

This fix seems to cause other errors. For example if you call Item.Links.GetValidLinks() then it throws the following exception:

ManagedPoolThread #19 09:31:33 ERROR Could not update index entry. Action: 'Saved', Item: '{FA745EEE-94B8-4FFC-AFB6-1BDA853ED91E}'
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters)
at Sitecore.Data.Fields.FieldType.GetField(Field field)
at Sitecore.Data.Fields.FieldTypeManager.GetField(Field field, String runtimeValue)
at Sitecore.Links.ItemLinks.AddLinks(Field field, List`1 links, ItemLinkState linkState)
at Sitecore.Links.ItemLinks.GetLinks(ItemLinkState linkState, Boolean allVersions, Boolean includeStandardValuesLinks)
at Sitecore.Search.Crawlers.DatabaseCrawler.GetItemLinks(Item item)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddSpecialFields(Document document, Item item)
at Sitecore.Search.Crawlers.DatabaseCrawler.IndexVersion(Item item, Item latestVersion, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddItem(Item item, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddItem(Item item)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Sitecore.Data.Managers.IndexingProvider.UpdateItem(HistoryEntry entry, Database database)
at Sitecore.Data.Managers.IndexingProvider.UpdateIndex(HistoryEntry entry, Database database)

Nested Exception

Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Sitecore.Kernel
at Sitecore.Web.UI.Sheer.SheerResponse.SetAttribute(String id, String name, String value)
at Sitecore.Web.UI.HtmlControls.Control.set_Class(String value)
at Sitecore.Shell.Applications.ContentEditor.Image..ctor()

This gets called, for this example, when the item is updated in the search index, then this error comes up in the logs...

@kjetilb
Copy link

kjetilb commented May 13, 2014

Hi we face a similar issue using this component on Sitecore 7.2 (rev. 140228)

The issue arises when we publish an item that uses the image cropper module. And we get the following error message in the body of the publishing wizard

Job started: Publish to 'web'|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Sitecore.Web.UI.Sheer.ClientPage..ctor()
at Sitecore.Web.UI.Sheer.SheerResponse.SetAttribute(String id, String name, String value)
at Sitecore.Web.UI.HtmlControls.Control.set_Class(String value)
at Sitecore.Shell.Applications.ContentEditor.Image..ctor()
at JCore.SitecoreModules.ImageCropping.Data.Fields.ExtendedImageField..ctor(Field field) in \JCore.SitecoreModules.ImageCropping\Data\Fields\ExtendedImageField.cs:line 34
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters)
at Sitecore.Data.Fields.FieldType.GetField(Field field)
at Sitecore.Data.Fields.FieldTypeManager.GetField(Field field, String runtimeValue)
at Sitecore.Links.ItemLinks.AddLinks(Field field, List1 links, ItemLinkState linkState) at Sitecore.Links.ItemLinks.GetLinks(ItemLinkState linkState, Boolean allVersions, Boolean includeStandardValuesLinks) at Sitecore.Links.LinkDatabase.UpdateItemVersionReferences(Item item) at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result) at Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters) at Sitecore.Events.Event.RaiseItemSaved(Object sender, ItemSavedEventArgs args) at System.EventHandler1.Invoke(Object sender, TEventArgs e)
at Sitecore.Data.Engines.EngineCommand2.RaiseEvent[TArgs](EventHandler1 handlers, Func2 argsCreator) at Sitecore.Data.Engines.EngineCommand2.Execute()
at Sitecore.Data.Engines.DataEngine.SaveItem(Item item)
at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item)
at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
at Sitecore.Data.Items.EditContext.Dispose()
at Sitecore.Publishing.PublishHelper.CopyToTarget(Item sourceVersion)
at Sitecore.Publishing.PublishHelper.PublishVersionToTarget(Item sourceVersion, Item targetItem, Boolean targetCreated)
at Sitecore.Publishing.Pipelines.PublishItem.PerformAction.ExecuteAction(PublishItemContext context)
at Sitecore.Publishing.Pipelines.PublishItem.PerformAction.Process(PublishItemContext context)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Publishing.Pipelines.PublishItem.PublishItemPipeline.Run(PublishItemContext context)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.Process(PublishContext context)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Publishing.Pipelines.Publish.PublishPipeline.Run(PublishContext context)
at Sitecore.Publishing.Publisher.PublishWithResult()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Jobs.Job.ThreadEntry(Object state)

@dhruska
Copy link

dhruska commented Dec 11, 2014

@rangler2 @jcore @kjetilb Were you ever able to reach a resolution for this issue? I'm having the exact same issue on another project and creating the alternate constructor results in numerous NullReferenceExceptions as it did for you.

@mihaela-radu
Copy link

Hello,

I work in @rangler2's development team, we still have no solution for this.
This warning is flooding the logs for one of our production websites, did anyone find a fix for it (without causing bigger issues)?

Thanks
M.

@mklimmasch
Copy link

Hi @mihaela-radu ,

I could not reproduce this in Sitecore 8.1, but could you maybe try to add the field to the fieldTypes configuration and see if that fixes the Exceptions?

Greetz,
Markus

@marcelgruber
Copy link

Try this patch

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
	<sitecore>
		<fieldTypes>
			<!-- Register field so that image references will appear in the link database. -->
			<fieldType name="Advance Image" type="SitecoreFramework.Fields.Fields.AdvanceImageField,SitecoreFramework.Fields" />
		</fieldTypes>
	</sitecore>
</configuration>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants