Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

It'll work in my computer but not on his! (I've signed an applet)

 
carlos sanchez
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody!
I've signed an applet to run in a an app over a tomcat. I've created the certificates and signed the jar, and everything seems to work fine untill I get an Excpetion trying to acces from another computer in the LAN.
When I type the URL the certificate pops out and I grant the session, but I get an java.net.ConnectException: Conection refused: connect.
Does this thing have to do with the certificate, here's the batch I use to generate & regenerate it:
****--First I clean the ones generated before^--****
del SSignedApplet.jar
del SignedApplet.jar
del CompanyCer.cer
del compstore
*******--Create the jar--*******
jar cvf SignedApplet.jar bajadaApplet.class
*******--create the database with the entries--********
keytool -genkey -alias signFiles -keystore compstore -keypass kpli35 -storepass ab987c
*******--sign the jar --********
jarsigner -keystore compstore -storepass ab987c -keypass kpli35 -signedjar SSignedApplet.jar SignedApplet.jar signFiles
*******--export the certificate----******
keytool -export -keystore compstore -storepass ab987c -alias signFiles -file CompanyCer.cer
Well thanks!
----------------------------------------
Don't ever let your computer know you're in a hurry!
 
carlos sanchez
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. I've might have found the answer.
Problem is the connection between the computer and the server (it's in a LAN). The stream can't read because of the proxy settings. Hope that's the answer.
thanks to everyone that's read this!!
 
shelly kalra
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Carlos,
As per you refernece to this page
http://java.sun.com/developer/technicalArticles/Security/Signed
I did the following
C:\java>jar cvf SignedApplet.jar SignedAppletDemo.class
added manifest
adding: SignedAppletDemo.java(in = 1229) (out= 572)(deflated 53%)
C:\java>keytool -genkey -alias signFiles -keystore susanstore -keypass kpi135 -dname "cn=jones" -storepass ab987c
C:\java>jarsigner -keystore susanstore -storepass ab987c -keypass kpi135 -signedjar SSignedApplet.jar SignedApplet.jar signFiles
C:\java>keytool -export -keystore susanstore -storepass ab987c -alias signFiles -file SusanJones.cer
Certificate stored in file <SusanJones.cer>
my html code (browse.html)-
<html>
<head>
<script language = "javaScript">
</script>
</head>
<body>
<input type="file" name="fileAttach" style="visibility:hidden">
<applet code="SignedAppletDemo.class"
archive="SSignedApplet.jar"
width=400 height=400>
<param name=file value="/etc/inet/hosts">
</applet>
</body>
</html>
what is to be done next?
when i do this
C:\java>appletViewer browse.html
I get access violation exception.However if i grant all permission in
policy file it works fine.
There is a mention about changing the policy file(Write.jp) in the article too, but i doubt if that has to be done.
Please let me know the steps,to be followed after this.
Thanks in anticipation,
Shelly.
 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
Well I have seen your steps and its Ok.
well you put all the files in an applet folder and grants persmission in catalina.policy this is same as java policy.
well you should give those permission which is needed for ur applet and it would work fine as I was getting the same exception quiet like u.
And do restart ur tomcat after setting the permissions.
Iam sending some link please see and check is your steps are ok http://www.ryerson.ca/~dgrimsha/courses/cps530/jarsigner.html
and please do tell me what errors u are getting now .
well you try and see what is wrong where.
Thanks
 
shelly kalra
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Jasmine, thanx for the concern.I m finally done with it.
Last day I was making a test applet, was not using any server for it.I did all possible steps as mentioned above but could not see the certificate on double clicking html.I could not however figure out the problem.
But today morning i didnt made any single change and my signed
applet worked as expected.My guess is that it required my system to be rebooted.(m not sure though)
Now I have implemenented the same with my real application, using weblogic
and know what its working perfectly fine.
and yes jasmine you mentioned about changing policy file too, but mine
works just fine without such changes too.
what say?
Thanks anyway,
Shelly.
 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello shelly,
Great to hear from you as I am a jaav developer and workinh with tomcat and I also mad a sign applet and put in tomcat and working fine with RMI too.
well good and i hope you would be more sure about the reason why it was giving error.
Well good.
 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello shelly,
Great to hear from you as I am a java developer and working with a tomcat and I also made a sign applet and put in tomcat and working fine with RMI too.
well good as ur sign applet is working fine and I hope you would be more sure about the reason why it was giving error earlier.
Well good.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic