Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5264A17F73 for ; Sun, 26 Apr 2015 09:25:23 +0000 (UTC) Received: (qmail 15893 invoked by uid 500); 26 Apr 2015 09:25:23 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 15857 invoked by uid 500); 26 Apr 2015 09:25:23 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 15843 invoked by uid 99); 26 Apr 2015 09:25:22 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Apr 2015 09:25:22 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id ADA471CA928; Sun, 26 Apr 2015 09:25:23 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8693026402055250777==" MIME-Version: 1.0 Subject: Re: Review Request 33553: Views: IllegalAccessError: tried to access class From: "Nate Cole" To: "Nate Cole" , "Jonathan Hurley" Cc: "Ambari" , "Tom Beerbower" Date: Sun, 26 Apr 2015 09:25:23 -0000 Message-ID: <20150426092523.26755.69403@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Nate Cole" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/33553/ X-Sender: "Nate Cole" References: <20150425183110.2948.91628@reviews.apache.org> In-Reply-To: <20150425183110.2948.91628@reviews.apache.org> Reply-To: "Nate Cole" X-ReviewRequest-Repository: ambari --===============8693026402055250777== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33553/#review81614 ----------------------------------------------------------- Ship it! Ship It! - Nate Cole On April 25, 2015, 2:31 p.m., Tom Beerbower wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/33553/ > ----------------------------------------------------------- > > (Updated April 25, 2015, 2:31 p.m.) > > > Review request for Ambari, Jonathan Hurley and Nate Cole. > > > Bugs: AMBARI-10748 > https://issues.apache.org/jira/browse/AMBARI-10748 > > > Repository: ambari > > > Description > ------- > > The main objective here is to make sure that we can include classes and jars in a view that don't conflict other versions of those classes used by Ambari. We also want to make sure that there aren't any other obstacles that prevent us from deploying Spring web apps as views. So far, I've found the following issues that need to be addressed to support Spring apps as views... > > 1. Class loading order. The classes in the WEB-INF/lib or WEB-INF/classes should have priority over classes on the parent class loader. There is a bug here. The fix involves minimal changes and is minimal risk, I think. Fixing the ClassLoader issue gets past the IllegalAccessError but exposes a couple of other issues for Spring apps. > > 2. Ambari's embedded Jetty server not setup to support JSP. > 500 JSP support not configured > This is really just configuration (make javac available) and making sure that the right jsp dependencies (jsp-2.1-glassfish, ant, ant-launcher) are included for ambari-server. Again, changes and risk are minimal. This is not Spring specific since we should support JSPs in any view. > > 3. Ambari internal usage of Spring. We currently use Spring to setup the Ambari web app and we set this as the root context for all of the deployed view web apps ... > context.getServletContext().setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, springWebAppContext) > This results in the following exception because the root web app context is from a different version of Spring loaded by a different class loader... > java.lang.IllegalStateException: Context attribute is not of type WebApplicationContext: org.springframework.web.context.support.GenericWebApplicationContext@774189d0: startup date [Thu Jan 01 00:00:00 UTC 1970]; parent: org.springframework.context.support.ClassPathXmlApplicationContext@318511f0 > at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:124) > at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:99) > at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:514) > at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484) > at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) > at javax.servlet.GenericServlet.init(GenericServlet.java:241) > > > Diffs > ----- > > ambari-project/pom.xml 12ae96c > ambari-server/pom.xml 896a202 > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java 7c68311 > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java 8b767d7 > ambari-server/src/main/java/org/apache/ambari/server/controller/FailsafeHandlerList.java 26395cc > ambari-server/src/main/java/org/apache/ambari/server/controller/FailsafeServletResponse.java 094c4c5 > ambari-server/src/main/java/org/apache/ambari/server/view/ViewArchiveUtility.java 8720d7c > ambari-server/src/main/java/org/apache/ambari/server/view/ViewClassLoader.java PRE-CREATION > ambari-server/src/main/java/org/apache/ambari/server/view/ViewExtractor.java fdce03c > ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariHandlerListTest.java 04a4b15 > ambari-server/src/test/java/org/apache/ambari/server/controller/FailsafeHandlerListTest.java 8d1ba0d > ambari-server/src/test/java/org/apache/ambari/server/controller/FailsafeServletResponseTest.java 249a3f5 > ambari-server/src/test/java/org/apache/ambari/server/view/ViewClassLoaderTest.java PRE-CREATION > > Diff: https://reviews.apache.org/r/33553/diff/ > > > Testing > ------- > > Manual testing with a Spring app view and existing view examples. > > New unit tests added. > > All existing tests pass ... > > [INFO] ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] ------------------------------------------------------------------------ > [INFO] Total time: 37:54 min > [INFO] Finished at: 2015-04-25T07:34:25-04:00 > [INFO] Final Memory: 52M/571M > [INFO] ------------------------------------------------------------------------ > > > Thanks, > > Tom Beerbower > > --===============8693026402055250777==--