Monday, August 01, 2011
Web Forms File Upload: 2 Exceptions [Common Errors]
Monday, September 27, 2010
Image Field in Page Editor [Common Errors]
This issue is related to the latest *6.2 rev.100831 (Update-4)* only.
You may be getting the following error when launching Page Editor on a page with an image field rendered via <sc:image /> Web or XSL Control:
at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
at Sitecore.Resources.Media.MediaProvider.GetMediaUrl(MediaItem item, MediaUrlOptions options)
at Sitecore.Xml.Xsl.ImageRenderer.GetSource()
at Sitecore.Xml.Xsl.ImageRenderer.Render()
at Sitecore.Pipelines.RenderField.GetImageFieldValue.Process(RenderFieldArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Web.UI.WebControls.FieldRenderer.RenderField()
at Sitecore.Xml.Xsl.XslHelper.image(String fieldName, XPathNodeIterator iterator, String parameters)
While our team is working on an official document about, here is a quick 3 step solution:
1. Create a custom ImageRenderer class:
using System;using Sitecore.Data.Fields;namespace SitecoreSupport.Shell{public class ImageRenderer : Sitecore.Xml.Xsl.ImageRenderer{protected override string GetSource(){var innerField = Item.Fields[FieldName];var imageField = new ImageField(innerField, FieldValue);ParseField(imageField);if (imageField.MediaItem != null){return base.GetSource();}return String.Empty;}}}
2. Create a custom implementation of GetImageFieldValue processor in the renderField pipeline:
namespace SitecoreSupport.Shell{public class GetImageFieldValue : Sitecore.Pipelines.RenderField.GetImageFieldValue{protected override Sitecore.Xml.Xsl.ImageRenderer CreateRenderer(){return new ImageRenderer();}}}
3. Create a .config file with the following content and place it under /App_Config/Include:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"><sitecore><pipelines><renderField><processor type="Sitecore.Pipelines.RenderField.GetImageFieldValue, Sitecore.Kernel"><patch:attribute name="type">SitecoreSupport.Shell.GetImageFieldValue, SitecoreSupport.Shell</patch:attribute></processor></renderField></pipelines></sitecore></configuration>
Friday, September 10, 2010
Campaign Summary report is throwing exception [Common Errors]
A quick post today in the Common Errors category. You may be getting the following exception when trying to run Summary report on your Campaign:
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] Stimulsoft.Report.StiReport.GetReferencedAssemblies() +1179 ...
To resolve this, you need a reference to Sitecore.Oracle.dll within the source of Campaign Summary report.
1. Open the following file: \sitecore\shell\Applications\Analytics\Reports\Campaigns\Summary.mrt
2. Add the following to the <ReferencedAssemblies /> section:
That’s all!
Wednesday, September 01, 2010
Exception in alarm clock event subscriber [Common Errors]
Greetings! As you are going into production, hopefully you allocate a few days for exception sweep up. This is applicable to any website running on Sitecore CMS or any platform, really.
One of the common exceptions that I see in customer’s log files these days is related to “alarm clock” event subscriber and can be encountered quite frequently.
Here is the error stack trace that you may be seeing in your logs:
ERROR Exception in alarm clock event subscriber.
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties)
at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Pipelines.CorePipelineFactory.GetObjectFromType(String type, XmlNode processorNode)
at Sitecore.Pipelines.CoreProcessor.GetMethod(Object[] parameters)
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Services.AlarmClock.Heartbeat_Beat(Object sender, EventArgs e)
Nested Exception
Exception: System.InvalidOperationException
Message: Category does not exist.
Source: System
at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName)
at Sitecore.Diagnostics.PerformanceCounters.PerformanceCounter.GetInstanceName()
at Sitecore.Pipelines.HealthMonitor.HealthMonitor.AddCounter(XmlNode configNode)
================================
After a quick research in our knowledge base, I’ve discovered an answer. Apparently, this has been addressed in Sitecore CMS 6.2.0 rev.100104 (Also known as 6.2.0 Update-1).
For 6.0/6.1 instances, you can comment out the following part of your web.config file as a temporary workaround:
<processor type="Sitecore.Pipelines.HealthMonitor.HealthMonitor, Sitecore.Kernel" method="LogCounterStatus"><counters hint="raw:AddCounter"><!-- <counter category="Process" name="Private Bytes" /><counter category="Process" name="Virtual Bytes" /><counter category="Process" name="Page File Bytes" /><counter category=".net CLR Memory" name="# Bytes in all Heaps" /><counter category=".net CLR Memory" name="% Time in GC" /><counter category=".net CLR Memory" name="Large Object Heap size" /><counter category=".net CLR Loading" name="Bytes in Loader Heap" /><counter category=".net CLR Loading" name="Current Assemblies" />--></counters></processor>
If you are still on 6.0 or 6.1, start thinking about upgrading. It is especially easy to do it from 6.1! Check the official steps here.