Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet non-JDK packages import

 
Martin Asenov
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Martin Asenov
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt that you can use different keys, but that's easy enough to test.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic