[
https://issues.apache.org/jira/browse/WOOKIE-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sebastian M updated WOOKIE-387:
-------------------------------
Description:
I'm currently using the flatpack export function. This function is intended to
allow exporting an widget instance and allowing to deploy it in any Wookie,
right? Unfortunately this is not working for me, when trying to deploy a
flatpack widget to another Wookie placed on another server.
Below are the steps to reproduce the behaviour. You need two Wookies with
different databases, a tool like curl to make some API requests and a test
widget which is not deployed to any Wookie beforehand:
1) run Wookie A and deploy the test widget there (I used a test widget with the
ID "http://wookie.apache.org/widgets/tabletest" in my example)
2) create an instance of this widget by passing the instance params via POST
request to /wookie/widgetinstances, like the following curl command example
does:
curl -X POST -d
"api_key=TEST&userid=iwcTraining&widgetid=http%3A%2F%2Fwookie.apache.org%2Fwidgets%2Ftabletest&"
"http://localhost:8080/wookie/widgetinstances"
3) get the flatpack URL of the test widget by passing the same instance params
(or just the instance id) to /wookie/flatpack, like the following curl command
example does:
curl -X POST -d
"api_key=TEST&userid=iwcTraining&widgetid=http%3A%2F%2Fwookie.apache.org%2Fwidgets%2Ftabletest&"
"http://localhost:8080/wookie/flatpack"
4) download the flatpack from the URL, which the response returns
5) exit Wookie A and run Wookie B (or simply run them on different machines and
switch to Wookie B now)
6) deploy the just downloaded flatpack of Wookie A to Wookie B. Wookie B must
not have the widget in the database beforehand. If it does, everything works as
expected.
7) try to create an instance using the same request like in the 2nd step
expected: get a instance identifier, width, height, ...
actually: you get an error page, including this error line:
[java] Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: The
statement was aborted because it would have caused a duplicate key value in a
unique or primary key constraint or unique index identified by 'UNPREFERENCE1'
defined on 'PREFERENCE'. {prepstmnt 2951301 INSERT INTO JAVA.Preference (ID,
JPA_VERSION, WIDGET_INSTANCE_ID, DKEY, DVALUE, READONLY) VALUES (?, ?, ?, ?, ?,
?) [params=(int) 504, (int) 1, (int) 452, (String) sharedDataKey, (Reader)
java.io.StringReader@7eda49, (String) t]} [code=20000, state=23505]
When removing the preference with the name "sharedDataKey" before redeploying
the flatpack helps. But I guess this is not intended behaviour, right?
I am running the latest svn code from the server on both Wookies.
I hope you can help me in solving this issue. Thank you in advance!
was:
I'm currently using the flatpack export function. This function is intended to
allow exporting an widget instance and allowing to deploy it in any Wookie,
right? Unfortunately this is not working for me, when trying to deploy a
flatpack widget to another Wookie placed on another server.
Below are the steps to reproduce the behaviour. You need two Wookies with
different databases, a tool like curl to make some API requests and a test
widget which is not deployed to any Wookie beforehand:
1) run Wookie A and deploy the test widget there (I used a test widget with the
ID "http://wookie.apache.org/widgets/tabletest" in my example)
2) create an instance of this widget by passing the instance params via POST
request to /wookie/widgetinstances, like the following curl command example
does:
curl -X POST -d
"api_key=TEST&userid=iwcTraining&widgetid=http%3A%2F%2Fwww.sap.com%2Fwidgets%2Fsendsms-developergarden&"
"http://localhost:8080/wookie/widgetinstances"
3) get the flatpack URL of the test widget by passing the same instance params
(or just the instance id) to /wookie/flatpack, like the following curl command
example does:
curl -X POST -d
"api_key=TEST&userid=iwcTraining&widgetid=http%3A%2F%2Fwww.sap.com%2Fwidgets%2Fsendsms-developergarden&"
"http://localhost:8080/wookie/flatpack"
4) download the flatpack from the URL, which the response returns
5) exit Wookie A and run Wookie B (or simply run them on different machines and
switch to Wookie B now)
6) deploy the just downloaded flatpack of Wookie A to Wookie B. Wookie B must
not have the widget in the database beforehand. If it does, everything works as
expected.
7) try to create an instance using the same request like in the 2nd step
expected: get a instance identifier, width, height, ...
actually: you get an error page, including this error line:
[java] Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: The
statement was aborted because it would have caused a duplicate key value in a
unique or primary key constraint or unique index identified by 'UNPREFERENCE1'
defined on 'PREFERENCE'. {prepstmnt 2951301 INSERT INTO JAVA.Preference (ID,
JPA_VERSION, WIDGET_INSTANCE_ID, DKEY, DVALUE, READONLY) VALUES (?, ?, ?, ?, ?,
?) [params=(int) 504, (int) 1, (int) 452, (String) sharedDataKey, (Reader)
java.io.StringReader@7eda49, (String) t]} [code=20000, state=23505]
When removing the preference with the name "sharedDataKey" before redeploying
the flatpack helps. But I guess this is not intended behaviour, right?
I am running the latest svn code from the server on both Wookies.
I hope you can help me in solving this issue. Thank you in advance!
> deploying flatpack to another wookie results in an error
> --------------------------------------------------------
>
> Key: WOOKIE-387
> URL: https://issues.apache.org/jira/browse/WOOKIE-387
> Project: Wookie
> Issue Type: Bug
> Reporter: Sebastian M
>
> I'm currently using the flatpack export function. This function is intended
> to allow exporting an widget instance and allowing to deploy it in any
> Wookie, right? Unfortunately this is not working for me, when trying to
> deploy a flatpack widget to another Wookie placed on another server.
> Below are the steps to reproduce the behaviour. You need two Wookies with
> different databases, a tool like curl to make some API requests and a test
> widget which is not deployed to any Wookie beforehand:
> 1) run Wookie A and deploy the test widget there (I used a test widget with
> the ID "http://wookie.apache.org/widgets/tabletest" in my example)
> 2) create an instance of this widget by passing the instance params via POST
> request to /wookie/widgetinstances, like the following curl command example
> does:
> curl -X POST -d
> "api_key=TEST&userid=iwcTraining&widgetid=http%3A%2F%2Fwookie.apache.org%2Fwidgets%2Ftabletest&"
> "http://localhost:8080/wookie/widgetinstances"
> 3) get the flatpack URL of the test widget by passing the same instance
> params (or just the instance id) to /wookie/flatpack, like the following curl
> command example does:
> curl -X POST -d
> "api_key=TEST&userid=iwcTraining&widgetid=http%3A%2F%2Fwookie.apache.org%2Fwidgets%2Ftabletest&"
> "http://localhost:8080/wookie/flatpack"
> 4) download the flatpack from the URL, which the response returns
> 5) exit Wookie A and run Wookie B (or simply run them on different machines
> and switch to Wookie B now)
> 6) deploy the just downloaded flatpack of Wookie A to Wookie B. Wookie B must
> not have the widget in the database beforehand. If it does, everything works
> as expected.
> 7) try to create an instance using the same request like in the 2nd step
> expected: get a instance identifier, width, height, ...
> actually: you get an error page, including this error line:
> [java] Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: The
> statement was aborted because it would have caused a duplicate key value in a
> unique or primary key constraint or unique index identified by
> 'UNPREFERENCE1' defined on 'PREFERENCE'. {prepstmnt 2951301 INSERT INTO
> JAVA.Preference (ID, JPA_VERSION, WIDGET_INSTANCE_ID, DKEY, DVALUE, READONLY)
> VALUES (?, ?, ?, ?, ?, ?) [params=(int) 504, (int) 1, (int) 452, (String)
> sharedDataKey, (Reader) java.io.StringReader@7eda49, (String) t]}
> [code=20000, state=23505]
> When removing the preference with the name "sharedDataKey" before redeploying
> the flatpack helps. But I guess this is not intended behaviour, right?
> I am running the latest svn code from the server on both Wookies.
> I hope you can help me in solving this issue. Thank you in advance!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira