Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6238729

Unnecessary request for service provider on the webserver

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • None
    • 1.4.2
    • deploy
    • x86
    • windows_2000

    Description

      FULL PRODUCT VERSION :
      java version "1.4.2_04"

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      I have a java applet, which makes use of
      javax.xml.parsers.DocumentBuilderFactory, which should be
      contained in JRE. However, the webserver from which the applet is loaded is logging an error indicating that the browser is requesting the following file:
      META-INF/services/javax.xml.parsers.DocumentBuilderFactory

      As far as the java doc explains, java should only be searching for this file in jar files and not the server itself. This problem is identical to bug # 4819792, with the exception that I am not using sniffer to detect the request for the file. The problem with this bug is that so much XML parsing is happening in my product that the log file gets inundated with this error message.

      Below is a copy of a test applet that will reproduce this problem:
      import javax.xml.parsers.*;
      import java.applet.*;
      import javax.swing.*;

      public class TestApplet extends JApplet {

          public void init() {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          }

          public void start() {

          }

          public void stop() {

          }

          public String getAppletInfo() {
            return "TestApplet Information";
          }
      }

      Here is a copy of the HTML that is used to display the test applet:
      <HTML>
      <HEAD>
         <TITLE>Applet HTML Page</TITLE>
      </HEAD>
      <BODY>
      <H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3>
      <P>

      <APPLET CODE = "TestApplet.class" WIDTH = 350 HEIGHT = 200></XMP>
          <PARAM NAME = CODE VALUE = "TestApplet.class" >
          <PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
          <PARAM NAME="scriptable" VALUE="false">
      </APPLET>
      </P>

      <HR WIDTH="100%"><FONT SIZE=-1><I>Generated by NetBeans IDE</I></FONT>
      </BODY>
      </HTML>

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Copy the TestApplet code into a file named TestApplet.java.
      2. Compile TestApplet.java
      3. FTP or copy the TestApplet .java and .html files to a webserver root directory.
      4. From a browser, open the TestApplet.html
      5. After the browser finishes loading the test applet, look in the webserver's log file. IIS displays the following:
      [TIMESTAMP] [CLIENT-IPADDRESS] GET /META-INF/services/javax.xml.parsers.DocumentBuilderFactory 404

      Where:
        [TIMESTAMP] is the time of the request
        [CLIENT-IPADDRESS] is the ip address of the machine from where the browser loaded the TestApplet.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The webserver should not be requested for the file /META-INF/services/javax.xml.parsers.DocumentBuilderFactory.
      ACTUAL -
      The webserver is logging the fact that the client is requesting the file /META-INF/services/javax.xml.parsers.DocumentBuilderFactory . The requestor is the JVM.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      19:27:36 16.105.178.88 GET /META-INF/services/javax.xml.parsers.DocumentBuilderFactory 404

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.xml.parsers.*;
      import java.applet.*;
      import javax.swing.*;

      public class TestApplet extends JApplet {

          public void init() {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          }

          public void start() {

          }

          public void stop() {

          }

          public String getAppletInfo() {
            return "TestApplet Information";
          }
      }

      ---------- END SOURCE ----------
      ###@###.### 2005-03-10 10:46:15 GMT

      Attachments

        Issue Links

          Activity

            People

              stanleyh Stanley Ho (Inactive)
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: