Updated Catel from 5.12.4 to 5.12.15: runtime error on every EventToCommand line inViews - catel

After updating Catel from 5.12.4 to 5.12.15 every view with xaml parts like this:
<i:Interaction.Triggers>
<i:EventTrigger EventName="...">
<catel:EventToCommand Command="..." />
</i:EventTrigger>
</i:Interaction.Triggers>
causes runtime error:
An instance of type "EventToCommand" cannot be added to a collection of type "TriggerActionCollection". Only items of type 'T' are allowed.

This is caused by the change to move to the (actively maintained) Microsoft.Xaml.Behaviors package. Please use the correct package moving forward and all should be good.

Related

Promotion Not Opening from HMC: de.hybris.platform.jalo.JaloSystemException: Cannot create Jalo instance for item

When I try to open promotions on HMC it throw this error,
first Couldn't understand problem and cause of problem?
Try to clear cookies, login/logout, restart browser as well -looks nothing works. (check this link for more detail, can't find anything
https://answers.sap.com/questions/12761785/promotion-not-opening-from-hmc.html )
Try to check this: ( https://answers.sap.com/questions/12750795/cannot-create-jalo-instance-for-item-due-to-null-d.html?childToView=12798465#answer-12798465 ) clearing orphan type helps sometime.
If any one can guide how to solve this issue and explain cause of this issue.
Promotion Not Opening from HMC: Unhandled Exception:
de.hybris.platform.jalo.JaloSystemException: Cannot create Jalo
instance for item 000000 due to null
JaloSystemException is the mother of all Runtime exceptions in Hybris. So, the exception alone is not very informative.
The following comment i.e.
Cannot create Jalo instance for item
suggests that Hybris is trying to create an instance of a custom type, the definition of which (in items.xml) does not exist anymore. Either the definitions were removed manually or they were lost during system migration.
Ideally, deleting orphans should resolve this.
If you are still getting the error after removing the orphan types then -
Either there is some legacy code that is trying to create an instance of the custom types, most probably through a factory, otherwise, it would have given a compilation error during build itself.
The deleted custom type had a relation with the existing types, probably with the Promotion.
The ultimate solution is to run initialize on your local.
**Be very careful while running initialize as it will remove all the data from your system.

Hybris: Error on initiating the workflow on removing print extension - unexpected validator error: cannot find spring bean

Not sure where to check it. No dependencies are found in xml files. I don't find constraints related to this.
INFO | jvm 1 | main | 2017/03/14 11:10:30.867 | ESC[mESC[0;33m2017-03-14 11:10:30 WARN [Thread-17] [10.0.12.6] [EditorArea] Cound not update item, reason: [com.sbs.ecomm.hybris.sbproductcockpit.workflow.SBProductWor‌​kflowCreationInterce‌​ptor#5d47afd3]: unexpected validator error: cannot find spring bean [workflowAssignedJobAttributeHandler] configured for dynamic attribute [Workflow.assignedJob] from extension [print]
The dynamic attribute handler was initially defined in the print extension.
When the system was initialized the type system therefore got the attribute assignedJob stored in the database.
Now you removed the extension and the code for this dynamic attribute. That's why you get the error at runtime, because the type system in the database still has this attribute registered and tries to load the value using the dynamic attribute handler (for which the code is no longer present).
You can manually remove the assignedJob attribute through the hmc/backoffice in the type management section as far as I know (for sure thats possible in the hmc).
If an extension has been removed (that has previously been present) the typesystem in the database is not automatically removed.
You might also take a look at the orphaned types in the hac. All types of the print extension should show up there now as they are in the database but no longer present in the code/platform.
(Just remembered that I answered a similar problem for missing attributes here: https://stackoverflow.com/a/32824789/932201 .. that contains the steps how to remove an attribute)
Hope this helps!
In your class SBProductWor‌​kflowCreationInterce‌​ptor you probably save a Workflow model. This model has an handler and both are defined in the print extension.
You can't remove the print extension without removing the dependancies in your custom classes.

Binding to current source ("{Binding .}") in WinRT

In WPF, if I want to reference the whole object (not a specific property) in a binding, I can write any of the following:
{Binding Path=.}
{Binding .}
{Binding}
Like so:
<ItemsControl ItemsSource="{Binding Widgets}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<controls:WidgetControl Widget="{Binding}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
However in WinRT I have not been able to get this to work:
<GridView ItemsSource="{Binding Source={StaticResource Widgets}}">
<GridView.ItemTemplate>
<DataTemplate>
<controls:WidgetControl Widget="{Binding}"/>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
It fails with a very vague exception:
The text associated with this error code could not be found.
Failed to assign to property 'XX.WidgetControl.Widget'. [Line: XX Position: XX]
The ItemsSource binding works because the DataContext of each controls:WidgetControl gets set to a Widget. And I know the obvious answer to this is just to wait for the DataContext to be set and cast that to a Widget inside my widget control. But I'm asking on principle: Why doesn't self-binding work in WinRT... or is there a notation to make it work?
So it turns out {Binding} works just great. I had wrongly set the DataContext in my WidgetControl, causing the binding to fail and leading me to believe the WinRT binding mechanism was at fault.
To be clear, {Binding .} still doesn't work like it does in WPF as best as I can tell. It interprets the dot as a literal property name instead of a reference to self:
Error: BindingExpression path error: '.' property not found on 'Widget'. BindingExpression: Path='.' DataItem='Widget'
But my actual problem was trying to change the DataContext at the root level of my WidgetControl, causing any external bindings to fail. Because I defined my control as <UserControl x:Name='controlRoot' DataContext="{Binding ElementName=controlRoot}, the binding in <controls:WidgetControl Widget="{Binding}"/> was referencing the WidgetControl itself and not the Widget I was trying to pass in. And the "failed to assign to property" exception was thrown by a property changed handler that was expecting a Widget, not a WidgetControl.
So you can absolutely use {Binding} to reference the DataContext of the thing the binding is on, just don't try to set the path to ".".

VS2012 error every time I start. Message is not helpful - any suggestions?

WHen I start VS2012 I always get an exception tellng me to look at ActivityLog.xml. Here is what I see- useless to me. Hoping someone else has seen this before.
Also - VS2012 eats 100% of the CPU on the machine at time. Hoping the two are related and fixable.
System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) The current type, SquaredInfinity.Foundation.Configuration.Services.IConfigurationService, is an interface and cannot be constructed. Are you missing a type mapping?
Resulting in: Resolution of the dependency failed, type = "SquaredInfinity.Foundation.Configuration.Services.IConfigurationService", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The current type, SquaredInfinity.Foundation.Configuration.Services.IConfigurationService, is an interface and cannot be constructed. Are you missing a type mapping?
-----------------------------------------------
At the time of the exception, the container was:
Resolving SquaredInfinity.Foundation.Configuration.Services.IConfigurationService,(none)
Resulting in: An exception occurred while trying to create an instance of type &apos;#Btb.#Rtb&apos;.
Resulting in: Cannot activate part &apos;#Btb.#Rtb&apos;.
Element: #Btb.#Rtb --> #Btb.#Rtb
Resulting in: Cannot get export &apos;#Btb.#Rtb (ContractName="Microsoft.VisualStudio.Text.Classification.IClassifierProvider")&apos; from part &apos;#Btb.#Rtb&apos;.
Element: #Btb.#Rtb (ContractName="Microsoft.VisualStudio.Text.Classification.IClassifierProvider") --> #Btb.#Rtb
at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export)
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass42.<CreateStronglyTypedLazyOfTM>b__1()
at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value()
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeMatchingFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable1 lazyFactories, Func2 getter, IContentType dataContentType, Object errorSource)
Is your VSCommands extension up to date?
There was a compatibility issue which could produce similar stack trace, and it was fixed in latest release.

Bean Autowiring problem

I am starter in mutithreading. I am trying to index my data into solr.For that I was writing the following code
I am getting null pointer exception in the line highlighted
You need to add the following:
<context:annotation-config/>
You need to set the path for autowiring package scan and in your case it will be:
<context:component-scan base-package="a.b.c" />
After it you need to mark the class as candidate for autowiring:
#Component("indexTask")
#Scope("prototype")
IndexTask implements Callable<IndexObject>
{
//ommited
}
Next you can remove indexTask bean configuration from xml file. your package will be created automatically.
Hope it helps.
Autowiring doesn't happen automatically, you need to configure it. See the Spring docs for detail, but essentially you need to add
<context:annotation-config/>

Resources