COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

Filepermisson on jar files

• Email
• 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


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

See related articles to this posting

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

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

>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

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

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

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

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

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

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

9 Replies
95 Views

Similar Articles

12/12/2013 11:04:57 AM
page loaded in 113758 ms. (0)

Similar Artilces:

reference to a jar file inside another jar file
Hi, I need create a manifest file for a jar, but I need set the classpath in the manifest file to reference a jar file inside the current jar file. My idea is getting a single jar file which contains all the needed jar files. JML <no-spam@no-spam.com> wrote: > Hi, I need create a manifest file for a jar, but I need set the classpath in > the manifest file to reference a jar file inside the current jar file. My > idea is getting a single jar file which contains all the needed jar files. This is not possible IIRC: you'll have to copy the .jar files in the same directory...

batch file/jar file
hi guys,Is there an easier way of creating a batch file or jar archive filefor my programme so that it can execute without via j-Grasp(or e-Clipse)?I know how to use unix. is there may'be a unix way of doing it?-Thanks sihle87@gmail.com wrote: > hi guys, > > Is there an easier way of creating a batch file or jar archive file > for my programme so that it can execute without via j-Grasp(or e- > Clipse)? > > I know how to use unix. is there may'be a unix way of doing it? > > -Thanks Jar files can be made executable on both Windows and Linux. The exact met...

cab files and jar files
hellow friends, In my product , to sign a file i need a cab file to be download each time when the page is loaded .Its working in IE5, but in case of Netscape browsers jar files are downloading but it is not working. What i want to know is, whether i need to do any change in browser property in Netscape browser or anyother than that. balakrishnan.dinesh@gmail.com wrote: > hellow friends, > In my product , to sign a file i need a cab file to > be download each time > when the page is loaded .Its working in IE5, but in case of Net...

Launching a chm file that is in a jar file.
We want to include our online help file (chm format) in our jar file. This is easy enough. The problem is I can't figure out how to launch the help file when I need to. I have to be able to execute an OS command to view the help. String cmd = "hh " + pathToHelpFile; Runtime.getRuntime().exec( cmd ); Is there a way to make this work without moving the help file to the user's file system? On 2 Jan 2006 16:03:19 -0800, "pete231" <pdeline@crossroads.com> wrote, quoted or indirectly quoted someone who said : >Is there a way to make this work without moving...

Using JAR files and file extraction
Hi all, I'm currently thinking of the best way to distribute a java app to users and have been considering packaging the whole thing in a jar file (simply so that it can be run in XP using the "open with" command). I know how to set up a jar file to do this...and i know that the contents of a jar file can be totally or partially extracted...but my question is this...can an app run from "inside" a jar (in the above manner) still access directories that have been previously extracted? The reason for this is that i require a number of directories to be consistentl...

