You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by "Scott Wilson (JIRA)" <ji...@apache.org> on 2012/10/25 08:22:12 UTC

[jira] [Commented] (WOOKIE-387) deploying flatpack to another wookie results in an error

    [ https://issues.apache.org/jira/browse/WOOKIE-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483925#comment-13483925 ] 

Scott Wilson commented on WOOKIE-387:
-------------------------------------

This is caused by the "sharedDataKey" preference, which is really an internal value that we exposed for reasons that now no longer apply.

If there are no objections, I propose removing it from prefs, by removing the following from WidgetInstanceFactory.addNewWidgetInstance:

		// add in the sharedDataKey as a preference so that a widget can know
		// what sharedData event to listen to later
		setPreference(persistenceManager, widgetInstance, "sharedDataKey", sharedDataKey, true);//$NON-NLS-1$

If there is any reason we want to have the shareddatakey accessible from within the widget, we can provide it as part of either (a) the widget metadata object or (b) the Wookie Extensions feature. However, it definitely isn't used by any current widgets we ship.


                
> 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
>    Affects Versions: 0.11.0
>            Reporter: Sebastian M
>             Fix For: 0.13.0
>
>
> 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