You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Tom Beerbower <tb...@hortonworks.com> on 2015/05/06 19:37:22 UTC

Review Request 33901: Views: @Inject using com.google.inject.Inject is broken.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33901/
-----------------------------------------------------------

Review request for Ambari, Jonathan Hurley and Nate Cole.


Bugs: AMBARI-10965
    https://issues.apache.org/jira/browse/AMBARI-10965


Repository: ambari


Description
-------

There was a class loader change that makes the view load the classes from the view loader first then from the parent. I think that the view framework is loading the Inject annotation from the parent class loader while the view itself is now loading the inject annotation from the view loader.
The javax classes are an exception... always loaded from the parent, so 'import javax.inject.Inject' works while 'import com.google.inject.Inject ' does not.
My example using the java inject annotation works, the Slider and Hive views using the google annotation do not.
Bottom line is that @Inject into view components is broken if they use the google inject annotation.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/view/ViewClassLoader.java ad8c805 
  ambari-server/src/test/java/org/apache/ambari/server/view/ViewClassLoaderTest.java 3a9ecd3 

Diff: https://reviews.apache.org/r/33901/diff/


Testing
-------

Tested manually with Slider view.

Added new case for view class loader unit test.


Thanks,

Tom Beerbower