Applet cannot access local devices

C

CrazyJerry

Hi all,

I have a signed applet that reads information from Card Reader. When I
run this applet from client machine with a Card Reader, it cant get
information from the card. But I plug out the Card Reader and plug in
to the server, it works.

As I know, the applet runs on the client machine. But in my case, it
only accesses server devices. So anyone can suggest me a solution to my
problem. I already sign this applet and have a .java.policy with full
acccess also.

Thanks a lot for viewing and suggestions!
 
A

Andrew Thompson

CrazyJerry said:
...I already sign this applet and have a .java.policy with full
acccess also.

If your applet is properly signed, the java policy file
should be redundant. This makes me wonder..
- Is either method of gaining increased privileges working properly?
- Are you swallowing exceptions?
<http://www.physci.org/codes/javafaq.jsp#stacktrace>
- Where is the applet? (URL)
<http://www.physci.org/codes/sscce.jsp#eg>
- Where is the applet code? (URL)
<http://www.physci.org/codes/sscce.jsp>
 
C

CrazyJerry

Thanks for your reply.

- Is either method of gaining increased privileges working properly?
I do not understand what you mean. My applet can access client file,
can communicate with server through socket. I used logging and saw that
the applet stops right before accessing Card Reader.

- Are you swallowing exceptions?
No. I check exceptions very careful and I do logging also.

- Where is the applet? (URL)
- Where is the applet code? (URL)
On the server, the root contains : CardApplet.html, CardApplet.jar
and CardApplet.class
The code of CardApplet.html is :
"<HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="000000">
<CENTER>
<APPLET
code = "CardApplet.class"
archive = "CardApplet.jar"
width = "500"
height = "300"</APPLET>
</CENTER>
</BODY>
</HTML>"

On the client, I access applet through URL:
http://crazyjerry.dyndns.org:8080/CardApplet.html

It is very funny. Since my program keeps looping to check card, when
card reader on client machine, it hang. Then I move card reader to
server, the applet continues -.-".

Thanks for viewing and any suggestions!
 
R

Roedy Green

I have a signed applet that reads information from Card Reader. When I
run this applet from client machine with a Card Reader, it cant get
information from the card. But I plug out the Card Reader and plug in
to the server, it works.

turn the applet into a hybrid application. See
http://mindprod.com/jgloss/applet.html#HYBRID for how.

Debug that. That gets the Applet/security stuff out the way. It also
makes it easier to run debuggers. Then add the Applet/security. If
you can't get it to work, give up. Use JAWS instead to run your
Applet/application.

See http://mindprod.com/jgloss/javawebstart.html
 
R

Roedy Green

It is very funny. Since my program keeps looping to check card, when
card reader on client machine, it hang. Then I move card reader to
server, the applet continues -.-".

There is a strong possibility the fault likes with the way the card
reader or port is attached, configured, drivered, etc. You must
eliminate that.
 
C

CrazyJerry

Thanks a lot for your suggestions man, the applet works already!

Thanks again and best regards!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top