#270 Critical failure from IKVM in Visual Studio WPF project

v1.0 (example)
closed-wont-fix
nobody
None
5
49 minutes ago
2013-01-10
Marcin Wisnicki
No

I have two dlls (jetty and vaadin) produced by `ikvmc -target:library -classloader:ikvm.runtime.AppDomainAssemblyClassLoader` referenced from WPF projects.

Sometimes when opening project this error dialog keeps popping up:

---------------------------
IKVM.NET 7.2.4630.5 Critical Failure
---------------------------
****** Critical Failure:
Type "javax.lang.model.SourceVersion" and "javax.lang.model.SourceVersion" both map to the same name "javax.lang.model.SourceVersion".
******
PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE
(on Windows you can use Ctrl+C to copy the contents of this message to the clipboard)
at IKVM.Internal.JVM.CriticalFailure(String message, Exception x)
at IKVM.Internal.AssemblyClassLoader.GetWrapperFromAssemblyType(Type type)
at IKVM.Internal.BootstrapClassLoader.GetWrapperFromAssemblyType(Type type)
at IKVM.Internal.ClassLoaderWrapper.GetWrapperFromType(Type type)
at IKVM.NativeCode.java.lang.Class.forName0(String name, Boolean initialize, ClassLoader loader)
at java.lang.Class.forName(String name, Boolean initialize, ClassLoader loader, CallerID )
at ikvm.internal.AnnotationAttributeBase.classFromSig(ClassLoader , String )
at ikvm.internal.AnnotationAttributeBase.decodeElementValue(Object obj, Class type, ClassLoader loader)
at ikvm.internal.AnnotationAttributeBase.decodeValues(HashMap , Class , ClassLoader , Object[] )
at ikvm.internal.AnnotationAttributeBase.setDefinition(Object[] array)
at javax.annotation.processing.SupportedSourceVersionAttribute..ctor(Object[] )
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Boolean inherit)
at Microsoft.Expression.DesignModel.Metadata.AttributeDataCache.GetClrAttributes(MemberInfo member)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.<MergeAttributesIterator>d__0.MoveNext()
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttributes(MemberInfo memberInfo, Type attributeType, Boolean inherit, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttributes(Type type, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.MetadataStore.GetTypeConverter(Type type)
at Microsoft.Expression.DesignModel.Metadata.PlatformMetadataBase.GetTypeConverter(MemberInfo memberInfo)
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.get_TypeConverter()
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.Refresh(Type hintType)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.ComputeInvalidatedAssemblies(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectMetadata.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectAssemblyCollection.FireChangedEvent(NotifyCollectionChangedEventArgs eventArguments)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectAssemblyCollection.AssemblyCollection_EnumerationChanged(Object sender, EnumerationChangedEventArgs`1 e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Microsoft.Expression.Utility.Collections.NotifyingCollectionBase`1.EventInvoker(EnumerationChangedEventArgs`1 eventArguments)
at Microsoft.Expression.Utility.Events.SuspendingEventManager`1.ForwardEvents()
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose(Boolean disposing)
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose()
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.AssemblyNotificationHandler.<.ctor>b__44()
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose(Boolean disposing)
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose()
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateImplicitReferencesInternal(Boolean ensureMetadataLoaded)
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateImplicitReferences()
at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.<AddImplicitAssemblyReference>b__4()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.SafeNativeMethods.MessageBox(HandleRef hWnd, String text, String caption, Int32 type)
at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(String text, String caption)
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.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at IKVM.Internal.JVM.CriticalFailure(String message, Exception x)
at IKVM.Internal.AssemblyClassLoader.GetWrapperFromAssemblyType(Type type)
at IKVM.Internal.BootstrapClassLoader.GetWrapperFromAssemblyType(Type type)
at IKVM.Internal.ClassLoaderWrapper.GetWrapperFromType(Type type)
at IKVM.NativeCode.java.lang.Class.forName0(String name, Boolean initialize, ClassLoader loader)
at java.lang.Class.forName(String name, Boolean initialize, ClassLoader loader, CallerID )
at ikvm.internal.AnnotationAttributeBase.classFromSig(ClassLoader , String )
at ikvm.internal.AnnotationAttributeBase.decodeElementValue(Object obj, Class type, ClassLoader loader)
at ikvm.internal.AnnotationAttributeBase.decodeValues(HashMap , Class , ClassLoader , Object[] )
at ikvm.internal.AnnotationAttributeBase.setDefinition(Object[] array)
at javax.annotation.processing.SupportedSourceVersionAttribute..ctor(Object[] )
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Boolean inherit)
at Microsoft.Expression.DesignModel.Metadata.AttributeDataCache.GetClrAttributes(MemberInfo member)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.<MergeAttributesIterator>d__0.MoveNext()
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttributes(MemberInfo memberInfo, Type attributeType, Boolean inherit, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttributes(Type type, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttribute[T](Type type, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.PlatformMetadataBase.GetNameProperty(ITypeResolver typeResolver, Type type)
at Microsoft.Expression.DesignModel.Metadata.ClrObjectMetadata.<.ctor>b__0()
at Microsoft.Expression.DesignModel.Metadata.DelayedInstance`1.get_Value()
at Microsoft.Expression.DesignModel.Metadata.ClrObjectMetadata.Microsoft.Expression.DesignModel.Metadata.ITypeMetadata.get_NameProperty()
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.Cache()
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.Refresh(Type hintType)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.ComputeInvalidatedAssemblies(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectMetadata.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectAssemblyCollection.FireChangedEvent(NotifyCollectionChangedEventArgs eventArguments)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectAssemblyCollection.AssemblyCollection_EnumerationChanged(Object sender, EnumerationChangedEventArgs`1 e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Microsoft.Expression.Utility.Collections.NotifyingCollectionBase`1.EventInvoker(EnumerationChangedEventArgs`1 eventArguments)
at Microsoft.Expression.Utility.Events.SuspendingEventManager`1.ForwardEvents()
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose(Boolean disposing)
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose()
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.AssemblyNotificationHandler.<.ctor>b__44()
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose(Boolean disposing)
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose()
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateImplicitReferencesInternal(Boolean ensureMetadataLoaded)
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateImplicitReferences()
at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.<AddImplicitAssemblyReference>b__4()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.SafeNativeMethods.MessageBox(HandleRef hWnd, String text, String caption, Int32 type)
at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(String text, String caption)
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.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at IKVM.Internal.JVM.CriticalFailure(String message, Exception x)
at IKVM.Internal.AssemblyClassLoader.GetWrapperFromAssemblyType(Type type)
at IKVM.Internal.BootstrapClassLoader.GetWrapperFromAssemblyType(Type type)
at IKVM.Internal.ClassLoaderWrapper.GetWrapperFromType(Type type)
at IKVM.NativeCode.java.lang.Class.forName0(String name, Boolean initialize, ClassLoader loader)
at java.lang.Class.forName(String name, Boolean initialize, ClassLoader loader, CallerID )
at ikvm.internal.AnnotationAttributeBase.classFromSig(ClassLoader , String )
at ikvm.internal.AnnotationAttributeBase.decodeElementValue(Object obj, Class type, ClassLoader loader)
at ikvm.internal.AnnotationAttributeBase.decodeValues(HashMap , Class , ClassLoader , Object[] )
at ikvm.internal.AnnotationAttributeBase.setDefinition(Object[] array)
at javax.annotation.processing.SupportedSourceVersionAttribute..ctor(Object[] )
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Boolean inherit)
at Microsoft.Expression.DesignModel.Metadata.AttributeDataCache.GetClrAttributes(MemberInfo member)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.<MergeAttributesIterator>d__0.MoveNext()
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttributes(MemberInfo memberInfo, Type attributeType, Boolean inherit, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttributes(Type type, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.MetadataStore.GetTypeConverter(Type type)
at Microsoft.Expression.DesignModel.Metadata.PlatformMetadataBase.GetTypeConverter(MemberInfo memberInfo)
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.get_TypeConverter()
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.Refresh(Type hintType)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.ComputeInvalidatedAssemblies(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectMetadata.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectAssemblyCollection.FireChangedEvent(NotifyCollectionChangedEventArgs eventArguments)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectAssemblyCollection.AssemblyCollection_EnumerationChanged(Object sender, EnumerationChangedEventArgs`1 e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Microsoft.Expression.Utility.Collections.NotifyingCollectionBase`1.EventInvoker(EnumerationChangedEventArgs`1 eventArguments)
at Microsoft.Expression.Utility.Events.SuspendingEventManager`1.ForwardEvents()
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose(Boolean disposing)
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose()
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.AssemblyNotificationHandler.<.ctor>b__44()
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose(Boolean disposing)
at Microsoft.Expression.Utility.Events.Suspender.SuspendDisposer.Dispose()
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateImplicitReferencesInternal(Boolean ensureMetadataLoaded)
at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateImplicitReferences()
at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.<AddImplicitAssemblyReference>b__4()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.SafeNativeMethods.MessageBox(HandleRef hWnd, String text, String caption, Int32 type)
at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(String text, String caption)
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.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at IKVM.Internal.JVM.CriticalFailure(String message, Exception x)
at IKVM.Internal.AssemblyClassLoader.GetWrapperFromAssemblyType(Type type)
at IKVM.Internal.BootstrapClassLoader.GetWrapperFromAssemblyType(Type type)
at IKVM.Internal.ClassLoaderWrapper.GetWrapperFromType(Type type)
at IKVM.NativeCode.java.lang.Class.forName0(String name, Boolean initialize, ClassLoader loader)
at java.lang.Class.forName(String name, Boolean initialize, ClassLoader loader, CallerID )
at ikvm.internal.AnnotationAttributeBase.classFromSig(ClassLoader , String )
at ikvm.internal.AnnotationAttributeBase.decodeElementValue(Object obj, Class type, ClassLoader loader)
at ikvm.internal.AnnotationAttributeBase.decodeValues(HashMap , Class , ClassLoader , Object[] )
at ikvm.internal.AnnotationAttributeBase.setDefinition(Object[] array)
at javax.annotation.processing.SupportedSourceVersionAttribute..ctor(Object[] )
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Boolean inherit)
at Microsoft.Expression.DesignModel.Metadata.AttributeDataCache.GetClrAttributes(MemberInfo member)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.<MergeAttributesIterator>d__0.MoveNext()
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttributes(MemberInfo memberInfo, Type attributeType, Boolean inherit, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttributes(Type type, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.TypeUtilities.GetAttribute[T](Type type, IPlatformMetadata platformMetadata)
at Microsoft.Expression.DesignModel.Metadata.PlatformMetadataBase.GetNameProperty(ITypeResolver typeResolver, Type type)
at Microsoft.Expression.DesignModel.Metadata.ClrObjectMetadata.<.ctor>b__0()
at Microsoft.Expression.DesignModel.Metadata.DelayedInstance`1.get_Value()
at Microsoft.Expression.DesignModel.Metadata.ClrObjectMetadata.Microsoft.Expression.DesignModel.Metadata.ITypeMetadata.get_NameProperty()
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.Cache()
at Microsoft.Expression.DesignModel.Metadata.ProjectContextType.Initialize(IXmlNamespace xmlNamespace, Type type)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.GetType(String key, IAssembly assembly, Type type)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.GetType(Type type)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectMetadata.GetType(Type type)
at Microsoft.Expression.DesignModel.Metadata.TypeResolver.<GetTypes>d__1.MoveNext()
at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.Expression.Markup.Semantics.Metadata.AssemblyNode.BuildNamespaces(SymbolTable`1 newNamespaces)
at Microsoft.Expression.Markup.Semantics.Metadata.AssemblyNode.BuildNamespaces()
at Microsoft.Expression.Markup.Semantics.Metadata.ReflectionProjectNode.BuildGlobalTable()
at Microsoft.Expression.Markup.Semantics.Metadata.ReflectionProjectNode.FindTypeByDottedName(String dottedName)
at Microsoft.Expression.Markup.Semantics.Metadata.HostedProjectNode.FindType(String name)
at Microsoft.Expression.Markup.Semantics.Metadata.HostedType.get_BaseTypeInternal()
at Microsoft.Expression.Markup.Semantics.Metadata.HostedType.get_BaseType()
at Microsoft.Expression.Markup.Semantics.Metadata.HostedType.get_ContentProperty()
at Microsoft.Expression.Markup.Semantics.XmlElement.CalcChildWhitespaceImportant(XamlElement element)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XamlFileContext.EnsureState(XamlPrepareOptions options, Int64 time, Boolean useRqTypes)
at Microsoft.Expression.Markup.Semantics.XamlFileContext.Microsoft.Expression.Markup.Semantics.IXamlFileInformationContext.Update(Int64 version, XamlPrepareOptions prepareOptions)
at Microsoft.Expression.DesignSurface.DesignerLanguageContext.Microsoft.Expression.DesignHost.IDesignerLanguageContext.Update(Int64 time, UpdatePrepareOptions prepareOptions)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerLanguageContext.<>c__DisplayClass1c.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerLanguageContext.Update>b__1b()
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.Invoke(Boolean waitingInExternalCall)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.InvokeCall(Call call)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessQueue(CallQueue queue)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessInboundQueue(Int32 identity)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessMessage(Int32 msg, IntPtr wParam, Boolean elevatedQuery, Boolean& handled)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.OnWindowMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at Microsoft.Expression.DesignHost.Isolation.Remoting.MessageOnlyHwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.RunApplication()
at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.<>c__DisplayClass2.<Main>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
---------------------------
OK
---------------------------

Discussion

  • Forgot to mention that this is Visual Studio 2012 Update 1.

     
  • It actually happens when I open WPF designer for the first time (which scans all assemblies and triggers this error).

     
  • Can you please attach a VS solution that reproduces the problem?

     
  • This is a huge solution which I can't share. Unfortunately my attempts to reproduce it within minimal project were so far unsuccessful. I will keep trying though.

     
  • Minimal example program exhibiting problem

     
    Attachments
  • So the problem seems to be that Xaml Designer does copies of all assemblies into randomly named locations then loads and analyzes them using reflection, all of this in primary appdomain.

    This will result in multiple copies of OpenJDK assemblies loaded from different paths and apparently Class.fromName() has a problem with that.

    Additionally, WPF does some special hooking of WndProc and invoking MessageBox.Show at this point breaks WPF and hangs Visual Studio. A workaround/solution is to call MessageBox from new thread.

     
  • Are you using ikvm.runtime.AppDomainAssemblyClassLoader anywhere in your solution?

     
  • Yes, both Vaadin.dll and Jetty.dll are compiled with AppDomainAssemblyClassLoader. I couldn't get it to work any other way :(

     
  • I will investigate if I can fix AppDomainAssemblyClassLoader to ignore duplicate assemblies, but don't get your hopes up as this is notoriously weak area of .NET.

     
  • Better example

     
    Attachments
  • Thanks, but wouldn't that result in returning wrong Class instance ?

    I have uploaded better example that fails in exact same way as VS and have couple of questions:

    1. Why there are no classloaders for IKVM.OpenJDK.Misc ?
    2. What's the default classloading strategy for such assemblies ?
    3. Why does it fail ? Assuming that types are first searched in same assembly then maybe referenced assemblies and given that all types involved in uploaded example exist in same Assembly (IKVM.OpenJDK.Misc) shouldn't it just work ? Is is perhaps caused by the fact that these types lack classloader ?

     
  • Thanks for the smaller repro, but I had already reproduced the problem.

    To answer your questions:
    1) Because that's the way Java works. Classes in the boot classpath have a null class loader.
    2) The runtime knows about them.
    3) It fails because the .NET runtime is broken essentially. If you load the same assembly twice things turn ugly pretty quickly.

    This fundamental issue is unfixable, because this really is a .NET runtime problem.

    However, I can probably avoid the problem in your scenario by making the custom attributes lazy. By not decoding them while they are constructed the problem is probably avoid since I assume that the WPF designer isn't really interested in them and not going to query any properties.

     
  • I forgot to mention that the WPF is completely broken too. Its behavior is completely unacceptable.

     
  • I meant the WPF designer.

    Also, as you found with your repro, the problem is not related to AppDomainAssemblyClassLoader, but instead to loading the same assembly multiple times.

     
  • Thank you for looking into this.
    Using example code I previously attached, it fails at getAssemblyClassLoader(asm2) with:

    Non-reciprocal main assembly relation: IKVM.OpenJDK.Misc, Version=7.4.4833.0, Culture=neutral, PublicKeyToken=null -> IKVM.OpenJDK.Core, Version=7.4.4833.0, Culture=neutral, PublicKeyToken=null

    If I comment it out, it will finish without errors and even return types from correct assemblies.

    I don't know how it behaves in WPF designer since it is rather hard to reproduce and after I did some rearrangements in my solution it no longer triggers this error or at least didn't so far. I do have many other problems caused by this unhelpful behavior of designer :(

    I wouldn't really call .NET's ability to load same type multiple times to be broken. It's essential to support multiple versions of libraries and really not that different than Java where types are scoped to classloaders just like .NET types are scoped to Assemblies except there is no control over delegation.

    Essentially assemblies are classloaders with delegation fixed to referenced assemblies.

    I don't really see why IKVM must fail here - there is no ambiguity on which type to load, you just have to try owning assembly (accessible via java.lang.Class.type.Assembly) and follow assembly references.

    PS. That Exit(666) is rather evil, throwing an exception would be nicer IMO.
    PPS. Are you going to upload nugets of newer snapshots ?

     
  • With all due respected, I think I know a little bit more about .NET and Java, so trust me when I say that load contexts are broken in .NET.

     
    • status: open --> closed-wont-fix
     
  • I don't doubt that, given your vast experience there are probably few people as qualified to comment on internals of .NET AND Java as you but is my analysis incorrect ?
    Is there really some unresolvable ambiguity that I'm not seeing ?

     
    • status: closed-wont-fix --> open
     
    • status: open --> closed-wont-fix
    • Group: --> v1.0 (example)