« Return to Thread: Problem with Rest API in 1.9.2?
Hi,
I installed sonar 1.9.2 and everything seems to work
fine. The results on the webpage running on localhost are all ok.
If I now try to access the rest api (as mentioned in
the developer wiki) with http://localhost:9000/api/resources?metrics=ncss
I get an error (see below). I tested this on a machine running Windows XP and
Mac OS 10.5.6.
If I issue the same command on the public instance (http://nemo.sonar.codehaus.org/api/resources?metrics=ncss)
it seems to work. Nemo is running 1.9.1 which is not available from the
download pages. I can’t test it on 1.9 since my corporate firewall does
not allow me to download it.
Any ideas what could be wrong (either with my
installation or 1.9.2 J
? )
Thanks, Oliver
ActiveRecord::StatementInvalid in
Api/resourcesController#index
ActiveRecord::ActiveRecordError: Syntax error:
Encountered "NULL" at line 1, column 1133.: SELECT
project_measures.id AS t0_r0, project_measures.value AS t0_r1,
project_measures.metric_id AS t0_r2, project_measures.snapshot_id AS t0_r3,
project_measures.rule_id AS t0_r4, project_measures.rules_category_id AS t0_r5,
project_measures.text_value AS t0_r6, project_measures.tendency AS t0_r7,
project_measures.measure_date AS t0_r8, project_measures.project_id AS t0_r9,
project_measures.alert_status AS t0_r10, project_measures.alert_text AS t0_r11,
project_measures.url AS t0_r12, project_measures.description AS t0_r13,
snapshots.id AS t1_r0, snapshots.created_at AS t1_r1, snapshots.project_id AS
t1_r2, snapshots.parent_snapshot_id AS t1_r3, snapshots.status AS t1_r4, snapshots.purged
AS t1_r5, snapshots.islast AS t1_r6, snapshots.scope AS t1_r7,
snapshots.qualifier AS t1_r8, snapshots.root_snapshot_id AS t1_r9,
snapshots.version AS t1_r10, snapshots.path AS t1_r11, snapshots.depth AS
t1_r12 FROM project_measures LEFT OUTER JOIN snapshots ON snapshots.id =
project_measures.snapshot_id WHERE (snapshots.islast=1 AND snapshots.scope in
('PRJ') AND snapshots.qualifier in ('TRK') AND project_measures.metric_id IN
(NULL) AND project_measures.rule_id IS NULL AND project_measures.rules_category_id
IS NULL)
RAILS_ROOT:
C:\Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF
Application Trace | Framework Trace | Full Trace
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in
`log'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-0.9/lib/active_record/connection_adapters/jdbc_adapter.rb:581:in
`execute'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/associations.rb:1646:in
`select_all_rows'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/associations.rb:1426:in
`find_with_associations'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/associations.rb:1424:in
`catch'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/associations.rb:1424:in
`find_with_associations'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/base.rb:1488:in
`find_every'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/base.rb:589:in
`find'
app/controllers/api/resources_controller.rb:96:in
`index'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in
`perform_action'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in
`call_filters'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in
`perform_action_with_filters'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_with_benchmark'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_with_benchmark'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in
`perform_action_with_rescue'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in
`perform_action_with_caching'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
`cache'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in
`cache'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in
`perform_action_with_caching'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in
`process'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in
`process_with_filters'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in
`process_with_session_management_support'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in
`process'
:1
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-complete-1.2.0.jar!/benchmark.rb:293:in
`measure'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in
`handle_request'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in
`dispatch_unlocked'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:120:in
`dispatch'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in
`dispatch_cgi'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in
`dispatch'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/adapter/rails_cgi.rb:24:in
`call'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/adapter/rails.rb:35:in
`serve_rails'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/adapter/rails.rb:40:in
`call'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/jruby/rack/rails.rb:144:in
`call'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/handler/servlet.rb:17:in
`call'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in
`log'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-jdbc-adapter-0.9/lib/active_record/connection_adapters/jdbc_adapter.rb:581:in
`execute'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/associations.rb:1646:in
`select_all_rows'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/associations.rb:1426:in
`find_with_associations'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/associations.rb:1424:in
`catch'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/associations.rb:1424:in
`find_with_associations'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/base.rb:1488:in
`find_every'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/base.rb:589:in
`find'
app/controllers/api/resources_controller.rb:96:in
`index'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in
`perform_action'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in
`call_filters'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in
`perform_action_with_filters'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_with_benchmark'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-complete-1.2.0.jar!/benchmark.rb:293:in
`measure'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_with_benchmark'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in
`perform_action_with_rescue'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in
`perform_action_with_caching'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
`cache'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in
`cache'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in
`perform_action_with_caching'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in
`process'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in
`process_with_filters'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in
`process_with_session_management_support'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in
`process'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in
`handle_request'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in
`dispatch_unlocked'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:120:in
`dispatch'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in
`dispatch_cgi'
C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in
`dispatch'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/adapter/rails_cgi.rb:24:in
`call'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/adapter/rails.rb:35:in
`serve_rails'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/adapter/rails.rb:40:in
`call'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/jruby/rack/rails.rb:144:in
`call'
file:/C:/Apps/sonar-1.9.2/sonar-1.9.2/war/sonar-web/WEB-INF/lib/jruby-rack-0.9.4.jar!/rack/handler/servlet.rb:17:in
`call'
:1
Request
Parameters:
{"metrics"=>"ncss",
"scopes"=>"PRJ",
"qualifiers"=>"TRK"}
Show session dump
---
flash: !map:ActionController::Flash::FlashHash {}
:return_to:
:user_id: 1
Response
Headers:
{"Cache-Control"=>"no-cache",
"cookie"=>[],
"Content-Type"=>""}
« Return to Thread: Problem with Rest API in 1.9.2?
| Free embeddable forum powered by Nabble | Forum Help |