Accessing text files within a jar file
I have a simple program that uses a text file for some static data. When I run my program from within Eclipse or from the jar located in my workspace it works fine because it can find the path to my development text file. But I want to be able to run the jar from anywhere. How can I access the file from within the jar file. Important bits of code I have are: private static File mFile = null; private static String mBaseSolution = "../solution/Solutions.txt"; ... mFile = new File(mBaseSolutions); if (mFile.exists()) { ... } else { ...

ZipException when running jar file from command file
A little history: I have created a jar file, MyJar.jar I've set the correct Manifest file so that it can run just by double-clicking it in Windows Explorer. And it runs; no problem here. But I need to specify VM arguments, and I can't specify VM arguments in the manifest file (unless somebody can tell me how, I'd greatly appreciate it). So I created MyJar.cmd file, and specified the VM argument: @echo off java -jar TractorMapper.jar -Druntime.environment=TEST both MyJar.cmd and MyJar.jar are saved in C:\sample directory. Running MyJar.cmd is the problem. 1. If I run it by launc...

How to read an Excel file inside jar/war file
I am working with Weblogic 10 server. My requirement is to fill a template file (.xls) with some data. That means I need read this .xls file and then write into it. I put this .xls file inside the war (webapp/template/test.xls) and I use Apache POI as a library for treating MS documents. The problem is when I try to get the inputStream of this file I got an exception thrown by Weblogic. The interesting thing is that when I put this .xls file somewhere else on the server and pass an absolute Path (ex: /var/tmp/test.xls), it worked perfectly. I think this should be an issue of interaction b...

Files and jars
Dear all, Is it possible to construct a File object from some resource (in this case an ssh private key) in a jar file? Cheers! In article <1110349086.757198.149640@z14g2000cwz.googlegroups.com>, davidol@hushmail.com enlightened us with... > Dear all, > > Is it possible to construct a File object from some resource (in this > case an ssh private key) in a jar file? > AFAIK, you'd have to de-jar it, add the File, then re-jar it. -- -- ~kaeli~ The more ridiculous a belief system, the higher probability of its success. http://www.ipwebdesign.net/wildAtHeart ht...

JAR files in launched app's JAR (navigating URLConnection/JarURLConnection?)
Hi all!I have an application bundled like this (one single JAR containinglibrary JAR's):myapp.jar +- rootpackage | +- Main.class | +... +- images +- lib | +- bcel-5.2.jar | +- forms-1.1.0.jar | +- ... +- ...When starting up, I create a URL like this:---------//the JAR inside the JARString strRelativePath = "lib/bcel-5.2.jar";//determines the class and protocol for the connection, prepend with"/"URL url = this.getClass().getResource("/" + strRelativePath);---------The URL string of url is "jar:file:/C:/dev/bew/myapp.jar!/lib/bcel...

jar file for class
hello alli have some code where the class XMLSignatureFactory is used.apparently this is exposes signing mechanism. however i am unable tofind out the jar file that will contain the required interfaces/implementation.can someone please tell me from where can i download the correspondingjar file ? Also what is the general technique used to find jar filescorresponding to a class file.thanksravinder thakur...

jar files and resources !!
Dear All what is best : to include resources (images,text files,etc) in the JAR or to leave then as external for both is there a difference between loading a resource from the JAR and from the FileSystem I need an example please. Thanks Hi, I can't say anything regarding performance . However, here is what you want for getting resources from jar : getClass().getClassLoader().getResourceAsStream(String name) which gives you an InputStream from the resource. or getClass().getClassLoader().getResource(String name) which gives you the URL of the resource. if your jar contains image....

Problems with JAR file
Hey all, I've got a problem when I try to call a third party java class in MATLAB (7.1.0 R14). The context is that I need to embed some classes that I've written in Java into a Matlab framework. These classes use a third party library (Joone) in the newest version. When I run my classes in Java only, everything works and creates no problem. However, when I try to instantiate the class which uses some classes from the the Joone jar file, I get the error message below. On the other hand, when I instantiate another class that I have written and compiled myself, everything works fine, ...

Errors With Jar file...
Hello all, I am trying to jar up my classes for easy access, the problem is as follows... my application depends on teh postgresql jdbc driver (pg73jdbc.jar) now when i compile and run as classes with this jar file in the CLASSPATH, everythign works fine all well and good. When i jar the classes up, i get a ClassNotFound Exception when looking for the JDBC drivers. (even though it is in my class path) ive even tried: java -jar myapp.jar pg73jdbc.jar and get the same errors. is there something i am missing when creating the jar file? can i somehow include the pg73jdbc.jar file with my ...

Image in Jar file
Hi, I am bundling an application to a jar file, and I am meeting pb with images. My jar structure: - meta-inf\manifest.mf - foo\bar\**\*.class - properties\*.properties - images\*.gif If I don't compress the jar file, the gif can be displayed correctly. If I compress the jar, I can't get the gif images correct. I triied to read the bytes of a gif from within the compressed and from within a uncompressed jar file. The two output are different. The compressed jar reading results in extra bytes for the image. For example, a 1601 bytes images results to a 1643 bytes if read from a ...

where to put my jar files
Hi, I am write a web app with Tomcat. Here is my file structure: --Tomcat --webapps --my app --WEB-INF --jsp myjsp1.jsp myjsp1.jsp --lib myjar1.jar In side myjsp1.jsp, I have <jsp:plugin type=applet code="mypackage.myApplet" codebase="WEB-LIB/lib" archive="myjar1.jar"> </jsp:plugin> "myApplet" is a Java Applet and the class file is in the myjar1.jar. But when I visit myjsp1.jsp, an exception was thrown, saying "myApplet cound not be found". I think it is...

Dependencies of JAR files
Hi, I'm not sure if this is the right forum for my problem, but probably this is teh forum where the guys hang around that are mostly familiar with a problem similar to mine ;-) We've just took over a Java project and I now experience the following problem. The application is a Java standalone application that uses around 55 (!!!) third patry JAR files and I want to clean up this horrible setup (classpath etc.) Does anybody if there is any tool assistance that help me to analyze which jar depends on which jar file. This would really ease my life. I know only JDepend, but that tool is ...

Transfer of JAR Files.
Hi,I am trying to trasnfer a JAR file from my client to server. I amusing a event based middleware so i cant use RMI. Would i need to useserialization?any pointers on this ?Thank You,Adil...

Accessing Files in a JAR
Hello all,I'm wondering if it's possible to directly access files in a JAR. Forexample, I have a JAR called foo.jar, and inside that JAR is a packagecalled my.foo.package. Within that package, I have an XML file that Ineed to be able to parse. Before sticking the package in a JAR, Icould simply do something like:parser.parse("src/my/foo/package/bar.xml")Is there a way to do something similar to this when the XML file isinside a JAR?Thanks in advance! -- BTR Bryan wrote:> Hello all,> > I'm wondering if it's possible to directly access files in a JAR. For&g...