Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery DataTables bug: "int parameter 'draw' is present but cannot be translated into a null value" #1237

Closed
jrobble opened this issue Dec 21, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@jrobble
Copy link
Member

jrobble commented Dec 21, 2020

From the end user

I'm continually getting this error in the ui:

DataTables warning: table id=jobTable - Ajax error. For more information about this error, please see http://datatables.net/tn/7

In the WFM log:

openmpf5_workflow-manager.1.jrc0iukayhln@some.host    | 2020-12-16 21:58:11,958 ERROR [http-nio-8080-exec-103] o.m.m.m.ControllerUncaughtExceptionHandler - Request for http://some.swarm.host/workflow-manager/jobs-paged raised an uncaught exception
openmpf5_workflow-manager.1.jrc0iukayhln@some.host    | java.lang.IllegalStateException: Optional int parameter 'draw' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

This error seems to be occurring when using the Job Status web UI because of a POST to http://openmpf-workflow-manager.swarm.va.dcap.fbi.gov/workflow-manager/jobs-paged where the “draw” parameter is present has no value. I’ve read that Spring MVC will attempt to set undefined parameters to “null”. In our REST endpoint code it seems that we attempt set a primitive int variable to that “null”, which is not valid. Some people online recommend using the Integer class instead of the primitive int.

Long story short, it seems that we can handle parameters a little better in our code, although, I’m not sure why the “draw” parameter would ever be set to null. We’re using the jQuery DataTables library: https://datatables.net/manual/server-side#Sent-parameters.

@jrobble jrobble added the bug label Dec 21, 2020
@jrobble jrobble added this to the Milestone 1 milestone Dec 21, 2020
@jrobble jrobble self-assigned this Dec 21, 2020
@jrobble jrobble added this to To do in OpenMPF: Development via automation Dec 21, 2020
@jrobble jrobble moved this from To do to Planned in OpenMPF: Development Dec 21, 2020
@jrobble jrobble modified the milestones: Milestone 1, Milestone 2 May 14, 2021
@jrobble jrobble assigned brosenberg42 and unassigned jrobble Jun 8, 2021
@jrobble jrobble moved this from Planned to In Progress in OpenMPF: Development Jun 8, 2021
This was referenced Jun 9, 2021
@jrobble jrobble moved this from In Progress to Testing in OpenMPF: Development Jun 11, 2021
@jrobble jrobble closed this as completed Feb 15, 2022
OpenMPF: Development automation moved this from Testing to Closed Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants