nullreferenceexception

DTO returns null when called from a Rest client using spring boot

落爺英雄遲暮 提交于 2020-01-06 10:05:54
问题 This is making a spring boot project to maintain the MVC architecture and as well being RestFul. There is a project that is fully working properly using the MVC architecture, I'll like to make it work as well by being called from a Rest client. Posting from the Thymeleaf UI works fine, however, when I try to post from a Rest client all the DTO properties are null. I don't know why. How do I make the posting from the client get all the properties posted? UserDto @PasswordMatches public class

DTO returns null when called from a Rest client using spring boot

狂风中的少年 提交于 2020-01-06 10:05:12
问题 This is making a spring boot project to maintain the MVC architecture and as well being RestFul. There is a project that is fully working properly using the MVC architecture, I'll like to make it work as well by being called from a Rest client. Posting from the Thymeleaf UI works fine, however, when I try to post from a Rest client all the DTO properties are null. I don't know why. How do I make the posting from the client get all the properties posted? UserDto @PasswordMatches public class

NullReferenceException was unhandled C# [duplicate]

馋奶兔 提交于 2020-01-06 08:07:10
问题 This question already has answers here : What is a NullReferenceException, and how do I fix it? (28 answers) Closed 5 years ago . Visual Studio 2010 - (Windows Forms) in C# I have this code: private void cbxValuta_SelectedIndexChanged(object sender, EventArgs e) { try { string primo = cbxValuta.SelectedItem.ToString(); string secondo = cbxValuta2.SelectedItem.ToString(); double cambio = double.Parse(CurrencyConverter.Convert(1.0m, primo, secondo)); tbxConvertito.Text = (double.Parse

Save Action on webforms for marketers throws exception

风流意气都作罢 提交于 2020-01-05 09:28:21
问题 I am using the latest version of Sitecore - 7.2 (rev. 140228) and the latest version of WFFM - 2.4 rev. 140923. So the problem is whenever I try to submit a form no matter what kind of save action I have, Sitecore throws exception: Object reference not set to an instance of an object. Description: An unhandled exception occurred. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Stack Trace: [NullReferenceException: Object reference not

WPF NullReferenceException when XAML element is referenced in code

混江龙づ霸主 提交于 2020-01-05 02:58:14
问题 Here's my code: public partial class MainWindow : Window { public MainWindow() { //myOnlyGrid = new Grid(); Chart MyChart = new Chart(); ColumnSeries b = new ColumnSeries(); b.Title = "B"; b.IndependentValueBinding = new System.Windows.Data.Binding("Key"); b.DependentValueBinding = new System.Windows.Data.Binding("Value"); b.ItemsSource = new List<KeyValuePair<string, int>> { new KeyValuePair<string, int>("1", 100), new KeyValuePair<string, int>("2", 75), new KeyValuePair<string, int>("3",

Object reference not set to an instance of an object #5

允我心安 提交于 2020-01-03 17:35:30
问题 sUsername.Trim(); sPassword.Trim(); string ConnectionString = WebConfigurationManager.ConnectionStrings["dbnameConnectionString"].ConnectionString; SqlConnection myConnection = new SqlConnection(ConnectionString); Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System

Visual Studio null reference warning - why no error?

百般思念 提交于 2020-01-03 14:02:39
问题 I've noticed something peculiar about Visual Studio. First, try typing this (C#) somewhere in a function: class Foo { public void Bar() { string s; int i = s.Length; } } Now, right away it will mark the s in s.Length as an error, saying " Use of unassigned local variable 's' ". On the other hand, try this code: class Foo { private string s; public void Bar() { int i = s.Length; } } It will compile, and underline the s in private string s with a warning, saying " Field 'Foo.s' is never

Cannot connect to Sql server due to NullReferenceException [duplicate]

痞子三分冷 提交于 2020-01-03 04:35:09
问题 This question already has answers here : What is a NullReferenceException, and how do I fix it? (28 answers) Closed 5 years ago . I have a windows forms application which begins with the Login form The Login form has been fine for past few day while i was working on rest of the application I get an error now that I have two database one DB.mdf and one MYD.sdf NullReferenceException was unhandled Object reference not set to an instance of an object. for this particular lines of code --- >

How to get interpolated message in NHibernate.Validator

 ̄綄美尐妖づ 提交于 2020-01-02 12:14:15
问题 I'm trying to integrate NHibernate.Validator with ASP.NET MVC client side validations, and the only problem I found is that I simply can't convert the non-interpolated message to a human-readable one. I thought this would be an easy task, but turned out to be the hardest part of the client-side validation. The main problem is that because it's not server-side, I actually only need the validation attributes that are being used, and I don't actually have an instance or anything else at hand.

NullReferenceException in creating Excel worksheet

╄→尐↘猪︶ㄣ 提交于 2020-01-02 02:40:06
问题 i want to fill an excel file and so i use ExcelPackage: Office Open XML Format . but i have an error. my code: string fileName = "DBE_BAKIM_FORMU" + ".xlsx"; FileInfo fi = new FileInfo(HttpContext.Current.Server.MapPath("~/") + fileName); using (ExcelPackage xlPackage = new ExcelPackage(fi)) { ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[1]; dbeDataContext db = new dbeDataContext(); CAGRI c = (from x in db.CAGRIs where x.CagriID == ID select x).SingleOrDefault(); USER u = (from x