jhsuwm / onejar-maven-plugin

Automatically exported from code.google.com/p/onejar-maven-plugin
0 stars 0 forks source link

Java Store and One-Jar #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I submitted recently my timefinder application (http://timefinder.sf.net)
to the java store using the maven jnlp plugin. This does not work.
(Contacted Sun. hopefully they can solve this issue or point me to my mistake)

So I tried another approach: your nice plugin!

1. I tried to submit a signed one-jar version of TimeFinder. First it fails
via:
Caused by: java.lang.IllegalArgumentException: Unable to locate
com.simontuffs.onejar.Boot in the java.class.path: consider using
-Done-jar.jar.path to specify the one-jar filename.
    at com.simontuffs.onejar.Boot.getMyJarPath(Boot.java:400)
    at com.simontuffs.onejar.Boot.run(Boot.java:212)

Other people had the same problem:
http://forums.sun.com/thread.jspa?threadID=5390621
This issue was simply solved by specifying -Done-jar.jar.path=main.jar in
the warehouse frontend

2. But now it fails via: 
Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:114)
    at java.util.jar.JarFile.<init>(JarFile.java:133)
    at java.util.jar.JarFile.<init>(JarFile.java:70)
    at com.simontuffs.onejar.Boot.run(Boot.java:213)

Maybe this problem is because of the inner jars are unsigned?

> What version of onejar-maven-plugin are you using?

0.96

> What is the output of "mvn -version" on your machine?

Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_15
Java home: /usr/lib/jvm/java-6-sun-1.6.0.15/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux" version: "2.6.31-16-generic" arch: "i386" Family: "unix"

Original issue reported on code.google.com by tableYou...@gmail.com on 21 Dec 2009 at 10:00

GoogleCodeExporter commented 9 years ago
If you want to try for yourself:
https://store.java.com/warehouse/site/Login

Original comment by tableYou...@gmail.com on 21 Dec 2009 at 10:04

GoogleCodeExporter commented 9 years ago
I updated OneJarMojo.java with a hack that would cause all the jars to be 
signed in 
the same way the onejar is signed (see enclosed).  

This was just a proof-of-concept, the key store info is hard coded and would 
need to 
get passed in from the pom.

What I found out is that JNLP will still fail on restricted operations, such as 
io, 
even though the outside and internal jars are all signed in the same way.

Caused by: java.security.AccessControlException: access denied 
(java.util.PropertyPermission user.dir read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)

Original comment by karldinw...@gmail.com on 1 Jan 2010 at 12:42

Attachments:

GoogleCodeExporter commented 9 years ago
Actually, are you sure you want to use OneJAR with JNLP? I'm starting to think 
it
even defeats the purpose of JNLP being able to download just the jars which 
have been
updated, and letting the other ones stay cached on disk...

Isn't there a good way to generate JNLP stuff with some Maven plugin too? What 
I mean
is that the purpose (for me at least) with using OneJAR for standalone 
executable
jars, is that I get one easy way to deliver the app. The same goes for the 
standard
way JNLP is done: it's one easy way for the user to download and launch the 
entire
app with one mouse click.

Or am I missing something in your use-case?

Thanks,
Hugo

Original comment by hugo.josefson.old@gmail.com on 26 Jan 2010 at 7:16

GoogleCodeExporter commented 9 years ago
Yes, you are right. OneJar isn't really for the JNLP-usecase.

The problem was that neither OneJar nor the JNLP plugin worked for the appstore
(allthough both work for my timefinder.de application directly on the site)

And then I thought I post the exceptions here :-)

because I though that there could be use-cases where you need to sign the OneJar
(maybe I was wrong with this assumption)

Original comment by tableYou...@gmail.com on 27 Jan 2010 at 6:26