JDK-6850029 : java.lang.NoSuchMethodError observed after upgrade from 1.6.0_10 to 1.6.0_11
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 6u11
  • Priority: P2
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows
  • CPU: generic
  • Submitted: 2009-06-10
  • Updated: 2010-05-11
  • Resolved: 2010-03-17
Related Reports
Relates :  
Description
A customer recently upgraded from 1.6.0_10 -> 1.6.0_11 and started to see the following exception with their applet preloader code:

Exception in thread "Thread-10" java.lang.NoSuchMethodError: 
com.sun.deploy.net.HttpDownload.download(ILjava/net/URL;Ljava/io/InputStream;Ljava/lang/String;Ljava/io/File;Lcom/sun/deploy/net/HttpDownloadListener;)V
        at 
com.sun.deploy.cache.CustomCache.downloadResourceToCache(CustomCache.java:544)
        at 
com.sun.deploy.net.CustomDownloadEngine.actionHttpDownload(CustomDownloadEngine.java:1462)
        at 
com.sun.deploy.net.CustomDownloadEngine.actionDownload(CustomDownloadEngine.java:1002)
        at 
com.sun.deploy.net.CustomDownloadEngine.getCacheEntry(CustomDownloadEngine.java:1608)
        at 
com.sun.deploy.net.CustomDownloadEngine.getResourceCacheEntry(CustomDownloadEngine.java:1723)
        at 
com.sun.deploy.net.CustomDownloadEngine.getResourceCacheEntry(CustomDownloadEngine.java:1650)
        at 
com.sun.deploy.net.CustomDownloadEngine.getCachedResource(CustomDownloadEngine.java:658)
        at 
com.sun.deploy.cache.CustomCacheApp.doDownload(CustomCacheApp.java:241)
        at 
com.bank.casa.navshell.preloader.JPIPreLoaderApplet6$PreLoaderThread.doDownload(JPIPreLoaderApplet6.java:584)
        at 
com.bank.casa.navshell.preloader.JPIPreLoaderApplet6$PreLoaderThread.run(JPIPreLoaderApplet6.java:414)

They have developed the following workaround
*1.6.0_10*
CustomDownloadEngine.getHttpDownloadImpl().download(
    conn.getContentLength(), conn.getURL(), is,
    conn.getContentEncoding(), ce.getTempDataFile(), null);

*1.6.0_11*
CustomDownloadEngine6U11.getHttpDownloadImpl().download(
    conn.getContentLength(), conn.getURL(), is,
        conn.getContentEncoding(), ce.getTempDataFile(), null,0);

By adding the dummy argument, they have resolved the exception in _11.

Comments
EVALUATION This is not a bug. Customer should not depend on internal implementation. Customer fixed the issue accordingly. Hence closing it.
17-03-2010

EVALUATION sun.net package is recommended not to be used directly for the same reason as they are subject to change. Hence customer should not be using it drectly. I am adding Dennis on the interest list to comment on this. This seems to be due to Security Fix for 6707535 , changes the com.sun.deploy.net.HttpDownload.download param see file: src/common/share/classes/com/sun/deploy/net/HttpDownload.java old === /** Download resource to the given file */ public void download(int contentLength, URL url, InputStream in, String encoding, File file, HttpDownloadListener dl) throws CanceledDownloadException, IOException; } new === public interface HttpDownload { /** Download resource to the given file */ public void download(int contentLength, URL url, InputStream in, String encoding, File file, HttpDownloadListener dl, int contentType) throws CanceledDownloadException, IOException; }
10-06-2009