applet - NoClassDef error

hi !! my applet class is A.class. It uses a class from a library (B.jar). I used the jar command to add both A.class and B.jar in a jar file A.jar. But, when i view it from the browser, i get the error that a class C (which was in B.jar) could not be found.
I'm guessing that the classpath won't help here .. coz the html and the jar files are going to be placed on a webserver (remote machine), while the client is going to view the html page + applet from his machine
how do i solve this problem ?
thanks :)
muskad202
LVL 2
muskad202Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

girionisCommented:
You need to define the archive in the "archive" attribute of the applet tag. Your applet class should also be *outside* of the jar file. Have a look here for mroe info: http://mindprod.com/jgloss/applet.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
muskad202Author Commented:
the reason i'm adding the applet.class file to a jar file, is coz i need to sign it, because the applet needs to read files from the user's harddisk ...
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

girionisCommented:
:)
0
muskad202Author Commented:
hi !!
i am yet having a problem, and was wondering if u could help me .. it is now able to find the class, and the applet loads fine, it is a signed applet .. but , i am trying to read a file from the harddisk, and i get an access denied error .. i already chose "Accept" when the security dialog came up asking if i wanted to allow the applet to run ..
there is a jfilechooser in the applet, that loads correctly, i am able to navigate thru the folders on the disk, only when i start reading, i get a read error .. any suggestions ??
0
girionisCommented:
Can you post the exact error? It might not have to do with permissions.
0
muskad202Author Commented:
java.security.AccessControlException: access denied (java.io.FilePermission c:\ read)
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkRead(Unknown Source)
      at java.io.File.exists(Unknown Source)
etc etc
---------------------------------------------
this is the error in the jave console window from IE. i was trying to open the file c:\a.txt

muskad202
0
girionisCommented:
I think there is something wrong with signing the applet. Are you sure the signing went on ok? I suggest you sign it again and then try again.
0
muskad202Author Commented:
hi !!
i redid the whole process .. same error :(
would it be possible for you to have a look at the code ?? the java file is quite small, just 2.77 kb .. i could send u the java file along with the library via email :/
if not, then no problem ... thanks for your help :)
muskad202
0
muskad202Author Commented:
note - there doesn't seem to be anything wrong with the code, coz, if i start the application using a main() function, and create a JPanel and add the applet to it, the thing works fine ..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.