I am quite new to robotframework.
I am trying to test a JavaFX application using eficode/JavaFXLibrary (https://github.com/eficode/JavaFXLibrary). As per their (spec) I have downloaded the jar and have executed it.
Remote server started as shown
I also added the below in the .robot file
*** Settings ***
Library Remote http://192.168.1.66:8270 WITH NAME JavaFXLibrary
When I execute my robot file I see the below errors.
error
Below is the full trace
12:44:17.305 [qtp1995619265-42] ERROR org.apache.xmlrpc.server.XmlRpcErrorLogger - No such handler: get_library_information org.apache.xmlrpc.server.XmlRpcNoSuchHandlerException: No such handler: get_library_information
at org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.getHandler(AbstractReflectiveHandlerMapping.java:214) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:45) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:112) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:196) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.remoteserver.servlet.RemoteServerServlet.doPost(RemoteServerServlet.java:122) ~[javafxlibrary-0.7.1.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.remoteserver.servlet.RemoteServerServlet.service(RemoteServerServlet.java:102) ~[javafxlibrary-0.7.1.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:547) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.Server.handle(Server.java:500) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547) [javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375) [javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270) [javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) [javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) [javafxlibrary-0.7.1.jar:?]
at java.lang.Thread.run(Thread.java:1589) [?:?] 12:44:17.336 [qtp1995619265-36]
ERROR org.apache.xmlrpc.server.XmlRpcErrorLogger - Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException org.apache.xmlrpc.common.XmlRpcInvocationException: Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:129) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:106) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:112) ~[javafxlibrary-0.7.1.jar:?]
at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:196) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.remoteserver.servlet.RemoteServerServlet.doPost(RemoteServerServlet.java:122) ~[javafxlibrary-0.7.1.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.remoteserver.servlet.RemoteServerServlet.service(RemoteServerServlet.java:102) ~[javafxlibrary-0.7.1.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:547) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.Server.handle(Server.java:500) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:135) ~[javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) [javafxlibrary-0.7.1.jar:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) [javafxlibrary-0.7.1.jar:?]
at java.lang.Thread.run(Thread.java:1589) [?:?]
Caused by: java.lang.RuntimeException: java.lang.RuntimeException
at org.robotframework.remoteserver.servlet.ServerMethods.get_keyword_names(ServerMethods.java:60) ~[javafxlibrary-0.7.1.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115) ~[javafxlibrary-0.7.1.jar:?]
... 35 more
Caused by: java.lang.RuntimeException
at org.robotframework.remoteserver.library.DynamicApiRemoteLibrary.getKeywordNames(DynamicApiRemoteLibrary.java:54) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.remoteserver.servlet.ServerMethods.get_keyword_names(ServerMethods.java:53) ~[javafxlibrary-0.7.1.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115) ~[javafxlibrary-0.7.1.jar:?]
... 35 more
Caused by: java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.robotframework.remoteserver.library.DynamicApiRemoteLibrary.getKeywordNames(DynamicApiRemoteLibrary.java:47) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.remoteserver.servlet.ServerMethods.get_keyword_names(ServerMethods.java:53) ~[javafxlibrary-0.7.1.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115) ~[javafxlibrary-0.7.1.jar:?]
... 35 more
Caused by: java.lang.NoClassDefFoundError: javafx/scene/Node
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:?]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:3429) ~[?:?]
at java.lang.Class.getConstructor0(Class.java:3634) ~[?:?]
at java.lang.Class.getConstructor(Class.java:2324) ~[?:?]
at org.robotframework.javalib.beans.common.BasicKeywordFilter$HasDefaultConstructor.check(BasicKeywordFilter.java:67) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.common.BasicKeywordFilter.accept(BasicKeywordFilter.java:37) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.addKeyword(KeywordBeanLoader.java:122) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.addJarKeywords(KeywordBeanLoader.java:87) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.addURLKeywords(KeywordBeanLoader.java:62) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.loadBeanDefinitions(KeywordBeanLoader.java:52) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.library.AnnotationLibrary.createKeywordFactory(AnnotationLibrary.java:61) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.getKeywordFactory(KeywordFactoryBasedLibrary.java:92) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.getKeywordNames(KeywordFactoryBasedLibrary.java:51) ~[javafxlibrary-0.7.1.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.robotframework.remoteserver.library.DynamicApiRemoteLibrary.getKeywordNames(DynamicApiRemoteLibrary.java:47) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.remoteserver.servlet.ServerMethods.get_keyword_names(ServerMethods.java:53) ~[javafxlibrary-0.7.1.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115) ~[javafxlibrary-0.7.1.jar:?]
... 35 more
Caused by: java.lang.ClassNotFoundException: javafx.scene.Node
at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[?:?]
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:?]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:3429) ~[?:?]
at java.lang.Class.getConstructor0(Class.java:3634) ~[?:?]
at java.lang.Class.getConstructor(Class.java:2324) ~[?:?]
at org.robotframework.javalib.beans.common.BasicKeywordFilter$HasDefaultConstructor.check(BasicKeywordFilter.java:67) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.common.BasicKeywordFilter.accept(BasicKeywordFilter.java:37) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.addKeyword(KeywordBeanLoader.java:122) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.addJarKeywords(KeywordBeanLoader.java:87) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.addURLKeywords(KeywordBeanLoader.java:62) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.loadBeanDefinitions(KeywordBeanLoader.java:52) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.library.AnnotationLibrary.createKeywordFactory(AnnotationLibrary.java:61) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.getKeywordFactory(KeywordFactoryBasedLibrary.java:92) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.getKeywordNames(KeywordFactoryBasedLibrary.java:51) ~[javafxlibrary-0.7.1.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.robotframework.remoteserver.library.DynamicApiRemoteLibrary.getKeywordNames(DynamicApiRemoteLibrary.java:47) ~[javafxlibrary-0.7.1.jar:?]
at org.robotframework.remoteserver.servlet.ServerMethods.get_keyword_names(ServerMethods.java:53) ~[javafxlibrary-0.7.1.jar:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115) ~[javafxlibrary-0.7.1.jar:?]
... 35 more
Problem is I need that library otherwise I cannot run my test cases.
Related
**System.Reflection.TargetInvocationException:** 'Exception has been thrown by the target of an invocation.'
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not resolve type with token 0100004b from typeref (expected class 'Windows.UI.Xaml.IDependencyObjectInternal' in assembly 'Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null')
[mono-rt] at Uno.Material.GlobalStaticResources.get_mergedpages_c69cbc6d79c924ed978294ad194451a9_ResourceDictionary () [0x00000] in /_/src/library/Uno.Material/Uno.UI.SourceGenerators/Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator/mergedpages_c69cbc6d79c924ed978294ad194451a9.cs:5572
[mono-rt] at Uno.Material.GlobalStaticResources+<>c.<RegisterResourceDictionariesBySource>b__21_3 () [0x00000] in /_/src/library/Uno.Material/Uno.UI.SourceGenerators/Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator/GlobalStaticResources.cs:86
[mono-rt] at Uno.UI.ResourceResolver.RetrieveDictionaryForSource (System.String source, System.String currentAbsolutePath) [0x00033] in C:\a\1\s\src\Uno.UI\UI\Xaml\ResourceResolver.cs:395
[mono-rt] at Uno.UI.ResourceResolver.RetrieveDictionaryForSource (System.Uri source) [0x0000e] in C:\a\1\s\src\Uno.UI\UI\Xaml\ResourceResolver.cs:373
[mono-rt] at Windows.UI.Xaml.ResourceDictionary.set_Source (System.Uri value) [0x00008] in C:\a\1\s\src\Uno.UI\UI\Xaml\ResourceDictionary.cs:41
[mono-rt] at Uno.Material.MaterialResources..ctor () [0x00006] in /_/src/library/Uno.Material/MaterialResources.cs:20
[mono-rt] at PKWeb.App.InitializeComponent () [0x000c4] in D:\Code\PubcastX\PKWeb\PKWeb.Droid\obj\Debug\100\g\XamlCodeGenerator\App_b72683a29305e1829dde434ca5f6ae82.g.cs:79
[mono-rt] at PKWeb.App..ctor () [0x00013] in D:\Code\PubcastX\PKWeb\PKWeb.Droid\App.xaml.cs:41
[mono-rt] at PKWeb.Droid.Application+<>c.<.ctor>b__0_0 () [0x00000] in D:\Code\PubcastX\PKWeb\PKWeb.Droid\Main.cs:26
[mono-rt] at Windows.UI.Xaml.NativeApplication..ctor (Windows.UI.Xaml.NativeApplication+AppBuilder appBuilder, System.IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer) [0x00008] in C:\a\1\s\src\Uno.UI\UI\Xaml\NativeApplication.cs:36
[mono-rt] at PKWeb.Droid.Application..ctor (System.IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer) [0x00000] in D:\Code\PubcastX\PKWeb\PKWeb.Droid\Main.cs:26
[mono-rt] at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)
[mono-rt] at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:936
[mono-rt] --- End of inner exception stack trace ---
[mono-rt] at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.1(intptr,intptr)
[mono-rt] at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.1(intptr,intptr)
[libFrameRecord] unloaded from PKWeb.PKWeb
[RefBase] RefBase: Explicit destruction, weak count = 0 (in 0x723994a668)
[RefBase] #00 pc 00000000000ee07c /apex/com.android.runtime/lib64/bionic/libc.so (__cxa_finalize+148)
[RefBase] #01 pc 00000000000e942c /apex/com.android.runtime/lib64/bionic/libc.so (exit+24)
[RefBase] #02 pc 000000000015d32c /data/app/~~F0g8MSuR6MXJTfc9YqKfhw==/PKWeb.PKWeb-ENdkEe8ibO3BuFaUJ96fGA==/lib/arm64/libmonosgen-2.0.so (mono_invoke_unhandled_exception_hook+424)
This happens when I run my application on Android.
BTW.
I am new to Uno. And also new to Windows UWP,WinUI3,etc. I am very confused about assemblies referenced in Uno project.
I get a runtime exception with the stacktrace as below. It seems it doesn't include any information about where it happens in our application code. Any ideas on what might cause this exception? We don't use 'Any' in our application code.
Let me know what else info that could be useful to figure it out.
{
"Exception": {
"Type": "Microsoft.Azure.Documents.Linq.DocumentQueryException",
"Message": "Method 'Any' is not supported., Windows/10.0.14393 documentdb-netcore-sdk/2.1.3",
"StackTrace": "
at Microsoft.Azure.Documents.Linq.ArrayBuiltinFunctions.Visit(MethodCallExpression methodCallExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.BuiltinFunctionVisitor.VisitBuiltinFunctionCall(MethodCallExpression methodCallExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitMethodCallScalar(MethodCallExpression methodCallExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitScalarExpression(Expression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitUnary(UnaryExpression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitScalarExpression(Expression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitBinary(BinaryExpression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitScalarExpression(Expression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitBinary(BinaryExpression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitScalarExpression(Expression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitBinary(BinaryExpression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitScalarExpression(Expression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitBinary(BinaryExpression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitScalarExpression(Expression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitScalarLambda(Expression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitWhere(ReadOnlyCollection`1 arguments, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.VisitMethodCall(MethodCallExpression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.Translate(Expression inputExpression, TranslationContext context)\r\n
at Microsoft.Azure.Documents.Linq.ExpressionToSql.TranslateQuery(Expression inputExpression)\r\n
at Microsoft.Azure.Documents.Linq.SqlTranslator.TranslateQuery(Expression inputExpression)\r\n
at Microsoft.Azure.Documents.Linq.DocumentQueryEvaluator.HandleMethodCallExpression(MethodCallExpression expression)\r\n
at Microsoft.Azure.Documents.Linq.DocumentQueryEvaluator.Evaluate(Expression expression)\r\n
at Microsoft.Azure.Documents.Query.DefaultDocumentQueryExecutionContext.<CreateRequestAsync>d__12.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.Azure.Documents.Query.DefaultDocumentQueryExecutionContext.<ExecuteOnceAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.Azure.Documents.Query.DefaultDocumentQueryExecutionContext.<>c__DisplayClass9_0.<<ExecuteInternalAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<>c__DisplayClass1_0.<<ExecuteAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetryAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at Microsoft.Azure.Documents.ShouldRetryResult.ThrowIfDoneTrying(ExceptionDispatchInfo capturedException)\r\n
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetryAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.Azure.Documents.Query.DefaultDocumentQueryExecutionContext.<ExecuteInternalAsync>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.Azure.Documents.Query.DocumentQueryExecutionContextBase.<ExecuteNextAsync>d__42.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.Azure.Documents.Query.ProxyDocumentQueryExecutionContext.<ExecuteNextAsync>d__15.MoveNext()",
"InnerExceptions": []
}
}
I am trying to use SQLiteCodeFirst with Entity Framework 6.2 and VS2017 15.9.4 to create a simple database.
However the database does not create.
Here is the DbContext
public class HelloDbContext : DbContext
{
public HelloDbContext()
: base("name=ConnectionString")
{
}
public DbSet<Setting> Settings { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
var sqliteConnectionInitializer = new SqliteCreateDatabaseIfNotExists<HelloDbContext>(modelBuilder);
Database.SetInitializer(sqliteConnectionInitializer);
}
}
Here is the data entity class
public class Setting
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public string Value { get; set; }
}
Here is the code that the exception occurs in
using (var ctx = new HelloDbContext())
{
try
{
var obj = new Setting { Name = "blue" };
ctx.Settings.Add(obj);
ctx.SaveChanges();
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
}
Here is app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)"
invariant="System.Data.SQLite.EF6"
description=".NET Framework Data Provider for SQLite (Entity Framework 6)"
type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite"
description=".Net Framework Data Provider for SQLite"
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
<entityFramework>
<providers>
<provider invariantName="System.Data.SQLite.EF6"
type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
<provider invariantName="System.Data.SqlClient"
type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite"
type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=c:\mydb.sqlite" providerName="System.Data.SQLite"/>
</connectionStrings>
</configuration>
Here is the exception
{System.Data.DataException: An exception occurred while initializing the database. See the InnerException for details. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.DbContextTransaction.EnsureOpenConnection()
at System.Data.Entity.DbContextTransaction..ctor(EntityConnection connection)
at System.Data.Entity.Database.BeginTransaction()
at SQLite.CodeFirst.SqliteInitializerBase`1.InitializeDatabase(TContext context)
at SQLite.CodeFirst.SqliteCreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
at System.Data.Entity.DbSet`1.Add(TEntity entity)
at HelloSQLite.Form1.button1_Click(Object sender, EventArgs e) in d:\dev\helloSQLite\HelloSQLite\Form1.cs:line 29}
[System.Data.DataException]: {System.Data.DataException: An exception occurred while initializing the database. See the InnerException for details. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.DbContextTransaction.EnsureOpenConnection()
at System.Data.Entity.DbContextTransaction..ctor(EntityConnection connection)
at System.Data.Entity.Database.BeginTransaction()
at SQLite.CodeFirst.SqliteInitializerBase`1.InitializeDatabase(TContext context)
at SQLite.CodeFirst.SqliteCreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
at System.Data.Entity.DbSet`1.Add(TEntity entity)
at HelloSQLite.Form1.button1_Click(Object sender, EventArgs e) in d:\dev\helloSQLite\HelloSQLite\Form1.cs:line 29}
_className: "System.Data.DataException"
_data: null
_dynamicMethods: null
_exceptionMethod: null
_exceptionMethodString: null
_helpURL: null
_HResult: -2146233087
_innerException: {System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.DbContextTransaction.EnsureOpenConnection()
at System.Data.Entity.DbContextTransaction..ctor(EntityConnection connection)
at System.Data.Entity.Database.BeginTransaction()
at SQLite.CodeFirst.SqliteInitializerBase`1.InitializeDatabase(TContext context)
at SQLite.CodeFirst.SqliteCreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)}
_ipForWatsonBuckets: 18474291
_message: "An exception occurred while initializing the database. See the InnerException for details."
_remoteStackIndex: 0
_remoteStackTraceString: null
_safeSerializationManager: {System.Runtime.Serialization.SafeSerializationManager}
_source: null
_stackTrace: {sbyte[384]}
_stackTraceString: null
_watsonBuckets: null
_xcode: -532462766
_xptrs: 0
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
HResult: -2146233087
InnerException: {System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SQLite.SQLiteException: unable to open database file
at System.Data.SQLite.SQLite3.Open(String strFilename, String vfsName, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
at System.Data.SQLite.SQLiteConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.DbContextTransaction.EnsureOpenConnection()
at System.Data.Entity.DbContextTransaction..ctor(EntityConnection connection)
at System.Data.Entity.Database.BeginTransaction()
at SQLite.CodeFirst.SqliteInitializerBase`1.InitializeDatabase(TContext context)
at SQLite.CodeFirst.SqliteCreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)}
IPForWatsonBuckets: 18474291
IsTransient: false
Message: "An exception occurred while initializing the database. See the InnerException for details."
RemoteStackTrace: null
Source: "EntityFramework"
StackTrace: " at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)\r\n at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()\r\n at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)\r\n at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)\r\n at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)\r\n at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()\r\n at System.Data.Entity.Internal.InternalContext.Initialize()\r\n at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)\r\n at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()\r\n at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()\r\n at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)\r\n at System.Data.En
tity.Internal.Linq.InternalSet`1.Add(Object entity)\r\n at System.Data.Entity.DbSet`1.Add(TEntity entity)\r\n at HelloSQLite.Form1.button1_Click(Object sender, EventArgs e) in d:\\dev\\helloSQLite\\HelloSQLite\\Form1.cs:line 29"
TargetSite: {Void PerformInitializationAction(System.Action)}
WatsonBuckets: null
Here are the references
This looks like a permission issue
System.Data.SQLite.SQLiteException: unable to open database file
The database-file is set to c:\mydb.sqlite in app.config connectionString
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=c:\mydb.sqlite" providerName="System.Data.SQLite"/>
</connectionStrings>
Windows is kinda weird at times with files in the system-disk root (try creating a text-file in on system-disk root c:\ with the rightclick-menu-thingy).
You could change the filepath for the connectionString in app.config to a newly created folder, say c:\testing-stuffs\mydb.sqlite (im wildy guessing there is nothing created at c:\mydb.sqlite so there should be no file to move).
I'm starting with xamarin and i'm facing a problem using the listview with grouping (IsGroupingEnabled= true)
The System.ArgumentOutOfRangeException is raised when i load data asynchronously like this:
class RootMenuViewModel : BaseViewModel
{
public ObservableCollection<ItemClassification> Classif { get; set; }
public ObservableCollection<GroupItems> GroupedClassif { get; set; }
...
....
public async Task LoadDataAsync()
{
await Task.Run( () =>
{
authService.GetProfile( user =>
{
this.Email = user.Email;
dicoService.GetClassification(Settings.SystemId, Settings.ResourceId, classif => {
foreach (var item in classif)
{
if (item.ItemClass.Count>0)
{
GroupItems group = new GroupItems(item.Label);
foreach (var elt in item.ItemClass)
{
group.Add(elt); //creating groups raise exception
}
if(GroupedClassif.FirstOrDefault(x=>x.GroupName.Equals(group.GroupName))== null)
{
GroupedClassif.Add(group);
}
}
//Classif.Add(item);
}
});
});
});
}
}
Il call the asynch loading from contentPage:
protected override async void OnAppearing()
{
base.OnAppearing();
await rootUserProfileViewModel.LoadDataAsync();
}
And here is the stack trace:
Unhandled Exception:
System.ArgumentOutOfRangeException: Index was out of range. Must be
non-negative and less than the size of the collection. Parameter name:
index
02-15 10:12:00.948 I/MonoDroid( 1856): UNHANDLED EXCEPTION: 02-15
10:12:00.949 I/MonoDroid( 1856): System.ArgumentOutOfRangeException:
Index was out of range. Must be non-negative and less than the size of
the collection. 02-15 10:12:00.949 I/MonoDroid( 1856): Parameter name:
index 02-15 10:12:00.949 I/MonoDroid( 1856): at (wrapper
dynamic-method) System.Object:0336a8ee-fa98-462f-81c5-63d18afbbebd
(intptr,intptr) 02-15 10:12:00.949 I/MonoDroid( 1856): at (wrapper
managed-to-native)
Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a
(intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue*)
02-15 10:12:00.949 I/MonoDroid( 1856): at
Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod
(Java.Interop.JniObjectReference instance,
Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo
method, Java.Interop.JniArgumentValue* args) [0x00073] in
:0 02-15 10:12:00.949 I/MonoDroid(
1856): at
Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod
(System.String encodedMember, Java.Interop.IJavaPeerable self,
Java.Interop.JniArgumentValue* parameters) [0x0005d] in
:0 02-15 10:12:00.949 I/MonoDroid(
1856): at Android.Widget.BaseAdapter.NotifyDataSetChanged ()
[0x0000a] in :0 02-15 10:12:00.949
I/MonoDroid( 1856): at
Xamarin.Forms.Platform.Android.ListViewAdapter.OnDataChanged ()
[0x00034] in
D:\agent_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:563
02-15 10:12:00.949 I/MonoDroid( 1856): at
Xamarin.Forms.Platform.Android.ListViewAdapter.OnCollectionChanged
(System.Object sender,
System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
[0x00000] in
D:\agent_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:553
02-15 10:12:00.949 I/MonoDroid( 1856): at
Xamarin.Forms.Internals.TemplatedItemsList2[TView,TItem].OnCollectionChanged
(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
[0x0000a] in
D:\agent\_work\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:771 02-15
10:12:00.949 I/MonoDroid( 1856): at
Xamarin.Forms.Internals.TemplatedItemsList2[TView,TItem].OnCollectionChangedGrouped
(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
[0x000d5] in
D:\agent_work\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:798 02-15
10:12:00.949 I/MonoDroid( 1856): at
Xamarin.Forms.Internals.TemplatedItemsList2[TView,TItem].OnProxyCollectionChanged
(System.Object sender,
System.Collections.Specialized.NotifyCollectionChangedEventArgs e,
System.Boolean fixWindows) [0x00008] in
D:\agent\_work\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:975 02-15
10:12:00.949 I/MonoDroid( 1856): at
Xamarin.Forms.Internals.TemplatedItemsList2[TView,TItem].OnProxyCollectionChanged
(System.Object sender,
System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
[0x00000] in
D:\agent_work\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:968 02-15
10:12:00.949 I/MonoDroid( 1856): at
Xamarin.Forms.ListProxy.OnCollectionChanged
(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
[0x0000a] in D:\agent_work\1\s\Xamarin.Forms.Core\ListProxy.cs:233
02-15 10:12:00.949 I/MonoDroid( 1856): at
Xamarin.Forms.ListProxy+<>c__DisplayClass33_0.b__0
() [0x00018] in D:\agent_work\1\s\Xamarin.Forms.Core\ListProxy.cs:206
02-15 10:12:00.949 I/MonoDroid( 1856): at
Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in
:0 02-15 10:12:00.949 I/MonoDroid(
1856): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv,
System.IntPtr native__this) [0x00008] in
:0 02-15 10:12:00.949 I/MonoDroid(
1856): at (wrapper dynamic-method)
System.Object:61a7ea3b-2ffa-42ea-8ca3-d33b76f002b8 (intptr,intptr)
Thank you in advance
I have some controller:
#Override
#RequestMapping(value = "/createOrUpdate.html", method = RequestMethod.POST)
#Transactional
#PreAuthorize("hasPermission(#message, 'CREATE')")
public String form(#Valid final Message message, final Model model) {
if (message.getId() == null) {
someService.save(message);
AclManager.create(message);
} else {
someService.update(message);
AclManager.update(message);
}
return "main";
}
This controller use for two purposes - if message.id == null, it creates a new record, if message.id != null, then the record is updated.
My problem is when message.id == null, I get an exception because "hasPermission" requires that all fields have been filled.
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/portal].[mvc-dispatcher]] (http--127.0.0.1-8080-3) Servlet.service() for servlet mvc-dispatcher threw exception: java.lang.IllegalArgumentException: getId() is required to return a non-null value
at org.springframework.util.Assert.notNull(Assert.java:112) [spring-core-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.security.acls.domain.ObjectIdentityImpl.<init>(ObjectIdentityImpl.java:86) [spring-security-acl-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.acls.domain.ObjectIdentityRetrievalStrategyImpl.getObjectIdentity(ObjectIdentityRetrievalStrategyImpl.java:34) [spring-security-acl-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.acls.AclPermissionEvaluator.hasPermission(AclPermissionEvaluator.java:57) [spring-security-acl-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.access.expression.SecurityExpressionRoot.hasPermission(SecurityExpressionRoot.java:129) [spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_21]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_21]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_21]
at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:69) [spring-expression-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:197) [spring-expression-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102) [spring-expression-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:98) [spring-expression-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.security.access.expression.ExpressionUtils.evaluateAsBoolean(ExpressionUtils.java:11) [spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.access.expression.method.ExpressionBasedPreInvocationAdvice.before(ExpressionBasedPreInvocationAdvice.java:41) [spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.access.prepost.PreInvocationAuthorizationAdviceVoter.vote(PreInvocationAuthorizationAdviceVoter.java:54) [spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.access.prepost.PreInvocationAuthorizationAdviceVoter.vote(PreInvocationAuthorizationAdviceVoter.java:24) [spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:62) [spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:206) [spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:60) [spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) [spring-aop-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at com.payplaza.pms.portal.system.controllers.AcquirerController$$EnhancerByCGLIB$$1069f3c6_2.form(<generated>) [spring-core-3.2.1.RELEASE.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_21]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_21]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_21]
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:827) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_21]
How fix this problem?
Try to use ternary operator:
#PreAuthorize("#message.id!=null ? hasPermission(#message, 'UPDATE') : hasPermission(#message, 'CREATE')")
I suppose that you have corresponding 'UPDATE' permission for update case.