google-code-export / ords

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

sorting query results crashes the ORDS #595

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Define and run a query
2. Try to sort the query results in the ORDS
3. Watch it crash (crash report below)

What is the expected output? What do you see instead?
It should sort results - this was working before but the latest changes in dev 
seem to have knackered it.

Please use labels and text to provide additional information.
Dev 1.0.6 Chrome

Crash Report:
HTTP Status 500 - An exception occurred processing JSP page /tableData.jsp at 
line 105 102: <%= String.format(lang.getString("querydatafor"), cleanQuery, 
databaseType) %> 103: </h2> 104: 105: <% if (request.getParameter("vid") == 
null || Integer.parseInt(request.getParameter("vid")) == 0) { 106: if (query != 
null && !query.isEmpty()) { 107: cleanQuery = 
query.replaceAll("\\<.*?>","").replaceAll("\"", "&quot;"); 108: } Stacktrace:

type Exception report

message An exception occurred processing JSP page /tableData.jsp at line 105 
102: <%= String.format(lang.getString("querydatafor"), cleanQuery, 
databaseType) %> 103: </h2> 104: 105: <% if (request.getParameter("vid") == 
null || Integer.parseInt(request.getParameter("vid")) == 0) { 106: if (query != 
null && !query.isEmpty()) { 107: cleanQuery = 
query.replaceAll("\\<.*?>","").replaceAll("\"", "&quot;"); 108: } Stacktrace:

description The server encountered an internal error (An exception occurred 
processing JSP page /tableData.jsp at line 105 102: <%= 
String.format(lang.getString("querydatafor"), cleanQuery, databaseType) %> 103: 
</h2> 104: 105: <% if (request.getParameter("vid") == null || 
Integer.parseInt(request.getParameter("vid")) == 0) { 106: if (query != null && 
!query.isEmpty()) { 107: cleanQuery = 
query.replaceAll("\\<.*?>","").replaceAll("\"", "&quot;"); 108: } Stacktrace:) 
that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page 
/tableData.jsp at line 105

102:         <%= String.format(lang.getString("querydatafor"), cleanQuery, 
databaseType) %>
103:     </h2>
104: 
105:     <% if (request.getParameter("vid") == null || 
Integer.parseInt(request.getParameter("vid")) == 0) { 
106:         if (query != null && !query.isEmpty()) {
107:             cleanQuery = query.replaceAll("\\<.*?>","").replaceAll("\"", 
"&quot;");
108:         }

Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    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.NumberFormatException: For input string: "null"
    java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    java.lang.Integer.parseInt(Integer.java:492)
    java.lang.Integer.parseInt(Integer.java:527)
    org.apache.jsp.queryResult_jsp._jspService(queryResult_jsp.java:543)
    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.

Original issue reported on code.google.com by jajwil...@gmail.com on 18 Dec 2014 at 12:01

GoogleCodeExporter commented 9 years ago
When you say "try to sort the query results in the ORDS", can you give a bit 
more detail about what you actually did?  Were you adding an ORDER BY clause to 
a query or clicking a column header, or something else, and which page were you 
on?

Original comment by marxjohn...@gmail.com on 19 Dec 2014 at 9:12

GoogleCodeExporter commented 9 years ago
Clicking a column heading. This was on the second page of results, but I seem 
to recall the same crash when I did it on the first page of results as well.

Original comment by jajwil...@gmail.com on 19 Dec 2014 at 9:19

GoogleCodeExporter commented 9 years ago
Thanks, can you give me the URL of the page you were on when you clicked the 
heading?

Original comment by marxjohn...@gmail.com on 19 Dec 2014 at 9:21

GoogleCodeExporter commented 9 years ago
Try this one in dev: 
https://dev.ords.ox.ac.uk/ordsProjectNode/queryResult.jsp?next=next&query=SELECT
%20countryname,%20capital,%20population%20FROM%20country%20WHERE%20population%3E
1000000%20order%20by%20%22population%22%20asc&dt=main&lid=342169&dbProjectId=342
162&rpp=null&pid=342171&sort=null&sortDirection=null

Original comment by jajwil...@gmail.com on 5 Jan 2015 at 10:32

GoogleCodeExporter commented 9 years ago
As Kristian's cleaned out the old dev databases, that link now longer works 
(either because it's gone, or because I'm no longer a member of the project).  
Please could you re-create the issue and add me to the project (you'll probably 
need to post the new URL too).

Original comment by marxjohn...@gmail.com on 8 Jan 2015 at 9:57

GoogleCodeExporter commented 9 years ago
Ah, it seems that this only occurs immediately after you define a query - not 
when you later return to a saved query.

Try going to 
https://dev.ords.ox.ac.uk/ordsProjectNode/db.jsp?dbProjectId=508939&lid=508949&p
id=508959&dt=main and create a query using the SQL tool. Go for SELECT * FROM 
city WHERE population>1000000.

Then try to sort the results by clicking on a field name. The system will then 
crash as reported above.

Original comment by jajwil...@gmail.com on 8 Jan 2015 at 11:25

GoogleCodeExporter commented 9 years ago
This is now fixed

Original comment by marxjohn...@gmail.com on 8 Jan 2015 at 1:56