JDK-6238729 : Unnecessary request for service provider on the webserver
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2005-03-10
  • Updated: 2011-02-16
  • Resolved: 2005-03-10
Related Reports
Duplicate :  
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

Comments
EVALUATION This is a duplicate of #6215746. ###@###.### 2005-03-10 23:39:35 GMT
10-03-2005