File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Applet non-JDK packages import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet non-JDK packages import" Watch "Applet non-JDK packages import" New topic
Author

Applet non-JDK packages import

Martin Asenov
Ranch Hand

Joined: Aug 05, 2009
Posts: 34
Hello, friends!

I've got an applet that uses some packages that are not included in the standart JDK, I presume they're loaded through the plug-in that loads the applet. Anyway, what about some other packages... for instance org.apache.commons.httpclient and com.oreilly.servlet packages? How am I supposed to include them in the JAR that needs to be signed. I guess it's not by including the source within, there must be some other way. Would you assist me on that issue, please?

Thanks in advance! Best regards,

Martin Asenov
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
It's no problem to use other libraries in an applet - that's what the "archive" attribute of the applet tag is for. If the applet is signed, then all other jar files need to be signed as well; it works the same way.


Ping & DNS - updated with new look and Ping home screen widget
Martin Asenov
Ranch Hand

Joined: Aug 05, 2009
Posts: 34
Thanks, Ulf, I gave it a try... Everything's fine, the applet gets loaded, but... when it comes to using the HttpClient package from apache i get a ClassDefNotFoundError in the java console. But I've got the 'commons-httpclient-3.1.jar' in /WebContent and it is signed, and it does contain the class that 'could not be found'.

And that's my applet tag:



Please, help...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Are the other jar files being accessed and found correctly? Can you see (in the web server access logs) the request for the jar file coming it? If so, is the URL correct, and does the server respond with a 200 response code? Can you download the jar file manually through the browser?
Martin Asenov
Ranch Hand

Joined: Aug 05, 2009
Posts: 34
Ok, Ulf, I fixed that. Anyway, if my applet is signed with certain keystore, and the relative jars that the applet uses are signed with another keystore, is the applet supposed to run?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
I doubt that you can use different keys, but that's easy enough to test.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet non-JDK packages import
 
Similar Threads
JDK1.3 vs JDK1.4
Learning Java API
JDK Settings for IPlanet Web Server
getAllPackages in JDK
Help on Inheritance