Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Load resources from jar file located within a jar

 
Phani Chaitanya
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I dont know whether this is the right thread to put this question up or not. If not, Admin - please move this query to the right thread.

Im trying to load an applet using Object tag in a jsp. Applet is located in a jar and the required resources for that applet are located in a single jar. The resources jar contains 10 jars approx. required to load the applet. I was able to load the applet if i give all the jars. but was unsuccessful if i make all the resources in to single jar. Here is the code sample that is working




This code is not working


help me.
 
Paul Clapham
Sheriff
Posts: 21955
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't access resources which are inside a jar which itself is inside a jar. Not unless you use a specialized classloader which understands that setup -- and using classloaders other than the system classloader would require you to sign your applet.

Since you already have the solution -- don't put your jars inside a jar -- there isn't much more to be said.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!