IllegalArgumentException while saving object

am getting this error : IllegalArgumentException while performing the below method no idea why its happening any idea whats wrong here ??
public void sendNoteWithoutImage(){
Toast.makeText(getContext(), “Step 1”, Toast.LENGTH_LONG).show();
// saving objects
Note notesRealmClass = new Note();
notesRealmClass.setTitle(titleStr);
Toast.makeText(getContext(), “Step 2”, Toast.LENGTH_LONG).show();
ChannelIDs = TextUtils.join(" ",selectedItems);
Toast.makeText(getContext(), “Step 3”, Toast.LENGTH_LONG).show();
notesRealmClass.setObjId(objId);
Toast.makeText(getContext(), “Step 4”, Toast.LENGTH_LONG).show();
// save object asynchronously
Backendless.Persistence.save(notesRealmClass, new AsyncCallback<Note>() {
public void handleResponse(Note note) {
Toast.makeText(getContext(), “Step 5”, Toast.LENGTH_LONG).show();
// new Contact instance has been saved
Toast.makeText(getActivity(), "Successfully posted ", Toast.LENGTH_SHORT).show();
}
public void handleFault(BackendlessFault fault) {
Toast.makeText(getContext(), “Step 6”, Toast.LENGTH_LONG).show();
Log.d("ERROR : ", “” + fault.getMessage());
Log.d(“ERROR Code: “,””+fault.getCode());
Toast.makeText(getActivity(), “” + fault.getMessage(), Toast.LENGTH_SHORT).show();
// an error has occurred, the error code can be retrieved with fault.getCode()
}
});}
as you can see i putted number of toasts for checking which parts of codes are executing , from step 1 to 4 every thing is fine but not in the step 5 , am getting a error directly on step 6 and the error’s print is:
02-18 12:54:09.025 25161-25161/pb.package D/ERROR :: rx/Observable
02-18 12:54:09.025 25161-25161/pb.package D/ERROR Code:: IllegalArgumentException

Hi Remy,

What does stack trace tell us?

Cheers,
Artur

hey artur ,

well am new in java and i don’t know what exactly stack trace stands for but i think you’re asking about what error is printing or what error is saying , so when i printed the fault.getmessage() in return am getting D/ERROR :: rx/Observable and in fault.getCode is returning D/ERROR Code:: IllegalArgumentException

thanks
ps. that account was also mine (remy) created by mistake

I can not find no declaration of “objId” in your code, where does it come from?

well its a string i declared it in this class the code i provided above is just a small portion of my entire class i even tried putting simple string “TEST” instead of variables but it didnt worked

well i didn’t mentioned above that my Note class extends RelamObject did something wrong in Realm ??? but the error is occurring while posting object to backendless

You can not save object with your custom objectId. When you call Backendless.Persistence.save() on object with objectId = null it will be set automatically.

IllegalArgumentException tells you that objectId is invalid. ObjectId may only be valid existent objectId for saved objects or null for unsaved object.

no thats not for object’s id it named like that but the id is for another thing

and i got the solution behind this firstly apologise because the problem is not actually related to backendless its happen because of Realm

according to this https://www.bountysource.com/issues/29233605-java-lang-noclassdeffounderror-rx-observable-in-0-87-0 , for fixing it we just have to put compile ‘io.reactivex:rxjava:1.0.16’ in our grade file

thanks for your efforts Artur.

Thanks billion bucks …This answer is helpful for me…