Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-1006

ProxyServlet in web.xml breaks tomcat WAR (HA LBS)

    Details

      Description

      We do not bundle jetty with the WAR distribution. The existence of the HALoadBalancerServlet in web.xml drags in the jetty ProxyServlet which then results in a classpath error:

      SEVERE: Error deploying web application archive bigdata.war
      java.lang.NoClassDefFoundError: org/eclipse/jetty/proxy/ProxyServlet
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)
      	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
      	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
      	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
      	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
      	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
      	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
      	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
      	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
      	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
      	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
      	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
      	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.proxy.ProxyServlet
      	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
      	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      	... 33 more
      

      We probably need to use a meta-variable substitution or other mechanism (perhaps the jetty weboverride.xml?) to drag in the HA LBS only for jetty deployments.

      Further note that the HA deploy can not be run using the WAR.

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        Bug fix for BLZG-1006 (HA LBS breaks tomcat deployment).

        The root cause is that the ProxyServlet is not available under tomcat (or anything else besides jetty). Therefore it can not be configured from the same web.xml file that is used for other platforms.

        To address this, I extracted the HA LBS configuration into a new override-web.xml file and then modified the NanoSparqlServer to locate that resource.

        The HA test suite also needed to be modified to explictly locate this resource.

        See BLZG-1006 (HA LBS breaks tomcat deployment).

        Committed revision r8359.

        Show
        bryanthompson bryanthompson added a comment - Bug fix for BLZG-1006 (HA LBS breaks tomcat deployment). The root cause is that the ProxyServlet is not available under tomcat (or anything else besides jetty). Therefore it can not be configured from the same web.xml file that is used for other platforms. To address this, I extracted the HA LBS configuration into a new override-web.xml file and then modified the NanoSparqlServer to locate that resource. The HA test suite also needed to be modified to explictly locate this resource. See BLZG-1006 (HA LBS breaks tomcat deployment). Committed revision r8359.
        Hide
        bryanthompson bryanthompson added a comment -

        I have refactored the declaration of the HAJournalServlet into the override-web.xml file. This is a jetty only file, which is appropriate for a jetty-only capability. I have added a line to locate the override-web.xml file to jetty.xml. This is passing the local test suites (NSS, HA LBS).

        Test Embedded NSS sample code. Ok.

        Test NSS main from eclipse. Ok.

        Test NSS main from ant script (e.g., lubm): Failing to locate override-web.xml. Looks like there might be a trailing / that is causing problems before appending /WEB-INF/override-web.xml to jetty.resourceBase. Yep. Works with "WEB-INF/override-web.xml" instead. Now re-checking the test suites. Ok
        - this breaks the test suites. Changing the default to bigdata-war/src/ (trailing slash). Nope. That does not help either. I probably need to explicitly resolve this file against the file system and/or classpath, just like web.xml.... Ok. It is working now.

        Test HA3 LBS suite. Required explicit set of the new jetty.overrideWebXml parameter to locate the resource.

        Test WAR. Ok.

        Update wiki documentation for the HA LBS. done.

        Show
        bryanthompson bryanthompson added a comment - I have refactored the declaration of the HAJournalServlet into the override-web.xml file. This is a jetty only file, which is appropriate for a jetty-only capability. I have added a line to locate the override-web.xml file to jetty.xml. This is passing the local test suites (NSS, HA LBS). Test Embedded NSS sample code. Ok. Test NSS main from eclipse. Ok. Test NSS main from ant script (e.g., lubm): Failing to locate override-web.xml. Looks like there might be a trailing / that is causing problems before appending /WEB-INF/override-web.xml to jetty.resourceBase. Yep. Works with "WEB-INF/override-web.xml" instead. Now re-checking the test suites. Ok - this breaks the test suites. Changing the default to bigdata-war/src/ (trailing slash). Nope. That does not help either. I probably need to explicitly resolve this file against the file system and/or classpath, just like web.xml.... Ok. It is working now. Test HA3 LBS suite. Required explicit set of the new jetty.overrideWebXml parameter to locate the resource. Test WAR. Ok. Update wiki documentation for the HA LBS. done.

          People

          • Assignee:
            thompsonbry thompsonbry
            Reporter:
            bryanthompson bryanthompson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: