Fix components name to work with Java6 and Java7.
Add if statement to properly find AppContext.