Field error in object 'physicalgraph.device.Device' on field 'name': rejected value [null]; codes


(Brian) #1

Im getting the following error in the IDE. I have used the exact same code previously and it works great, and now its throwing this error. All inputs are populated so nothing there is null.

`grails.validation.ValidationException: Validation Error(s) occurred during save():

  • Field error in object ‘physicalgraph.device.Device’ on field ‘name’: rejected value [null]; codes [physicalgraph.device.Device.name.nullable.error.physicalgraph.device.Device.name,physicalgraph.device.Device.name.nullable.error.name,physicalgraph.device.Device.name.nullable.error.java.lang.String,physicalgraph.device.Device.name.nullable.error,device.name.nullable.error.physicalgraph.device.Device.name,device.name.nullable.error.name,device.name.nullable.error.java.lang.String,device.name.nullable.error,physicalgraph.device.Device.name.nullable.physicalgraph.device.Device.name,physicalgraph.device.Device.name.nullable.name,physicalgraph.device.Device.name.nullable.java.lang.String,physicalgraph.device.Device.name.nullable,device.name.nullable.physicalgraph.device.Device.name,device.name.nullable.name,device.name.nullable.java.lang.String,device.name.nullable,nullable.physicalgraph.device.Device.name,nullable.name,nullable.java.lang.String,nullable]; arguments [name,class physicalgraph.device.Device]; default message [{0} cannot be null]`

(Amauri Viguera) #2

Hard to guess without the actual code… do you have a field called “name” by any chance? Maybe they made a change on the backend and that’s now a reserved word, and it’s throwing everything off?


(Brian) #3

Nope. Here are the fields

preferences {
	//what is the departure location?
	section("Departing From:"){
		input "departFrom", "text", title: "Address?"
	}
    //what is the destination location?
	section("Arriving At:"){
		input "arriveAt", "text", title: "Address?"
	}
    //what time do you need to arrive?
	section("Expected Arrival Time:"){
		input "arrivalTime", "time", title: "When?"
	}
    // //what time should I begin checking traffic?
	section("Begin Checking At:"){
		input "checkTime", "time", title: "When?"
	}
    //some traffic threshold in minutes
	section("Traffic delay over this many minutes is considered Some Traffic:") {
		input "threshold2", "number", title: "Minutes?"
	}
    //bad traffic threshold in minutes
	section("Traffic delay over this many minutes is considered Bad Traffic:") {
		input "threshold3", "number", title: "Minutes?"
	}
}

(Brian) #4

Fixed!

Glitch in the Simulator. All I had to do was fully uninstall the app from the simulator and retype all of the inputs and update.


(Patrick Stuart [@pstuart]) #5

`grails.validation.ValidationException: Validation Error(s) occurred during save():

Field error in object ‘physicalgraph.device.Device’ on field ‘name’:
rejected value [null]; codes
[physicalgraph.device.Device.name.nullable.error.physicalgraph.device.Device.name,physicalgraph.device.Device.name.nullable.error.name,physicalgraph.device.Device.name.nullable.error.java.lang.String,physicalgraph.device.Device.name.nullable.error,device.name.nullable.error.physicalgraph.device.Device.name,device.name.nullable.error.name,device.name.nullable.error.java.lang.String,device.name.nullable.error,physicalgraph.device.Device.name.nullable.physicalgraph.device.Device.name,physicalgraph.device.Device.name.nullable.name,physicalgraph.device.Device.name.nullable.java.lang.String,physicalgraph.device.Device.name.nullable,device.name.nullable.physicalgraph.device.Device.name,device.name.nullable.name,device.name.nullable.java.lang.String,device.name.nullable,nullable.physicalgraph.device.Device.name,nullable.name,nullable.java.lang.String,nullable];
arguments [name,class physicalgraph.device.Device]; default message
[{0} cannot be null]`

Getting the same thing, but after uninstalling the app from the simulator and retyping the inputs and update didn’t work for me…


(Brian) #6

Try logging out in between?


(Patrick Stuart [@pstuart]) #7

Yeah, not sure how I got it to go away, but I know what causes it.

If you have 2 input preferences with the same name and save, it will fail.

Eventually I got it to go away, but the simulator has issues… In other news, the sky is blue.


(Brian) #8

Agreed. Just writing a small app today I had to log out twice