raindarr / wattdepot

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

Source summary with Postgres produces error in log #102

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Go to 
http://server.wattdepot.org:8194/wattdepot/sources/Ilima-04-lounge/summary

The XML returned looks correct, but in the server log I see:

2012/04/05 13:18:52  DB: Error in 
getSourceSummary()org.postgresql.util.PSQLException: ERROR: syntax error at or 
near ")"
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
    at org.wattdepot.server.db.postgres.PostgresStorageImplementation.getSourceSummary(PostgresStorageImplementation.java:878)
    at org.wattdepot.server.db.DbManager.getSourceSummary(DbManager.java:156)
    at org.wattdepot.resource.WattDepotResource.getSourceSummary(WattDepotResource.java:343)
    at org.wattdepot.resource.source.summary.SourceSummaryResource.get(SourceSummaryResource.java:31)
    at org.restlet.resource.ServerResource.doHandle(ServerResource.java:527)
    at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:587)
    at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:299)
    at org.restlet.resource.ServerResource.handle(ServerResource.java:846)
    at org.restlet.resource.Finder.handle(Finder.java:510)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.routing.Router.doHandle(Router.java:497)
    at org.restlet.routing.Router.handle(Router.java:737)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
    at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:72)
    at org.restlet.Application.handle(Application.java:388)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.routing.Router.doHandle(Router.java:497)
    at org.restlet.routing.Router.handle(Router.java:737)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.routing.Router.doHandle(Router.java:497)
    at org.restlet.routing.Router.handle(Router.java:737)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.routing.Filter.doHandle(Filter.java:156)
    at org.restlet.routing.Filter.handle(Filter.java:203)
    at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
    at org.restlet.Component.handle(Component.java:388)
    at org.restlet.Server.handle(Server.java:488)
    at org.restlet.engine.http.connector.BaseServerHelper.handle(BaseServerHelper.java:158)
    at org.restlet.engine.http.connector.BaseServerHelper.handleInbound(BaseServerHelper.java:167)
    at org.restlet.engine.http.connector.BaseHelper.handleNextInbound(BaseHelper.java:418)
    at org.restlet.engine.http.connector.Connection.readMessages(Connection.java:695)
    at org.restlet.engine.http.connector.Controller$2.run(Controller.java:95)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)

Looks like our unit test for the SourceSummary resource needs improvement, 
though if the returned XML is good, it looks like a client-side test would not 
be able to catch it.

Original issue reported on code.google.com by rbre...@gmail.com on 5 Apr 2012 at 11:25

GoogleCodeExporter commented 8 years ago
Having trouble reproducing this problem with Ilima-04-lounge, but I can get it 
to occur for a virtual source with no non-virtual subsources. It is possible 
that the sources weren't set up correctly when this test was run, relating to 
Issue 101. 

Fixing the dbImplementation code so that if there are no non-virtual 
subsources, an empty summary (with zero sensor datas) is returned. 

Original comment by AndreaMC...@gmail.com on 26 Apr 2012 at 8:53

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 4ffe630d52dd.

Original comment by AndreaMC...@gmail.com on 26 Apr 2012 at 9:40