Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot get lazy downloading to work jdk1.5.0_11

843802Jun 28 2007 — edited Jul 3 2007
Hello,

I have a web start application that was deemed too slow during the first launch over a crappy connection. I successfully implemented pack200 into my build, and now I need to address the period of time between the application banner disappearing and the application appearing. I was able to solve this problem by taking reports out of my main application jar, and isolating them in their own reports.jar. I then added package tags for the reports package and package tags for all the reports baggage (JFreeReport and its baggage). Regardless of this, the reports and all the JFreeReport baggage is always downloaded eagerly.

If I delete the jnlp entries having to do with reports including all the JFreeReport archives, my application loads up and displays quickly, everything works well, except for reports ( expected). I have a nice user message that I display stating that this feature is not implemented. When I look through the console log, I am not seeing any dependencies on reports coming out of my main jar that may be causing it to force the eager download of reports.

I am using JNLPDownloadServlet to support pack200, though I am not testing the lazy vs eager download with packed jars (build is too slow).

My jnlp is being generated by a servlet because I need to pass data on the url to the jnlp. I am using jdk1.5.0_11.

Here is the relevant chunk of code.
try {
out = response.getWriter();
out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
out.println("<jnlp spec=\"1.0+\" name=\""+ name +"\" codebase=\""+ codebase +"\" >");
out.println("<information>");
 out.println("<title> On-State </title>");
out.println("<vendor> Our Application for the Internet </vendor>");
out.println("<icon kind=\"splash\" href=\"Splash.jpg\"/>");	
out.println("</information>");
out.println("<security>");
out.println("<all-permissions/>");
out.println("</security>"); 
out.println("<resources>");
out.println("<j2se version=\"1.5\"/>"); 
/*******************************************************/
/* START OF EAGER DOWNLOAD SECTION	     */
/* mymain.jar */
out.println("<jar href=\"mymain.jar\" version=\"1.0\" main=\"true\" />");		    
 out.println("<jar href=\"log4j.jar\"  />");
out.println("<jar href=\"utilities.jar\" version=\"1.0\" />");
out.println("<jar href=\"jlfgr.jar\" version=\"1.0\" />");
out.println("<jar href=\"common.jar\" version=\"1.0\" />");
out.println("<jar href=\"images.jar\" version=\"1.0\" />");
out.println("<jar href=\"swing-worker.jar\" />");			  
out.println("<jar href=\"jboss-j2ee.jar\" />");	
out.println("<jar href=\"jboss-ejb3-client.jar\"  />");
out.println("<jar href=\"jbossall-client.jar\"  />");
out.println("<jar href=\"jboss-aop-jdk50-client.jar\"  />");
 out.println("<jar href=\"jboss-aspect-jdk50-client.jar\" />");	
out.println("<jar href=\"jfreechart-1.0.2.jar\"/>");
out.println("<jar href=\"jcommon-1.0.6.jar\" />");
/* END OF EAGER DOWNLOAD SECTION */
/*********************************************************/
 /*******************************************************/
/* START OF LAZY DOWNLOAD SECTION	      */
/* reports */
out.println("<jar href=\"reports.jar\" part=\"report\" " + 
"version=\"1.0\" download=\"lazy\" />");
out.println("<package name=\"com.mycompany.myapp.report.*\"" +
                     "recursive=\"true\" +part=\"report\" />");	
 /* jfreereport jar */
out.println("<jar href=\"jfreereport-0.8.7-10.jar\" " +
   	"part=\"report\" download=\"lazy\"/>");
out.println("<package name=\"org.jfree.report.*\"" +
  	"recursive=\"true\" part=\"report\" />");		 
		    
 /* libfonts jar */
out.println("<jar href=\"libfonts-0.2.1.jar\"  " +
                    "part=\"report\" download=\"lazy\"/>");	
out.println("<package name=\"org.jfree.fonts.*\"" +
	"recursive=\"true\" part=\"report\" />");	
		    
/* itext jar */
out.println("<jar href=\"itext-1.4.3.jar\"  " +
                   "part=\"report\" download=\"lazy\"/>");
out.println("<package name=\"com.lowagie.*\"" +
	"recursive=\"true\" part=\"report\" />");			    
/* libloader jar */
out.println("<jar href=\"libloader-0.1.5.jar\" " +
                      "part=\"report\" download=\"lazy\"/>");
out.println("<package name=\"org.jfree.resourceloader.*\"" +
	"recursive=\"true\" part=\"report\" />");

/* jcommon-xml jar */
out.println("<jar href=\"jcommon-xml-1.0.6.jar\" " +
	"part=\"report\" download=\"lazy\"/>");
 out.println("<package name=\"org.jfree.resourceloader.*\"" +
	"recursive=\"true\" part=\"report\" />");			    
* poi jar */
out.println("<jar href=\"poi-3.0-alpha1-20050704.jar\" " +
                      "part=\"report\" download=\"lazy\"/>");
out.println("<package name=\"org.apache.poi.*\"" +
	"recursive=\"true\" part=\"report\" />");
		
* bsf jar */
out.println("<jar href=\"bsf-2.3.0.jar\" " +
                    "part=\"report\" download=\"lazy\"/
out.println("<package name=\"org.apache.*\"" +
	"recursive=\"true\" part=\"report\" />");

 /* bsh jar */
 out.println("<jar href=\"bsh-1.3.0.jar\" " +
                     "part=\"report\" download=\"lazy\"/>");
out.println("<package name=\"bsh.*\"" +
	"recursive=\"true\" part=\"report\" />");	
 /* END OF LAZY DOWNLOAD SECTION                */
/*********************************************************/
		    
out.println("</resources>"); 
out.println("<application-desc main-class=\"com.mycompany.myapp.framework.MYApp">");
out.println("<argument>" + tenantName + "</argument>");
out.println("<argument>" + subscriberName + "</argument>");
out.println("<argument>" + jndi + "</argument>");		    
out.println("</application-desc>"); 
out.println("</jnlp> ");
}
I read that the package tag is only used for lazy downloading, I think I am using parts correctly. I am convinced that I am doing something wrong either in the jnlp or in the packaging of my application.

Does anyone have any information about what I should be looking at in order to get this to work? I have read the JNLP specification, I have googled and I have looked through the java forums and have not found any info.

Thanks,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2007
Added on Jun 28 2007
6 comments
243 views