AnsweredAssumed Answered

1.4 SVN patch-issues

Question asked by bartr on Sep 7, 2006
I came accross some issues when restarting alfresco with a new build from SVN (dated 6 september 2006). I hope this post helps others encountering the same problem. Be aware, though, that this is only the result of my own hacking; the Alfresco-team might have better solutions for these issues.

1) The AlfrescoSchemaUpdate-1.4-2.sql script caused a 'collation' error, because it tried to compare a pre-patch field, whose characterset was latin1, with a new field, whose characterset is set to utf-8 by the script. Why or how the old field was set to latin1 I don't know, but altering it to utf-8 did the trick for me. I used the script below to set all columns to utf8.

ALTER TABLE access_control_entry CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE access_control_list CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE applied_patch CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE auth_ext_keys CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE authority CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE child_assoc CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_action CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_bytearray CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_byteblock CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_comment CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_decisionconditions CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_delegation CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_event CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_exceptionhandler CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_log CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_message CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_moduledefinition CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_moduleinstance CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_node CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_pooledactor CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_processdefinition CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_processinstance CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_runtimeaction CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_swimlane CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_swimlaneinstance CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_task CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_taskactorpool CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_taskcontroller CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_taskinstance CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_timer CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_token CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_tokenvariablemap CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_transition CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_variableaccess CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE jbpm_variableinstance CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE node CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE node_aspects CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE node_assoc CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE node_properties CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE node_status CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE permission CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE store CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE version_count CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
2) The ActionRuleDecouplingPatch failed with a casting exception. It reads the rule-type property of a rule and casts it to a string, but rulemodel.xml defines this property as 'multiple', which is returned as an ArrayList. The patch below solved this issue for me.

Index: C:/projects/vt4/wshead_new/HEAD/root/projects/repository/source/java/org/alfresco/repo/admin/patch/impl/ActionRuleDecouplingPatch.java
===================================================================
— C:/projects/vt4/wshead_new/HEAD/root/projects/repository/source/java/org/alfresco/repo/admin/patch/impl/ActionRuleDecouplingPatch.java   (revision 211)
+++ C:/projects/vt4/wshead_new/HEAD/root/projects/repository/source/java/org/alfresco/repo/admin/patch/impl/ActionRuleDecouplingPatch.java   (working copy)
@@ -79,7 +79,7 @@
                 Map<QName, Serializable> newProperties = this.nodeService.getProperties(newRuleNodeRef);
                
                 // Set the rule type, execute async and applyToChildren properties on the rule
-                String ruleType = (String)origProperties.get(RuleModel.PROP_RULE_TYPE);
+                Serializable ruleType = origProperties.get(RuleModel.PROP_RULE_TYPE);
                 origProperties.remove(RuleModel.PROP_RULE_TYPE);
                 newProperties.put(RuleModel.PROP_RULE_TYPE, ruleType);
                 Boolean executeAsync = (Boolean)origProperties.get(ActionModel.PROP_EXECUTE_ASYNCHRONOUSLY);
3) Somehow I got some simple associations in the child-association table (probably caused by my own wrongdoing). The UniqueChildNamePath failed on this one. I simply removed these specific associations from the table (it's a test-installation).

Outcomes