Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Applet Problems - Works in appletviewer but not ie

Thread view: 
michael.rygh@gmail.com - 14 Dec 2005 22:55 GMT
I finished the applet and everything works in using the applet viewer.
When I open the htm file that opens the java class, everything works
until I get to my high scores screen. when I click that button, It
reads from a file and sorts out the high scores and then compares to
the current users high score. nothing is written to a file. just read.

I am wondering why it wouldn't work in the htm file but would work
using appletviewer. If I make it a signed applet will it work? I
thought it didn't have to be signed if you are just reading from a file
not writing.

Anyone have any suggestions?
Dag Sunde - 14 Dec 2005 23:00 GMT
>I finished the applet and everything works in using the applet viewer.
> When I open the htm file that opens the java class, everything works
[quoted text clipped - 6 lines]
> thought it didn't have to be signed if you are just reading from a file
> not writing.

Yes, you need to sign it to do *any* file access.

If not, you would be able to read my
"passwors_and_pincodes.txt" file in my root folder... ;-)

Read or write doesn't matter.

Signature

Dag.

michael.rygh@gmail.com - 14 Dec 2005 23:10 GMT
Thanks Dag Sunde for the help.

ok i've signed other applets but this one isnt working.

either something isnt working or im forgetting something...

i gotta jar my class..

jar cvf quiz.jar quiz.class

then run my key tool...

keytool -genkey -alias quiz -validity 365

then enter all my info

then last i need to sign the jar file with the jarsigner

jarsigner quiz.jar quiz

is that all i need to do? i did all that and tried recompiling and it
didnt work. i went and deleted my keyfile and retried it and it still
didn't work.

I'm new to this so any help would be great if im missing anything.
Thanks.
Dag Sunde - 15 Dec 2005 00:40 GMT
> Thanks Dag Sunde for the help.
>
[quoted text clipped - 8 lines]
> keytool -genkey -alias quiz -validity 365
> then enter all my info

Hmmm... It is a long time since I used a self-signed
certificate, and I've never used keytool.
But as far as I remember you have to create
a "root" certificate, and import that so you become
your own CA.

Then you use that CA-certificate to create and sign your
code-signing certificate.
Only now, you have a certificate you can use to sign your jar.

The command line I use to create and sign a jar file in one shot is
like this:

signtool -k"My CommonName" -d. -Z"jarfilename.jar" -p"mypwd" signdir

I have alway used OpenSSL to create self-signed server certificates,
not code-signing. I use a commercial Verisign certificate for that.

Anyway, here's the process for OpenSSL:
http://www.dylanbeattie.net/docs/openssl_iis_ssl_howto.html

Maybe you can get something from that...

Signature

Dag.

michael.rygh@gmail.com - 15 Dec 2005 01:17 GMT
well i got it to work. and now when i click the high scores button. it
crashes the whole window.

i have it just quiz.htm and it crashes that window

and i uploaded it to my ftp and went to that website and ran the signed
applet and when i hit the "high scores".. it crashes the whole window
and closes it.

i guess im stuck and don't know what would cause that. any
suggestions/ideas would be appreciated. thanks for your time!
michael.rygh@gmail.com - 15 Dec 2005 02:25 GMT
well i found out why it crashes and i got it to stop but now i still
have a problem.

in my catch for reading from the file... some how it would throw and
error and my code has it do a system.exit if it does.

so now i removed the system.exit... and when it displays the high
scores... it just says null 0. cause obviously its not reading them..

i just dont understand how it worked through appletviewer but not
worked through regular html file. hmm.. thanks for the help!
Dag Sunde - 15 Dec 2005 06:45 GMT
> well i found out why it crashes and i got it to stop but now i still
> have a problem.
[quoted text clipped - 7 lines]
> i just dont understand how it worked through appletviewer but not
> worked through regular html file. hmm.. thanks for the help!

In Appletviewer, it is running as a local program, accessing files
locally.

How do you access the file you try to open? Post the file-reading
code.
How is your filename and path formatted?

Signature

Dag.

Andrew Thompson - 16 Dec 2005 09:11 GMT
> in my catch for reading from the file... some how it would throw and
> error and my code has it do a system.exit if it does.

You cannot do a System.exit(n) form within an applet.

> so now i removed the system.exit... and when it displays the high
> scores... it just says null 0. cause obviously its not reading them..

Where is your applet?  Give us the URL so we can see it
crash.  Link to the code.

> i just dont understand how it worked through appletviewer but not
> worked through regular html file. hmm.. thanks for the help!

Could be due to a number of things.

Signature

Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.