Filepermisson on jar files

  • Follow


Hi there!

I've build an Java applet which uses the jxl.jar file, named app.jar.
Jxl for who haven't heard is the jar that constains the classes for
excel file editing. The issue here is, app.jar has two java applets,
one for the excel file creation and another for the application
settings. The applet for the application settings works well and can
read/write files to/from the local hard drive.  I've signed the
app.jar. The issue here is when i launch the main java applet for the
excel file creation exceptions are thrown, indicating that jxl doesn't
have read/write permissons. I've tried signing the jxl.jar but it
still gives me the same errors. When signing i tried using the app.jar
key already generated or a new key but didn't work. Can anybody give
me a clue on how i can solve this. Thanks in advance for any help.

app.jar -> signed and launches well in IE7.
jxl.jar -> when performing the convertion indicated that doesn't have
read/write permissions.

0
Reply kubic62 (34) 8/10/2007 2:38:23 PM

Pedro Pinto wrote:
...
>I've build an Java applet ...

Considered launching your applet using web start?
<http://www.physci.org/jws/#jtest>
It might ..
a) solve the permissions problem. 

..or at least offer alternate strategies, such as..

> ... The applet for the application settings works well and can
> read/write files to/from the local hard drive. ...

b) A *sandboxed* web start app. can access files on the 
local PC using the JNLP API's FileOpen/SaveService.
<http://www.physci.org/jws/#fs>

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200708/1

0
Reply Andrew 8/10/2007 2:48:28 PM


I think the trick in solving this issue is to have both jar filessigned with the same jarsigner but i can't seem to be able to do this.
0
Reply Pedro 8/10/2007 2:58:42 PM

>app.jar -> signed and launches well in IE7.>jxl.jar -> when performing the convertion indicated that doesn't have>read/write permissions.I would suggest reading it with getResource and getResource as stream.Applets can't go opening arbitrary local jars unless the Applet itselfis signed.-- Roedy Green Canadian Mind ProductsThe Java Glossaryhttp://mindprod.com
0
Reply Roedy 8/10/2007 4:24:53 PM

On Aug 10, 10:58 am, Pedro Pinto <kubi...@gmail.com> wrote:> I think the trick in solving this issue is to have both jar files> signed with the same jarsigner but i can't seem to be able to do this.If you can give me a link to an explanation of the signing process Imight be able to figure out what needs to be done.
0
Reply javayahtzee 8/10/2007 4:25:42 PM

On 10 Ago, 17:24, Roedy Green <see_webs...@mindprod.com.invalid>wrote:> >app.jar -> signed and launches well in IE7.> >jxl.jar -> when performing the convertion indicated that doesn't have> >read/write permissions.>> I would suggest reading it with getResource and getResource as stream.> Applets can't go opening arbitrary local jars unless the Applet itself> is signed.> --> Roedy Green Canadian Mind Products> The Java Glossaryhttp://mindprod.comBut the applet is signed! Initially it wasn't so it wouldn't startbecause it has to read data from a local file. But after signing it itstarting working well, expect when it has to use the classes of thejxl.jar. For example, i can read and write well with the programsettings file but when trying to open an excel file an error occursindicating that jxl doesn't have enought permissions. I also tried tosign the jxl package but, i don't know why, when i start the appletthe browser never indicates that i need to accept the digitalsignature, thus, never aproving jxl.jar package for use. Is there away to manually insert the digital signature in the aprove list? Hasan alternative, how can i get the jxl package working inside theapp.jar? Has last possible solution, how can i put the two jar filesusing the same digital signature?Regards and thank you for the support
0
Reply Pedro 8/10/2007 5:14:09 PM

On 10 Ago, 17:25, javayaht...@gmail.com wrote:
> On Aug 10, 10:58 am, Pedro Pinto <kubi...@gmail.com> wrote:
>
> > I think the trick in solving this issue is to have both jar files
> > signed with the same jarsigner but i can't seem to be able to do this.
>
> If you can give me a link to an explanation of the signing process I
> might be able to figure out what needs to be done.

http://java.sun.com/developer/Books/javaprogramming/JAR/sign/signing.html

Thank you.

When i sign i perform the following commands:

keytool -genkey -alias app

jarsigner app.jar app


0
Reply Pedro 8/10/2007 5:16:23 PM

Pedro Pinto wrote:>On 10 Ago, 17:24, Roedy Green <see_webs...@mindprod.com.invalid>....>But the applet is signed! Did you reject a web start launch?  Why?It might be the applet can be fixed, but I would need..a) A lot more information.b) A reason why you are not using web start for this launch.-- Andrew Thompsonhttp://www.athompson.info/andrew/Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200708/1
0
Reply Andrew 8/11/2007 12:01:25 AM

Hello again to everyone!After a good weekend rest i sat in front of my pc and in 20 minutessolved my issue. What did i do:1 - Close all IE windows open. If i didn't do this it wouldn't reallyrefresh the certificate attemps and would never accept the newcertificates issued.2 - Followed the specified commands:keytool -genkey -keyalg rsa -alias yourkeykeytool -export -alias yourkey -file yourcert.crtjavac yourapplet.javajar cvf yourapplet.jar *.classjarsigner yourapplet.jar yourkeyinserted the following tag:<applet code="yourapplet.class" archive="yourapplet.jar" width="600"height="500"></applet>The trick was to sign with the same certificate both jar packages andafterwards it would work well.This was a messy situation only by the fact that i wasn't closing theIE windows.In regard of the question why not use jnlp, i'm starting a courseabout it and expect to start using rapidly. If someone has someinformation about good books or tutorials please advise. Thanks inadvance for all the help.RegardsPedro PintoOn 11 Ago, 01:01, "Andrew Thompson" <u32984@uwe> wrote:> Pedro Pinto wrote:> >On 10 Ago, 17:24, Roedy Green <see_webs...@mindprod.com.invalid>> ...> >But the applet is signed!>> Did you reject a web start launch?  Why?>> It might be the applet can be fixed, but I would need..> a) A lot more information.> b) A reason why you are not using web start for this launch.>> --> Andrew Thompsonhttp://www.athompson.info/andrew/>> Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200708/1
0
Reply Pedro 8/13/2007 1:52:01 AM

Pedro Pinto wrote:...>In regard of the question why not use jnlp, i'm starting a course>about it and expect to start using rapidly. You will never look back.  Note that web start wouldnot have been tripped up by the 'cache' behaviour of IE.>...If someone has some>information about good books or tutorials please advise. Java Tutorial - Deploying Java Web Start Applications<http://java.sun.com/docs/books/tutorial/deployment/webstart/deploying.html><http://java.sun.com/docs/books/tutorial/deployment/webstart/index.html>Java Web Start - Developers Section<http://java.sun.com/products/javawebstart/developers.html>JNLP File Syntax<http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html>JNLP API Reference 1.5 - if you're interested in using JNLPAPI Services to 'break out' of the sandbox for otherwise 'nopermissions' apps - this is where to look first, though thereare some nice buildable examples of the JNLP API at PhySci.<http://java.sun.com/j2se/1.5.0/docs/guide/javaws/jnlp/index.html>Web Start v 1.5 - FAQ<http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/faq.html>Unofficial Java Web Start-JNLP FAQ (whispers) ..better than Sun's own.<http://lopica.sourceforge.net/faq.html>PhySci web start examples.  ..better than Sun's own.<http://www.physci.org/jws/>Sun web start examples (OK, more apps. that just happento be launched by web start, but some of them show interestingaspects of it..)<http://www.google.com/search?as_sitesearch=java.sun.com&as_filetype=jnlp>>...Thanks in advance for all the help.Your apprecaiation is best expressed in your future lackof top-posting.  More details here..<http://www.physci.org/codes/javafaq.html#toppost>HTH-- Andrew Thompsonhttp://www.athompson.info/andrew/Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200708/1
0
Reply Andrew 8/13/2007 6:02:28 AM

9 Replies
78 Views

(page loaded in 0.123 seconds)


Reply: