Bug 753180 - [webadmin] in dev mode create new host fails
Summary: [webadmin] in dev mode create new host fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-webadmin
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.1
Assignee: Tomas Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-11 14:39 UTC by Tomas Jelinek
Modified: 2012-08-09 08:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-09 08:05:52 UTC
oVirt Team: ---


Attachments (Terms of Use)

Description Tomas Jelinek 2011-11-11 14:39:56 UTC
Version-Release number of selected component (if applicable):
the git commit where this happens: 265e3867fc4d6c97546b5d88f791993cf915c4b1

Steps to Reproduce:
1. run webadmin in DEV mode
2. go to hosts->new
3. fill the form with correct data
4. press OK
5. confirm also the next dialog (press OK)
  
Actual results:
java.lang.ClassNotFoundException: org.ovirt.engine.core.common.validation.HostnameOrIPConstraint

in class AnnotationParser in method parseClassArray

Additional info:

This exception is thrown only the first time - if the window is not refreshed, and the steps to reproduce the error are performed again, the exception is not thrown. Also in web mode this exception is not thrown.

After some analyze it seems that the problem is, that during the submit the VdsStatic is about to be serialized and during the check, if it can be, also the ip field of this class is checked, if is not annotated with the @GwtTransient annotation. The ip field of this class is also annotated with the @HostnameOrIp annotation. This annotation references the HostnameOrIPConstraint, which does not exist, because it is not mentioned in the SharedGwt.gwt.xml. And it can not be mentioned in this file, because it references the ValidationUtils which references the java.util.regex.Pattern which is not emulated by GWT.

Comment 1 Tomas Jelinek 2011-11-14 10:46:04 UTC
The reason why it fails for the first time and not for the second one is as follows:
When the HostnameOrIp annotation is first time inspected, the sun.reflect.annotation.AnnotationType.getInstance is called which tries to get the AnnotationType from sun.misc.SharedSecrets. If it is not there yet, the new one is about to be created. The creation is as follows:
- first the methods are processed
- than the result is set to the SharedSecrets
- than the annotations of this annotation are processed
The last step fails, because of the class not found

When the class is second time inspected, the SharedSecrets already contains the annotation, so the logic which fails on class not found is not executed.

For me the following solution works:
the gwt-extension contains the HostnameOrIp class which overrides the one implemented in common and removes the payload() method for the client. When also the @Constraint(validatedBy = HostnameOrIPConstraint.class) is removed (which does not make sense to have it there on the front-end), the creation of the new host works fine for me.

Comment 2 Itamar Heim 2012-08-09 08:05:52 UTC
closing ON_QA bugs as oVirt 3.1 was released:
http://www.ovirt.org/get-ovirt/


Note You need to log in before you can comment on or make changes to this bug.