Hi,
I have reported this on Jira but seems like it is not a bug so I if someone knows a reason, I'd appreciate it very much :-)
I am trying to upload custom JDBC datasource (PostgreSQL) using Pentaho REST API. This is what I've done:
1. Went to http://mysite.com/pentaho/plugin/dat...ing_connection and got xml content for existing datasource
2. Converted this xml to json and made some changes:
a) changed "true"/"false" to true/false, otherwise I get "java.lang.String cannot be cast to java.lang.Boolean"
b) changed "attributes": {"entry": {"key": "PORT_NUMBER","value": "5432"}} to "attributes": "", otherwise I get java.util.HashMap cannot be cast to java.lang.String
c) changed name to some custom new name
d) removed "databaseConnection" part ("databaseConnection":
{ and }) and "id" part
3 Using curl, I have successfully uploaded datasource using a comand like this:
curl -v -X PUT -H "Content-Type: application/json" --user admin:password -d "@/new_json_file.json" http://mysite.com/pentaho/plugin/dat...new_connection
4. Went to Pentaho UI -> Datasources and found the newly created datasource
5. Tried to edit this datasource and got "Unknown error has occurred" with no traces in catalina.out or pentaho.log
Note: if I upload a datasource that was previously created in UI and then deleted, I can edit it in UI. So I am obviously missing something but don't know what.
The whole stuff is reported here: http://jira.pentaho.com/browse/BISERVER-13454
Thanks very much for any hint
regards, dejan
I have reported this on Jira but seems like it is not a bug so I if someone knows a reason, I'd appreciate it very much :-)
I am trying to upload custom JDBC datasource (PostgreSQL) using Pentaho REST API. This is what I've done:
1. Went to http://mysite.com/pentaho/plugin/dat...ing_connection and got xml content for existing datasource
2. Converted this xml to json and made some changes:
a) changed "true"/"false" to true/false, otherwise I get "java.lang.String cannot be cast to java.lang.Boolean"
b) changed "attributes": {"entry": {"key": "PORT_NUMBER","value": "5432"}} to "attributes": "", otherwise I get java.util.HashMap cannot be cast to java.lang.String
c) changed name to some custom new name
d) removed "databaseConnection" part ("databaseConnection":
{ and }) and "id" part
3 Using curl, I have successfully uploaded datasource using a comand like this:
curl -v -X PUT -H "Content-Type: application/json" --user admin:password -d "@/new_json_file.json" http://mysite.com/pentaho/plugin/dat...new_connection
4. Went to Pentaho UI -> Datasources and found the newly created datasource
5. Tried to edit this datasource and got "Unknown error has occurred" with no traces in catalina.out or pentaho.log
Note: if I upload a datasource that was previously created in UI and then deleted, I can edit it in UI. So I am obviously missing something but don't know what.
The whole stuff is reported here: http://jira.pentaho.com/browse/BISERVER-13454
Thanks very much for any hint
regards, dejan