I am having an issue with the Snackbar in the android support design library.
The weird thing is, that it only occurs when I run my app in Debug mode, in Release mode it all works perfectly.
Does Anyone have an idea on this issue? It seems to be a bug in the Support library.
Code
using (var snackbar = Snackbar.Make(View, "Nieuwe order aangemaakt", Snackbar.LengthLong).SetAction("OK", v => { }))
snackbar.Show();
Exception
07-06 11:47:50.414 I/MonoDroid(13296): Java.Lang.ClassCastException: Exception of type 'Java.Lang.ClassCastException' was thrown.
07-06 11:47:50.414 I/MonoDroid(13296): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
07-06 11:47:50.414 I/MonoDroid(13296): at OverAllField.XamarinAndroid.Fragments.Planning.PlanningFragment.FloatingActionButton_Click (object,System.EventArgs) [0x00001] in c:\Development\Apps\FieldService-Tablet\OverAllF07-06 11:47:50.414 I/MonoDroid(13296): at Android.Runtime.JNIEnv.CallStaticObjectMethod (intptr,intptr,Android.Runtime.JValue*) [0x00064] in /Users/builder/data/lanes/1502/24855232/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1301
07-06 11:47:50.414 I/MonoDroid(13296): at Android.Support.Design.Widget.Snackbar.Make (Android.Views.View,Java.Lang.ICharSequence,int)
07-06 11:47:50.414 I/MonoDroid(13296): at Android.Support.Design.Widget.Snackbar.Make (Android.Views.View,string,int)
07-06 11:47:50.414 I/MonoDroid(13296): at OverAllField.XamarinAndroid.Fragments.Planning.PlanningFragment.FloatingActionButton_Click (object,System.EventArgs) [0x00001] in c:\Development\Apps\FieldService-Tablet\OverAllField.XamarinAndroid\OverAllField.Android\Fragments\Planning\PlanningFragment.cs:74
07-06 11:47:50.414 I/MonoDroid(13296): at Android.Views.View/IOnClickListenerImplementor.OnClick (Android.Views.View) [0x0000d] in /Users/builder/data/lanes/1502/24855232/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.Views.View.cs:1923
07-06 11:47:50.414 I/MonoDroid(13296): at Android.Views.View/IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1502/24855232/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.Views.View.cs:1888
07-06 11:47:50.414 I/MonoDroid(13296): at (wrapper dynamic-method) object.84d16582-f149-4133-af10-0f21d61ca331 (intptr,intptr,intptr)
07-06 11:47:50.414 I/MonoDroid(13296): --- End of managed exception stack trace ---
07-06 11:47:50.414 I/MonoDroid(13296): java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.support.design.widget.Snackbar$SnackbarLayout
07-06 11:47:50.414 I/MonoDroid(13296): at android.support.design.widget.Snackbar.(Snackbar.java:119)
07-06 11:47:50.414 I/MonoDroid(13296): at android.support.design.widget.Snackbar.make(Snackbar.java:140)
07-06 11:47:50.414 I/MonoDroid(13296): at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)
07-06 11:47:50.414 I/MonoDroid(13296): at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)
07-06 11:47:50.414 I/MonoDroid(13296): at android.view.View.performClick(View.java:4754)
07-06 11:47:50.414 I/MonoDroid(13296): at android.view.View$PerformClick.run(View.java:19605)
07-06 11:47:50.414 I/MonoDroid(13296): at android.os.Handler.handleCallback(Handler.java:733)
07-06 11:47:50.414 I/MonoDroid(13296): at android.os.Handler.dispatchMessage(Handler.java:95)
07-06 11:47:50.414 I/MonoDroid(13296): at android.os.Looper.loop(Looper.java:146)
07-06 11:47:50.414 I/MonoDroid(13296): at android.app.ActivityThread.main(ActivityThread.java:5748)
07-06 11:47:50.414 I/MonoDroid(13296): at java.lang.reflect.Method.invokeNative(Native Method)
07-06 11:47:50.414 I/MonoDroid(13296): at java.lang.reflect.Method.invoke(Method.java:515)
07-06 11:47:50.414 I/MonoDroid(13296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
07-06 11:47:50.414 I/MonoDroid(13296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
07-06 11:47:50.414 I/MonoDroid(13296): at dalvik.system.NativeStart.main(Native Method)
07-06 11:47:50.419 D/AndroidRuntime(13296): Shutting down VM
07-06 11:47:50.419 W/dalvikvm(13296): threadid=1: thread exiting with uncaught exception (group=0x41888c08)
A simple Clean/Rebuild fixed this issue. Can't believe this wouldn't work a couple of days ago, when I tried that too...
Related
I am facing crash issue in following line of code :
int bytesRead = await this.stream.ReadAsync(buffer, 0, buffer.Length, token);
Error Log :
{System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Mono.Security.Interface.TlsException: Unknown Secure Transport error `DecryptionFail'.
at Mono.AppleTls.AppleTlsContext.CheckStatusAndThrow (Mono.AppleTls.SslStatus status, Mono.AppleTls.SslStatus[] acceptable) [0x00096] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs:127
at Mono.AppleTls.AppleTlsContext.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x0009f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs:810
at Mono.Net.Security.MobileAuthenticatedStream.ProcessRead (Mono.Net.Security.BufferOffsetSize userBuffer) [0x00011] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs:632
at Mono.Net.Security.AsyncReadRequest.Run (Mono.Net.Security.AsyncOperationStatus status) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System/Mono.Net.Security/AsyncProtocolRequest.cs:320
at Mono.Net.Security.AsyncProtocolRequest+d__24.MoveNext () [0x000ff] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System/Mono.Net.Security/AsyncProtocolRequest.cs:221
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:447
at Mono.Net.Security.AsyncProtocolRequest+d__23.MoveNext () [0x00046] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System/Mono.Net.Security/AsyncProtocolRequest.cs:187
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at Mono.Net.Security.MobileAuthenticatedStream+d__58.MoveNext () [0x001b9] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs:380
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/mcs/class/
Thanks for the help
I have the xamarin.forms application for which i am trying to connect localhost from PC to Iphone simulator in mac,Iam using the Ip address for connecting,
private string Uri = "http://192.168.0.16:62271/";//Windows Ip address:localhost port number
private string GetDishesUrl = "api/DishDetails/GetDishDetails?id=5";
try{
var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri(Uri);
var response = await httpClient.GetAsync(new Uri(Uri + GetDishesUrl));
var stringAsync = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
var responseJson = stringAsync;
return JsonConvert.DeserializeObject<List<DishDetails>>(responseJson);
}
}
catch(Exception ex)
{
}
Here iam getting following Exception:
{System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error: ConnectFailure (Connection refused) ---> System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000b0] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/System/System.Net.Sockets/Socket.cs:879
at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x00191] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/System/System.Net/WebConnection.cs:194
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00052] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1029
at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x0000f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:550
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at System.Net.Http.HttpClientHandler+<SendAsync>d__63.MoveNext () [0x00406] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:388
--- End of inner exception stack trace ---
at System.Net.Http.HttpClientHandler+<SendAsync>d__63.MoveNext () [0x0049f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:392
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at System.Net.Http.HttpClient+<SendAsyncWorker>d__48.MoveNext () [0x00080] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:276
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.1.0/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
at MyApp.Services.DishDetailsService+<GetAsync>d__5.MoveNext () [0x00084] in G:\SourceTree\Projects\SourceCode\MyApp\MyApp\MyApp\Services\DishDetailsService.cs:45 }`
while running web in windows it is working as expected.When trying to connect to mac giving an error.I followed different approaches from internet but non of them got worked.
EDIT:I disabled firewall and connected mac and pc under same Wifi then the response is null and exception is also null.
I am integrating stripe payment with my xamarin android application.But when I am creating token in try block, its giving exception.Why its giving exception?Here is my code I am doing :
var card = new Card
{
Number = "4242424242424242",
ExpiryMonth = 12,
ExpiryYear = 16,
CVC = "123"
};
var token = await StripeClient.CreateToken(card, "pk_test_lkH9OCXVwDdJzTzc9kI8UILY");
await CreateBackendCharge(token);
async Task CreateBackendCharge(Token token)
{
var http = new HttpClient();
var content = new StringContent("StripeTokenId=" + token.Id);
var response = await http.PostAsync("https://stripe.com/token", content);
}
Exception is
Not Flagged [1] Line 83 {System.Net.WebException: Error: NameResolutionFailure
at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00043] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:882
at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (IAsyncResult iar, System.Func`2 endFunction, System.Action`1 endAction, System.Threading.Tasks.Task`1 promise, Boolean requiresSynchronization) [0x00014] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:550
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at System.Net.Http.HttpClientHandler+<SendAsync>c__async0.MoveNext () [0x002af] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:363
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext () [0x000a9] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:276
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
at Stripe.StripeClient+<requestToken>c__async2.MoveNext () [0x00085] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
at Stripe.StripeClient+<CreateToken>c__async0.MoveNext () [0x001c4] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
at AndroidApp.MainActivity+<OnCardDataRecieved>d__8.MoveNext () [0x00095] in C:\Users\karanveer.READINKAD\Documents\Visual Studio 2015\Projects\AndroidApp\AndroidApp\MainActivity.cs:74 }
Error: NameResolutionFailure means that your code was unable to resolve a domain name -- likely the domain name you use in your StripeClient.CreateToken method.
By the way, the rest of the code has no chance of working. Even if you succeed in creating a token, POSTing a token to https://stripe.com/token will result in a 404 error since there is nothing at that URL.
I recommend you take some time to browse through Stripe's documentation, and in particular how to create charges using tokens.
When I load site I get error 500 on this site and stack trace. Problem is occurred while doing "getNeo4jSession()". It looks like two thread want to have access to embedded Neo4j database.
Severe: Error Rendering View[/primefaces.xhtml]
javax.el.ELException: /primefaces.xhtml: Cant instantiate class: neo4jCMS.managedBean.SiteContent.
at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:90)
at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:82)
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.sun.faces.mgbean.ManagedBeanCreationException: Cant instantiate class: neo4jCMS.managedBean.SiteContent.
at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:191)
at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116)
at com.sun.el.parser.AstValue.getBase(AstValue.java:151)
at com.sun.el.parser.AstValue.getValue(AstValue.java:200)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:238)
at com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:154)
at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
... 43 more
Caused by: org.neo4j.ogm.exception.ConnectionException: Error connecting to embedded graph
at org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver.configure(EmbeddedDriver.java:115)
at org.neo4j.ogm.service.DriverService.load(DriverService.java:64)
at org.neo4j.ogm.service.Components.loadDriver(Components.java:126)
at org.neo4j.ogm.service.Components.driver(Components.java:84)
at org.neo4j.ogm.session.SessionFactory.openSession(SessionFactory.java:80)
at neo4jCMS.Neo4jSessionFactory.getNeo4jSession(Neo4jSessionFactory.java:26)
at neo4jCMS.managedBean.SiteContent.<init>(SiteContent.java:18)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
... 57 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver.setGraphDatabase(EmbeddedDriver.java:139)
at org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver.configure(EmbeddedDriver.java:112)
... 69 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver.setGraphDatabase(EmbeddedDriver.java:126)
... 70 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /home/marcin/neo4jDatabase
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:129)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:117)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:185)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:79)
... 75 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#22b0f01f' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
... 81 more
**Caused by: org.neo4j.kernel.StoreLockException: Unable to obtain lock on store lock file: /home/marcin/neo4jDatabase/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)**
at org.neo4j.kernel.StoreLocker.storeLockException(StoreLocker.java:93)
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:85)
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
... 83 more
Caused by: java.nio.channels.OverlappingFileLockException
at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1108)
at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155)
at org.neo4j.io.fs.StoreFileChannel.tryLock(StoreFileChannel.java:135)
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:75)
... 85 more
Warning: StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
java.nio.channels.OverlappingFileLockException
at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1108)
at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155)
at org.neo4j.io.fs.StoreFileChannel.tryLock(StoreFileChannel.java:135)
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:75)
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:129)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:117)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:185)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver.setGraphDatabase(EmbeddedDriver.java:126)
at org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver.configure(EmbeddedDriver.java:112)
at org.neo4j.ogm.service.DriverService.load(DriverService.java:64)
at org.neo4j.ogm.service.Components.loadDriver(Components.java:126)
at org.neo4j.ogm.service.Components.driver(Components.java:84)
at org.neo4j.ogm.session.SessionFactory.openSession(SessionFactory.java:80)
at neo4jCMS.Neo4jSessionFactory.getNeo4jSession(Neo4jSessionFactory.java:26)
at neo4jCMS.managedBean.SiteContent.<init>(SiteContent.java:18)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116)
at com.sun.el.parser.AstValue.getBase(AstValue.java:151)
at com.sun.el.parser.AstValue.getValue(AstValue.java:200)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:238)
at com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:154)
at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:82)
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
SiteContent class:
#ManagedBean
public class SiteContent
{
private String _code;
public SiteContent()
{
_code = new String();
Neo4jSessionFactory sessionFactory = new Neo4jSessionFactory();
Session session = sessionFactory.getNeo4jSession();
What is the problem? How to debug it?
I am getting date (2015-03-20T06:34:01.831183+01:00) from server which is not simple date format i want to convert this type of date to simple date format like (yyyyMMddHHmmssSSSS)
How can i do this.
I have used this but not working for me
String tdate="2015-03-15T14:04:43.877593+01:00";
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss a");
formatter.setTimeZone(TimeZone.getTimeZone("IST"));
String dateInString = "2015-03-15T14:04:43.877593+01:00";
try {
Date date = null;
try {
date = formatter.parse(dateInString);
} catch (java.text.ParseException e) {
e.printStackTrace();
}
System.out.println(date);
System.out.println(formatter.format(date));
System.out.println("System Date in GMT: "+formatDateToString(date, "yyyyMMddHHmmssSSSS", "IST"));
} catch (ParseException e) {
e.printStackTrace();
}
Error Logcat
03-19 12:51:39.222: W/System.err(32124): java.text.ParseException: Unparseable date: "2015-03-15T14:04:43.877593+01:00" (at offset 19)
03-19 12:51:39.228: W/System.err(32124): at java.text.DateFormat.parse(DateFormat.java:555)
03-19 12:51:39.228: W/System.err(32124): at com.example.xmldatademo.XmlActivity.onCreate(XmlActivity.java:51)
03-19 12:51:39.228: W/System.err(32124): at android.app.Activity.performCreate(Activity.java:5248)
03-19 12:51:39.228: W/System.err(32124): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
03-19 12:51:39.229: W/System.err(32124): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
03-19 12:51:39.229: W/System.err(32124): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
03-19 12:51:39.229: W/System.err(32124): at android.app.ActivityThread.access$800(ActivityThread.java:139)
03-19 12:51:39.229: W/System.err(32124): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
03-19 12:51:39.229: W/System.err(32124): at android.os.Handler.dispatchMessage(Handler.java:102)
03-19 12:51:39.230: W/System.err(32124): at android.os.Looper.loop(Looper.java:136)
03-19 12:51:39.230: W/System.err(32124): at android.app.ActivityThread.main(ActivityThread.java:5086)
03-19 12:51:39.230: W/System.err(32124): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 12:51:39.230: W/System.err(32124): at java.lang.reflect.Method.invoke(Method.java:515)
03-19 12:51:39.231: W/System.err(32124): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
03-19 12:51:39.231: W/System.err(32124): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
03-19 12:51:39.231: W/System.err(32124): at dalvik.system.NativeStart.main(Native Method)
03-19 12:51:39.231: I/System.out(32124): null
03-19 12:51:39.233: D/AndroidRuntime(32124): Shutting down VM
03-19 12:51:39.233: W/dalvikvm(32124): threadid=1: thread exiting with uncaught exception (group=0x416a5d40)
03-19 12:51:39.235: E/AndroidRuntime(32124): FATAL EXCEPTION: main
03-19 12:51:39.235: E/AndroidRuntime(32124): Process: com.example.xmldatademo, PID: 32124
03-19 12:51:39.235: E/AndroidRuntime(32124): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.xmldatademo/com.example.xmldatademo.XmlActivity}: java.lang.NullPointerException
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.app.ActivityThread.access$800(ActivityThread.java:139)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.os.Handler.dispatchMessage(Handler.java:102)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.os.Looper.loop(Looper.java:136)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.app.ActivityThread.main(ActivityThread.java:5086)
03-19 12:51:39.235: E/AndroidRuntime(32124): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 12:51:39.235: E/AndroidRuntime(32124): at java.lang.reflect.Method.invoke(Method.java:515)
03-19 12:51:39.235: E/AndroidRuntime(32124): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
03-19 12:51:39.235: E/AndroidRuntime(32124): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
03-19 12:51:39.235: E/AndroidRuntime(32124): at dalvik.system.NativeStart.main(Native Method)
03-19 12:51:39.235: E/AndroidRuntime(32124): Caused by: java.lang.NullPointerException
03-19 12:51:39.235: E/AndroidRuntime(32124): at java.util.Calendar.setTime(Calendar.java:1183)
03-19 12:51:39.235: E/AndroidRuntime(32124): at java.text.SimpleDateFormat.formatImpl(SimpleDateFormat.java:518)
03-19 12:51:39.235: E/AndroidRuntime(32124): at java.text.SimpleDateFormat.format(SimpleDateFormat.java:818)
03-19 12:51:39.235: E/AndroidRuntime(32124): at java.text.DateFormat.format(DateFormat.java:307)
03-19 12:51:39.235: E/AndroidRuntime(32124): at com.example.xmldatademo.XmlActivity.onCreate(XmlActivity.java:56)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.app.Activity.performCreate(Activity.java:5248)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
03-19 12:51:39.235: E/AndroidRuntime(32124): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
03-19 12:51:39.235: E/AndroidRuntime(32124): ... 11 more
Check this out. Hope this will help. I am not reading fraction seconds(SSS).
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
formatter.setTimeZone(TimeZone.getTimeZone("IST"));
String dateInString = "2015-03-15T14:04:43.877593+01:00";
SimpleDateFormat newDateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSSS");
Date date = null;
try {
//date instace
date = formatter.parse(dateInString);
//date format -> yyyyMMddHHmmssSSSS
String sNewDate = newDateFormat.format(date);
System.out.println("New Date Format " + sNewDate);
} catch (java.text.ParseException e) {
e.printStackTrace();
}