Description of problem: Globally uncaught exception pinning drift definition to new template Version-Release number of selected component (if applicable): Steps to Reproduce: 1. create a new unpinned drift definition 2. try to pin to a new template 3. globally uncaught exception Actual results: globally uncaught exception Expected results: able to pin drift definition to new template Additional info: Message : Globally uncaught exception Severity : Error Time : Monday, November 14, 2011 10:50:09 AM Etc/GMT+5 Detail : com.google.gwt.core.client.JavaScriptException:(TypeError): this.org_rhq_enterprise_gui_coregui_client_drift_wizard_DriftPinTemplateWizard$1_this$0.org_rhq_enterprise_gui_coregui_client_drift_wizard_AbstractDriftPinTemplateWizard_selectedTemplate is null stack: org_rhq_enterprise_gui_coregui_client_drift_wizard_DriftPinTemplateWizard$1_onFailure__Ljava_lang_Throwable_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:108314 com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:9349 org_rhq_enterprise_gui_coregui_client_util_rpc_TrackingRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:168087 com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:4376 com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V([object XMLHttpRequest])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:4600 ([object Event])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:12659 com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2((function () {handler.onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(_this);}),[object XMLHttpRequest],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:2474 ([object Event])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:2463 handleEvent([object Event])@:0 SJOWContentBoundary()@:0 fileName: http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html lineNumber: 108314 --- STACK TRACE FOLLOWS --- (TypeError): this.org_rhq_enterprise_gui_coregui_client_drift_wizard_DriftPinTemplateWizard$1_this$0.org_rhq_enterprise_gui_coregui_client_drift_wizard_AbstractDriftPinTemplateWizard_selectedTemplate is null stack: org_rhq_enterprise_gui_coregui_client_drift_wizard_DriftPinTemplateWizard$1_onFailure__Ljava_lang_Throwable_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:108314 com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:9349 org_rhq_enterprise_gui_coregui_client_util_rpc_TrackingRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:168087 com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:4376 com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V([object XMLHttpRequest])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:4600 ([object Event])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:12659 com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2((function () {handler.onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(_this);}),[object XMLHttpRequest],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:2474 ([object Event])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html:2463 handleEvent([object Event])@:0 SJOWContentBoundary()@:0 fileName: http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/773803C56DFCFDC893991F3507D1670C.cache.html lineNumber: 108314 at Unknown.org_rhq_enterprise_gui_coregui_client_drift_wizard_DriftPinTemplateWizard$1_onFailure__Ljava_lang_Throwable_2V(Unknown source:0) at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0) at Unknown.org_rhq_enterprise_gui_coregui_client_util_rpc_TrackingRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0) at Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown source:0) at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown source:0) at Unknown.anonymous(Unknown source:0) at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown source:0) at Unknown.anonymous(Unknown source:0) at Unknown.handleEvent(Unknown source:0) at Unknown.SJOWContentBoundary(Unknown source:0) at Unknown.anonymous(Unknown source:0)
Created attachment 533559 [details] image of client-side error
Created attachment 533560 [details] text of client-side error
server-side exception: 2011-11-14 10:50:08,808 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: unique constraint (RHQ.RHQ_DRIFT_DEF_TEMPLATE_UNIQUE) violated 2011-11-14 10:50:08,808 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1, SQLState: 23000 2011-11-14 10:50:08,808 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: unique constraint (RHQ.RHQ_DRIFT_DEF_TEMPLATE_UNIQUE) violated 2011-11-14 10:50:08,808 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session org.hibernate.exce
Created attachment 533561 [details] server logs
The underlying problem here is that template names for a resource type have to be unique. There currently is no validation in place to enforce this. I have made three changes that provide validation: 1) Add validation check in DriftTemplateManagerBean.createTemplate. An IllegalArgumentException is thrown if the name is a duplicate. This handles calls through the remote api as well as through the UI. 2) Add a validation check to the wizard in the drift templates view. If you specify a duplicate name, the name field is flagged as being in error when you click finish. The hover text says that the name must be unique. 3) Add the same validation check as in 2) to the wizard for pinning a snapshot to a template. master commit hash: 2594fa3706f30dd43c7aa566a6f4b5154ffdc863 release_jon3.x commit hash: 29ee2dea37ab4a2720f7d4dd5926acdeb37d4588
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE