Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 7u45 - java webstart doesn't download my jar and execute application unless i show java console

First, sorry for my English, this isn't my native language.

My environment has :
- a jre 1.5.0_12 (binaries)
- a jre 1.6.0_17 (default jre)
- a jre 1.7.0_45 (binaries)

I have 2 ways to launch the application via Java Webstart :

1) \\<network filesystem>\javaws-1.5.0_12.exe \\<network filesystem>\urClient-DAP2.jnlp

2) "C:\Program Files\Java\jre1.5.0_12\bin\javaws.exe" "http://some-server.com/EU10.jnlp"

Before installing Java 1.7, no problem.

But since I installed the JRE 1.7 (only binaries, and registered in regedit), the 2nd way doesn't want to download the JAR and execute the application. I only got the Java splash screen - "Java Loading" appears then disappears in about 20 seconds.

I've found two workarounds :
- disable or uninstall the JRE 1.7
- Or the weirdest way : I enable java console ....(deployment.console.startup.mode=SHOW)

I'm stuck, and the two workarounds are not viable...

EDIT : in the javaws trace i got this exception :

`Exception in thread "javawsApplicationMain" java.lang.NullPointerException
at javax.swing.SwingUtilities.appContextGet(Unknown Source)
at javax.swing.UIManager.getLAFState(Unknown Source)
at javax.swing.UIManager.maybeInitialize(Unknown Source)
at javax.swing.UIManager.getLookAndFeel(Unknown Source)
at com.sun.deploy.util.DeployUIManager.setLookAndFeel(Unknown Source)
at com.sun.javaws.ui.DownloadWindow.buildIntroScreen(Unknown Source)
at com.sun.javaws.Launcher.downloadResources(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)`

EDIT 2 : I find this difference between running via network file or http :

via HTTP (doesn't donwload jar) :
cache: User cache dir = C:\Documents and Settings\U01E519\Application Data\Sun\Java\Deployment\cache\javaws cache: System cache dir = C:\Program Files\Java\jre1.5.0_12\cache\javaws cache: Muffin Cache = C:\Documents and Settings\U01E519\Application Data\Sun\Java\Deployment\cache\javaws\muffins basic: Java part started basic: jnlpx.jvm: C:\Program Files\Java\jre1.7.0_45\bin\javaw.exe basic: jnlpx.splashport: 3611 basic: jnlpx.remove: false basic: jnlpx.heapsize: NULL,NULL

via network file (download jar and start application) :

cache: User cache dir = C:\Documents and Settings\U01E519\Application Data\Sun\Java\Deployment\cache\javaws cache: System cache dir = C:\Program Files\Java\jre1.5.0_12\cache\javaws cache: Muffin Cache = C:\Documents and Settings\U01E519\Application Data\Sun\Java\Deployment\cache\javaws\muffins basic: Java part started basic: jnlpx.jvm: C:\Program Files\Java\jre1.5.0_12\bin\javaw.exe basic: jnlpx.splashport: 3831 basic: jnlpx.remove: true basic: jnlpx.heapsize: 64m,256m

The parameter jnlpx.jvm is different and i don't know why when i try to acess jnlp with http the jvm is 1.7, i want to use the 1.5 instead.

EDIT 3 : I solved the problem of EDIT 2 now i run java web start with a bat :

`@echo off
set JRE_HOME="C:\Program Files\Java\jre6"
echo %JRE_HOME%
set ARG=%ARG% -Xbootclasspath/a:%JRE_HOME%\lib\javaws.jar;%JRE_HOME%\lib\deploy.jar
set ARG=%ARG% -classpath %JRE_HOME%\lib\deploy.jar
set ARG=%ARG% -Djnlpx.home=%JRE_HOME%\bin
set ARG=%ARG% -Djnlpx.slashport=1322
set ARG=%ARG% -Djnlpx.jvm=%JRE_HOME%\bin\javaw.exe
set ARG=%ARG% -Djnlpx.remove=false

echo %ARG%                     

%JRE_HOME%\bin\javaw.exe %ARG% com.sun.javaws.Main "PRC_ApplicationInstruction1.6.jnlp"`

And in JNLP file never use <j2se version="1.6+"> but <j2se version="1.6">

Thanks in advance.

like image 1000
user3633094 Avatar asked Oct 01 '22 09:10

user3633094


2 Answers

== Step 1

Your issue comes from java 7u45 security only. First, try to add this properties to your jars :

Permissions: all-permissions
Codebase: *
Trusted-Library: true

It could be enough and will clear the security warnings.

== Step 2

If it is not enough : 7u45 won't transport non-secure properties to your application unless the JNLP is signed (i.e.: the osgi bundle-list in Eclipse RCP). So try to signed your JNLP.

== Step 3

If you can't signed the JNLP ^^ You can turned your non-secure properties to secure ones by adding "jnlp" at the beginning of the name to all your properties

The Oracle documentation on that flaw : http://docs.oracle.com/javase/tutorial/deployment/doingMoreWithRIA/settingArgsProperties.html

like image 138
Kraiss Avatar answered Oct 04 '22 21:10

Kraiss


Finally I resolve all the problem this way :

I run java web start with a bat :

`@echo off
set JRE_HOME="C:\Program Files\Java\jre6"
echo %JRE_HOME%
set ARG=%ARG% -Xbootclasspath/a:%JRE_HOME%\lib\javaws.jar;%JRE_HOME%\lib\deploy.jar
set ARG=%ARG% -classpath %JRE_HOME%\lib\deploy.jar
set ARG=%ARG% -Djnlpx.home=%JRE_HOME%\bin 
set ARG=%ARG% -Djnlpx.slashport=1322
set ARG=%ARG% -Djnlpx.jvm=%JRE_HOME%\bin\javaw.exe
set ARG=%ARG% -Djnlpx.remove=false
echo %ARG%                     
%JRE_HOME%\bin\javaw.exe %ARG% com.sun.javaws.Main "PRC_ApplicationInstruction1.6.jnlp"`

And in JNLP file never use <j2se version="1.6+"> but <j2se version="1.6">

like image 43
user3633094 Avatar answered Oct 04 '22 19:10

user3633094