• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • other
    • None
    • Platform: Sun, OS: All

      -bash-3.00$ java -jar hudson.war
      [Winstone 2007/03/30 10:01:41] - Beginning extraction from war file
      [Winstone 2007/03/30 10:05:30] - No webapp classes folder found - /var/tmp/winstone/hudson.war/
      WEB-INF/classes
      hudson home directory: /homes/theuser/.hudson
      Mar 30, 2007 10:05:31 AM hudson.TcpSlaveAgentListener <init>
      INFO: JNLP slave agent listener started on TCP port 62592
      [Winstone 2007/03/30 10:05:32] - HTTP Listener started: port=8080
      [Winstone 2007/03/30 10:05:32] - AJP13 Listener started: port=8009

      (note that this machine has never run hudson before)

      It takes almost 5 minutes to extract the war file, on my windows pc it takes about 10 seconds.

      truss seems to indicate that the process is waiting for something, below output is repeated over and
      over again:

      /10: lwp_cond_wait(0x00034EE0, 0x00034EC8, 0xB3E7FBC8, 0) Err#62 ETIME
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0
      /18: pollsys(0x00000000, 0, 0xB367FBF0, 0x00000000) = 0

      The machine does not have direct internet access, perhaps an xml parser somewhere is trying to load
      DTDs or schemas ?

          [JENKINS-413] hudson starts slow on solaris

          Created an attachment (id=49)
          YourKit profiler data file

          Kohsuke Kawaguchi added a comment - Created an attachment (id=49) YourKit profiler data file

          Created an attachment (id=51)
          java.net.URL patch

          Kohsuke Kawaguchi added a comment - Created an attachment (id=51) java.net.URL patch

          I created a patch to the java.net.URL class in JDK 1.6.0 b105.
          It prints out a message indicating where it's connecting to each time
          URL.openConnection() is invoked.

          Put this jar file in $JAVA_HOME/jre/lib/endorsed directory. Together with this
          and truss you might be able to see where is causing the problematic java.sun.com
          access.

          Kohsuke Kawaguchi added a comment - I created a patch to the java.net.URL class in JDK 1.6.0 b105. It prints out a message indicating where it's connecting to each time URL.openConnection() is invoked. Put this jar file in $JAVA_HOME/jre/lib/endorsed directory. Together with this and truss you might be able to see where is causing the problematic java.sun.com access.

          Created an attachment (id=55)
          java.net.URL patch with stack dump

          Kohsuke Kawaguchi added a comment - Created an attachment (id=55) java.net.URL patch with stack dump

          Jorg Heymans added a comment -

          About DTrace: i'm on a zone with no access to the 'master' zone so that is not
          an option

          Jorg Heymans added a comment - About DTrace: i'm on a zone with no access to the 'master' zone so that is not an option

          Looking at the code, I see that Winstone tries to load things from a local cache:

          in WeebXmlParser.java line 166, there's:

          public InputSource resolveEntity(String publicName, String url)
          throws SAXException, IOException {
          Logger.log(Logger.FULL_DEBUG, Launcher.RESOURCES,
          "WebXmlParser.ResolvingEntity",
          new String[]

          { publicName, url }

          );
          for (int n = 0; n < LOCAL_ENTITY_TABLE.length; n++) {
          if (((LOCAL_ENTITY_TABLE[n][0] != null) && (publicName != null) &&
          publicName.equals(LOCAL_ENTITY_TABLE[n][0])) ||
          ((LOCAL_ENTITY_TABLE[n][1] != null) && (url != null) &&
          url.equals(LOCAL_ENTITY_TABLE[n][1]))) {
          if (this.commonLoader.getResource(LOCAL_ENTITY_TABLE[n][2]) !=
          null)

          { return getLocalResource(url, LOCAL_ENTITY_TABLE[n][2]); }

          }
          }
          if ((url != null) && url.startsWith("jar:"))

          { return getLocalResource(url, url.substring(url.indexOf("!/") + 2)); }

          else if ((url != null) && url.startsWith("file:"))

          { return new InputSource(url); }

          else

          { Logger.log(Logger.FULL_DEBUG, Launcher.RESOURCES, "WebXmlParser.NoLocalResource", url); return new InputSource(url); }

          }

          And there's a table to go with this:

          /**

          • Table mapping public doctypes and system ids against local classloader
            paths. This
          • is used to resolve local entities where possible.
          • Column 0 = public doctype
          • Column 1 = system id
          • Column 2 = local path
            */
            private static final String LOCAL_ENTITY_TABLE[][] =
            Unknown macro: { {"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN", null, "javax/servlet/resources/web-app_2_2.dtd"}, {"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", null, "javax/servlet/resources/web-app_2_3.dtd"}, {null, "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd", "javax/servlet/resources/web-app_2_4.xsd"}, {null, "http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd", "javax/servlet/resources/web-app_2_5.xsd"}, {null, "http://www.w3.org/2001/xml.xsd", "javax/servlet/resources/xml.xsd"}, {"-//W3C//DTD XMLSCHEMA 200102//EN", null, "javax/servlet/resources/XMLSchema.dtd"}, {null, "http://www.w3.org/2001/datatypes.dtd", "javax/servlet/resources/datatypes.dtd"}, {null, "http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd", "javax/servlet/resources/j2ee_1_4.xsd"}, {null, "http://java.sun.com/xml/ns/j2ee/javaee_5.xsd", "javax/servlet/resources/javaee_5.xsd"}, {null, "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd", "javax/servlet/resources/j2ee_web_services_client_1_1.xsd"}, {null, "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_2.xsd", "javax/servlet/resources/javaee_web_services_client_1_2.xsd"} }

            ;

          When I trace through this code, the resolveEntity method is invoked, and it uses
          the local resource.

          Would it be possible for you to run this under Java debugger and see if your
          resolveEntity method is invoked at all?

          Kohsuke Kawaguchi added a comment - Looking at the code, I see that Winstone tries to load things from a local cache: in WeebXmlParser.java line 166, there's: public InputSource resolveEntity(String publicName, String url) throws SAXException, IOException { Logger.log(Logger.FULL_DEBUG, Launcher.RESOURCES, "WebXmlParser.ResolvingEntity", new String[] { publicName, url } ); for (int n = 0; n < LOCAL_ENTITY_TABLE.length; n++) { if (((LOCAL_ENTITY_TABLE [n] [0] != null) && (publicName != null) && publicName.equals(LOCAL_ENTITY_TABLE [n] [0] )) || ((LOCAL_ENTITY_TABLE [n] [1] != null) && (url != null) && url.equals(LOCAL_ENTITY_TABLE [n] [1] ))) { if (this.commonLoader.getResource(LOCAL_ENTITY_TABLE [n] [2] ) != null) { return getLocalResource(url, LOCAL_ENTITY_TABLE[n][2]); } } } if ((url != null) && url.startsWith("jar:")) { return getLocalResource(url, url.substring(url.indexOf("!/") + 2)); } else if ((url != null) && url.startsWith("file:")) { return new InputSource(url); } else { Logger.log(Logger.FULL_DEBUG, Launcher.RESOURCES, "WebXmlParser.NoLocalResource", url); return new InputSource(url); } } And there's a table to go with this: /** Table mapping public doctypes and system ids against local classloader paths. This is used to resolve local entities where possible. Column 0 = public doctype Column 1 = system id Column 2 = local path */ private static final String LOCAL_ENTITY_TABLE[][] = Unknown macro: { {"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN", null, "javax/servlet/resources/web-app_2_2.dtd"}, {"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", null, "javax/servlet/resources/web-app_2_3.dtd"}, {null, "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd", "javax/servlet/resources/web-app_2_4.xsd"}, {null, "http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd", "javax/servlet/resources/web-app_2_5.xsd"}, {null, "http://www.w3.org/2001/xml.xsd", "javax/servlet/resources/xml.xsd"}, {"-//W3C//DTD XMLSCHEMA 200102//EN", null, "javax/servlet/resources/XMLSchema.dtd"}, {null, "http://www.w3.org/2001/datatypes.dtd", "javax/servlet/resources/datatypes.dtd"}, {null, "http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd", "javax/servlet/resources/j2ee_1_4.xsd"}, {null, "http://java.sun.com/xml/ns/j2ee/javaee_5.xsd", "javax/servlet/resources/javaee_5.xsd"}, {null, "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd", "javax/servlet/resources/j2ee_web_services_client_1_1.xsd"}, {null, "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_2.xsd", "javax/servlet/resources/javaee_web_services_client_1_2.xsd"} } ; When I trace through this code, the resolveEntity method is invoked, and it uses the local resource. Would it be possible for you to run this under Java debugger and see if your resolveEntity method is invoked at all?

          Jorg Heymans added a comment -

          But isn't that list just missing http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd then ?

          Jorg Heymans added a comment - But isn't that list just missing http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd then ?

          Doh! Doh! Doh! Of course!!!

          And when I looked back the e-mail thread, Renaud already said:

          > The last winstone release (0.9.6) did not have the JSP XSDs in the jar,
          > but the next one should according to their CVS.

          So this issue is just waiting for a new version of Winstone now.

          My apologies. I should have had more caffeine before doing this.

          Kohsuke Kawaguchi added a comment - Doh! Doh! Doh! Of course!!! And when I looked back the e-mail thread, Renaud already said: > The last winstone release (0.9.6) did not have the JSP XSDs in the jar, > but the next one should according to their CVS. So this issue is just waiting for a new version of Winstone now. My apologies. I should have had more caffeine before doing this.

          Jorg Heymans added a comment -

          It seems that this is fixed in the new winstone release ! It would be great if hudson could upgrade in one
          of the upcoming releases.

          Jorg Heymans added a comment - It seems that this is fixed in the new winstone release ! It would be great if hudson could upgrade in one of the upcoming releases.

          Fixed in 1.105.

          Kohsuke Kawaguchi added a comment - Fixed in 1.105.

            Unassigned Unassigned
            heymjo Jorg Heymans
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: