ox-it / ords

Automatically exported from code.google.com/p/ords
0 stars 0 forks source link

ORDS crashes when accessing table #742

Closed jajwilson closed 8 years ago

jajwilson commented 8 years ago

When I try to access the 'Education' table in the 'British and Irish Surgeons in India' db, I get the following null pointer exception crash. I can't give you guys direct access, as this is a real user project, but will recreate in dev once I get the chance.

HTTP Status 500 - java.lang.NullPointerException

type Exception report

message java.lang.NullPointerException

description The server encountered an internal error (java.lang.NullPointerException) that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) root cause

java.lang.NullPointerException uk.ac.ox.oucs.ords.utilities.database.ORDSPostgresDBUtils.addTableColumnReferences(ORDSPostgresDBUtils.java:636) uk.ac.ox.oucs.ords.utilities.database.ORDSPostgresDBUtils.getTableDataForTable(ORDSPostgresDBUtils.java:556) uk.ac.ox.oucs.ords.utilities.PaginationUtils.viewData(PaginationUtils.java:593) uk.ac.ox.oucs.ords.utilities.PaginationUtils.viewTableData(PaginationUtils.java:324) uk.ac.ox.oucs.ords.utilities.FilterUtils.viewFilteredTableData(FilterUtils.java:63) org.apache.jsp.table_jsp._jspService(table_jsp.java:460) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.28 logs.

Apache Tomcat/7.0.28

thestoat commented 8 years ago

That dump looks like it has been created with old code. There may still be a problem though, so I shall await access to reproduce.

jajwilson commented 8 years ago

Ah - I think i've worked out what's causing the crash. It seems to happen whenever I rename any of the fields in tables to which the 'education' table links. In this db, the 'education' table links to the 'universities' table. If I rename either field in the 'universities' table (e.g. from 'id' to 'university_id'), then whenever I try to go to edit anything in the 'education' table, I get the crash report as above. If I rename the fields back to their original labels I can once again edit the 'education' table.

The db in question is 'Irish Surgeons' in the 'Standard Test' project on Dev - you should both have access.

thestoat commented 8 years ago

Ok, I shall need to wait for Jenkins to be fixed. The codebase is so far out of date now that I am foiled every time I try a work around to get at a view of the problem.

thestoat commented 8 years ago

Well this is interesting. Before I get to fixing this problem I need to make alterations in how some of the back end code works, since I am currently unable to reproduce the problem since I don't own the database (even though I am down as project admin). Interesting side effect to the ODBC work. I'll need to fix that first

thestoat commented 8 years ago

Ok - please try now.

jajwilson commented 8 years ago

Ok. After uploading the surgeons db I link people.id with education.person and save the new structure, which seems to work fine. However, when I go to edit the data in the 'education' table, the link has been lost. Going back to check this in the schema designer I can see that the relationship I just created has indeed disappeared again. So not quite fixed yet.

thestoat commented 8 years ago

Can you confirm this is the same problem as originally described or a completely new problem? Reading the original text you don't mention manually linking fields? Am I missing something?

jajwilson commented 8 years ago

This is a newly introduced problem. I didn't mention it in the original because it wasn't a problem then - it's been introduced in the attempt to fix the initial problem. I'll add it as a separate issue if that's the best way to do it, but it's clearly linked to the attempt to fix the problem described here.

thestoat commented 8 years ago

Well the original problem has been fixed and this is a new one. The distinction is important, not from a bean counting perspective, but because a lot of time can be wasted trying to reproduce the original problem that no longer exists. But no need to do that now I know ...

thestoat commented 8 years ago

And also, of course, as a general rule, the new problem being introduced may not warrant the same severity as the old one, different people may be interested in the new issue but not the old, etc.

jajwilson commented 8 years ago

I can't test that the original problem has been fixed until this new one has been fixed, because I can't get the database back to the state in which the first issue arose. I'll start a new issue - but I can't yet close this one.

thestoat commented 8 years ago

I have been using the original db - https://dev.ords.ox.ac.uk/ordsProjectNode/database.jsp?lid=1297680&dbProjectId=591697&pName=Standard%20test - and it seems to be ok.

(Another reason for opening a new issue - it is very difficult to tell if the fix for one issue created the second issue or whether another fix did that happened to "go in" at the same time)

jajwilson commented 8 years ago

Ah, ok. I'm still seeing the same original problem in the original db however - if I rename one of the fields in the Universities table from 'university_name' to 'university_name2', then the next time I try to edit data in the 'education' table, I get a crash report:

HTTP Status 500 - java.lang.NullPointerException

type Exception report

message java.lang.NullPointerException

description The server encountered an internal error (java.lang.NullPointerException) that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

java.lang.NullPointerException uk.ac.ox.oucs.ords.utilities.database.ORDSPostgresDBUtils.addTableColumnReferences(ORDSPostgresDBUtils.java:665) uk.ac.ox.oucs.ords.utilities.database.ORDSPostgresDBUtils.getTableDataForTable(ORDSPostgresDBUtils.java:584) uk.ac.ox.oucs.ords.utilities.PaginationUtils.viewData(PaginationUtils.java:617) uk.ac.ox.oucs.ords.utilities.PaginationUtils.viewTableData(PaginationUtils.java:326) uk.ac.ox.oucs.ords.utilities.FilterUtils.viewFilteredTableData(FilterUtils.java:64) org.apache.jsp.table_jsp._jspService(table_jsp.java:462) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.28 logs. Apache Tomcat/7.0.28

thestoat commented 8 years ago

I have added a fix that will suppress your problem. I cannot fix the problem currently as I can't see it. Here are the steps I take - please review carefully and let me know what I am doing differently to you.

  1. Start the query viewer in one tab
  2. Start the edit view in another tab and navigate to universities table
  3. - a) edit 2nd field so that 2,QUIG becomes 2,QUIG2 b) click "save changes" c) refresh tab - ensure the data remains (i.e. 2,QUIG2)
  4. In the designer tab, refresh the browser then alter "name" in universities table to "name2"
  5. Save this change
  6. - a) refresh the tab - ensure "name2" remains
  7. - a) In the edit tab, refresh the browser - ensure we can see a column "name2" with the entry "2, QUIG2"
  8. change the data from "2, QUIG2" to "2,QUIG3"
  9. - a) refresh the browser to ensure the data remains
jajwilson commented 8 years ago

Thanks Dave, that seems to have fixed the issue whether or not I go through the steps your describe.