function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MiddhaMiddha 

Applet within visualforce

Hi,

 

I am trying to create an applet which can be used to upload files using drag/drop. Its working perfectly fine on my local machine but when uploaded to static resources, it doesnt works.

 

I have signed all the jar files including the axis files. While uploading a file it shows an error message:

 

 

network: Cache entry not found [url: https://c.ap1.visual.force.com/apex/, version: null]Exception in thread "Thread-12" java.lang.NoClassDefFoundError: IllegalName: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> at java.lang.ClassLoader.preDefineClass(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:530) at java.security.AccessController.doPrivileged(Native Method) at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:517) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:288) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:37) at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43) at org.apache.axis.client.Service.getAxisClient(Service.java:104) at org.apache.axis.client.Service.<init>(Service.java:113) at com.sforce.soap.partner.SforceServiceLocator.<init>(SforceServiceLocator.java:16) at SalesforceAgent.login(SalesforceAgent.java:115) at DNDApplet$2.run(DNDApplet.java:477) at java.lang.Thread.run(Unknown Source)

 Any idea, why this is coming and how can i resolve this. Please advise.

/Gulshan 

 

vabvab

hi

 

Did you got any solution for this problem?

 

I am also trying the same thing. could you share the steps/code, how to refer/invoke a method of applet in visualforce page?

 

 

MiddhaMiddha

Yes, it worked for me. Earlier i was using the "code=" attribute in the applet tag within Visualforce page. I specified the base class in this code attribute. The problem was that the applet was assuming the salesforce as the root folder and looking for all properties files in salesforce.

 

I tried adding another attribute to applet tag i.e. "codebase=". after this the applet looked for all the resources within this codebase and it worked.

 

 I also added all the jar files in archive attribute.

<applet name="uploadApplet" code="DNDApplet.class" codebase="{!$Resource.fileuploadapplet}/" archive="{!$Resource.fileuploadapplet}/signed_fileupload.jar,{!$Resource.fileuploadapplet}/signed_wsdl4j-1.5.1.jar,{!$Resource.fileuploadapplet}/signed_sforce11.jar,{!$Resource.fileuploadapplet}/signed_saaj.jar,{!$Resource.fileuploadapplet}/signed_plugin.jar,{!$Resource.fileuploadapplet}/signed_log4j-1.2.8.jar,{!$Resource.fileuploadapplet}/signed_jaxrpc.jar,{!$Resource.fileuploadapplet}/signed_commons-logging-1.0.4.jar,{!$Resource.fileuploadapplet}/signed_commons-discovery-0.2.jar,{!$Resource.fileuploadapplet}/signed_axis-ant.jar,{!$Resource.fileuploadapplet}/signed_axis.jar" mayscript="true" scriptable="true" width="100%" height="150"/>

 Dont know, if this is the best way to do this, but this surely works.

 

/GreatG 

 

 

RahulChandraRahulChandra

Even this solution does not work. I tried it, It displays an error.