Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 586068 - Overview->Subsystem->OOB view is broken
Overview->Subsystem->OOB view is broken
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
3.0.0
All Linux
urgent Severity medium (vote)
: ---
: ---
Assigned To: John Sanda
Corey Welton
: Reopened
Depends On:
Blocks: jon-sprint10-bugs
  Show dependency treegraph
 
Reported: 2010-04-26 14:20 EDT by Heiko W. Rupp
Modified: 2010-08-12 12:50 EDT (History)
1 user (show)

See Also:
Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-12 12:50:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2010-04-26 14:20:08 EDT
Description of problem:

Navigate to Overview->SubsystemView->Suspect metrics

See it bomb with 


UnsupportedOperationException
ERROR: GWT.create() is only usable in client code! It cannot be called, for example, from server code. If you are running a unit test, check that your test case extends GWTTestCase and that GWT.create() is not called from within an initializer or constructor.

or

javax.faces.FacesException: javax.el.ELException: /rhq/subsystem/oobHistory.xhtml @117,79 value="#{item.original.formattedBaseband}": Error reading 'formattedBaseband' on type org.rhq.core.domain.measurement.composite.MeasurementOOBComposite at 

javax.faces.component.UIOutput.getValue(UIOutput.java:184) ... 86 more Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.google.gwt.i18n.client.NumberFormat at org.rhq.core.domain.measurement.MeasurementConverterClient.format(MeasurementConverterClient.java:220) at org.rhq.core.domain.measurement.MeasurementConverterClient.format(MeasurementConverterClient.java:200) at org.rhq.core.domain.measurement.composite.MeasurementOOBComposite.getFormattedBaseband(MeasurementOOBComposite.java:166) 


console log:

Caused by: javax.el.ELException: /rhq/subsystem/oobHistory.xhtml @117,79 value="#{item.original.formattedBaseband}": Error reading 'formattedBaseband' on type org.rhq.core.domain.measurement.composite.MeasurementOOBComposite
        at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
        at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
        ... 86 more
Caused by: java.lang.ExceptionInInitializerError
        at com.google.gwt.i18n.client.NumberFormat.<clinit>(NumberFormat.java:310)
        at org.rhq.core.domain.measurement.MeasurementConverterClient.format(MeasurementConverterClient.java:220)
        at org.rhq.core.domain.measurement.MeasurementConverterClient.format(MeasurementConverterClient.java:200)
        at org.rhq.core.domain.measurement.composite.MeasurementOOBComposite.getFormattedBaseband(MeasurementOOBComposite.java:166)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
        at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
        at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
        at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
        at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
        at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
        at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
        ... 87 more
Caused by: java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable in client code!  It cannot be called, for example, from server code.  If you are running a unit test, check that your test case extends GWTTestCase and that GWT.create() is not called from within an initializer or constructor.
        at com.google.gwt.core.client.GWT.create(GWT.java:92)
        at com.google.gwt.i18n.client.LocaleInfo.<clinit>(LocaleInfo.java:35)
        ... 102 more
Comment 1 Charles Crouch 2010-04-26 16:29:33 EDT
Greg, can you see whats going on here and if necessary turn back on the old jsf OOB subsystem view
Comment 2 Joseph Marques 2010-04-27 16:58:35 EDT
Charles, the exception is happening *on* the JSF-based subsystem view.  One of the OOB columns uses a class called MeasurementConverterClient in core/domain, which references a GWT client class.  In JSF-land, all of the page render logic is executed server-side, and then serialized out to the client as HTML.  The GWT error is very accurate:

"UnsupportedOperationException
ERROR: GWT.create() is only usable in client code! It cannot be called, for
example, from server code. If you are running a unit test, check that your test
case extends GWTTestCase and that GWT.create() is not called from within an
initializer or constructor."

I'm guessing that Greg used the NumberFormat in GWT because the standard guy in javax.text was not GWT-compile-able.
Comment 3 Charles Crouch 2010-05-12 12:25:17 EDT
John can you work on this, pinging Greg as necessary.
Comment 4 John Sanda 2010-05-14 13:27:07 EDT
This must have been resolved since it was initially reported. I am not able to reproduce the error reported. I am able to bring up all of the subsystem views and perform filtering/searching.
Comment 5 John Sanda 2010-05-21 15:30:51 EDT
Removed GWT dependency from MeasurementOOBComposite.

commit hash: aeebeea6b406adbcfbb9fa246df7aa56564eb5c5
Comment 6 John Sanda 2010-05-24 11:32:45 EDT
It has been pointed out by Joseph Marques that my solution is problematic because it uses a formatter from java.text, and classes in java.text cannot be used in GWT code. The class in question, MeasurementOOBComposite, is currently not used in the GWT UI, but it eventually will be once the JSF view(s) where it is used are ported. In light of this, the formatting code needs to be moved to a layer outside of the core/domain module since those classes are used in both GWT and non-GWT code.

In addition to the code changes, I am going to add checkstyle to the build so that we can flag usage of "restricted" classes/packages.

I am moving this back to ASSIGNED until these changes are complete.
Comment 7 John Sanda 2010-05-24 13:50:56 EDT
Moved the java.text formatting dependencies out of core/domain and into server/jar. The SLSB methods that return the MeasurementOOBComposite objects now do the formatting and pass the results to the MeasurementOOBComposite objects. The GWT text formatting dependencies have been moved into the coregui module.

commit hash: 797f13a4df3a2c1798649557c9911682e3e0b9b8
Comment 8 Corey Welton 2010-05-27 08:52:38 EDT
QA Verified.
Comment 9 Corey Welton 2010-08-12 12:50:12 EDT
Mass-closure of verified bugs against JON.

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