Bug 753827

Summary: Globally uncaught exception pinning drift definition to new template
Product: [Other] RHQ Project Reporter: Mike Foley <mfoley>
Component: driftAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: medium    
Version: 4.2CC: jsanda
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 19:20:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 707225    
Attachments:
Description Flags
image of client-side error
none
text of client-side error
none
server logs none

Description Mike Foley 2011-11-14 16:07:13 UTC
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)

Comment 1 Mike Foley 2011-11-14 16:08:04 UTC
Created attachment 533559 [details]
image of client-side error

Comment 2 Mike Foley 2011-11-14 16:08:57 UTC
Created attachment 533560 [details]
text of client-side error

Comment 3 Mike Foley 2011-11-14 16:10:01 UTC
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

Comment 4 Mike Foley 2011-11-14 16:10:52 UTC
Created attachment 533561 [details]
server logs

Comment 5 John Sanda 2011-11-16 15:52:55 UTC
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

Comment 6 Mike Foley 2012-02-07 19:20:38 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE