Java Web Start application runs under jre8u40 but not jre8u51 - java

We have a Java web app that uses javaws. It will run fine under Java 8 update 40, but under Java 8 update 51 jp2launcher.exe just stops, without launching the application.
I have found the logs in C:\Users\me\AppData\LocalLow\Sun\Java\Deployment\log but they're identical between j8u40 and j8u51 (except of course for the order jars are loaded, the jre version and the launch time).
I have logged the launch using Process Monitor, for both jre versions. Under j8u51, jp2launcher.exe just exits with the resule "SUCCESS". Comparing the two procmon logs, I can't pick out anything unusual. They both rummage through the C:\Users\me\AppData\LocalLow\Sun\Java\Deployment directory and their respective C:\Program Files\Java\jre1.8.0_XX\lib directories and such like, but then the j8u51 one just exits.
The Windows event logs don't show anything Java related.
Is there anywhere else I can look for diagnostic information? Any suggestions on what might be going wrong here?
update: I have managed to run the jnlp with set "JAVAWS_VM_ARGS=-Xcheck:jni -XX:-TraceClassLoadingPreorder -XX:+PrintCommandLineFlags -verbose:jni -verbose:class -verbose:gc -XX:+PrintGCDetails -Djava.util.logging.config.file=C:\misc\logging.properties" and log the stdout/stderr. It looks like javaws and jp2launcher log to the output, then both jre8u40 and jre8u51 versions terminate. Presumably in the j8u40 version it is launching another jp2launcher.exe to run the application.
Comparing the two output logs yields nothing of interest. The classes are loaded in nearly identical order, mostly identical classes other than a few differences that are easily explained by just being more up-to-date classes being used.
further update: I have been able to launch the application directly, using java.exe, by obtaining the client files from the server install and unpacking them. The app itself runs just fine under jre8u51, so the problem definitely lies with javaws itself.
update3: clearing the cache does not solve the problem. The issue occurs on separate machines, even with entirely fresh Java installs.
update4: As an experiment, I've just tried under Ubuntu Linux. Our product does not technically support Linux, but I thought I'd try anyway. As it happens, the behaviour is identical! Under jre8u40 the app launches, and under jre8u51 it does not!
5: it turns out the problem is happening under u45 as well, which is the update immediately after u40. So, the cause seems to be something that changed in u45, rather than in u51.

Got it!
There are a few interacting elements here:
The jnlp contains a j2se element for Java 6 and for Java 7. Running on Java 8, it appears that it uses the Java 6 entry.
The Java 6 entry specifies VM arguments, while the Java 7 one does not.
After trial and error, I have determined that the -XX:+CMSIncrementalMode VM argument is what’s causing it to fail. I don’t know what this arg does, but apparently JRE8u45+ doesn’t like it.
I downloaded and modified the jnlp to test the above. To get javaws to actually use my changes, I had to remove the href attribute of the root jnlp element. Otherwise, javaws ignored my changes and used the copy of the jnlp on the server.
My current hypothesis is that JRE8u45+ has a bug where it uses the VM arguments from the wrong version.
I have just tested a custom jnlp with 1.6, 1.7 and 1.8 entries in it, where the 1.6 one has the vm args and the 1.7 and 1.8 ones do not.
Javaws does not prompt “The application wants to use Java 7, but you should instead use the most up-to-date one on your system, is that ok?”. Therefore, at this point is has recognised that there is a 1.8 entry in there.
However, it fails to launch the app. Therefore, at that point, it must have got confused about what jnlp element it was on.
So, it looks like the workaround is to remove the -XX:+CMSIncrementalMode VM arg from the jnlp on the server side.

Related

how to configure java on windows 10

I suddenly found that I could no longer run my own developed JAVA apps by simply double-clicking the JAR file - it reported that the main class was not found.
With trial and error I found that if I forced 32-bit JAVA 1.8.0_161 to run then things worked fine. What was running by default was 64-bit JAVA 1.9. I also found it was not using JAVA_HOME but instead was running what it found in %APPDATA%\Oracle\Java.
I tried lots of things but in the end I uninstalled the 64-bit JAVA 1.9, put the path for 1.8.0_161 in JAVA_HOME, put %JAVA_HOME%\bin in the PATH and that got me most of the way...
Now if I run java -jar <jarFileName.jar> then my program runs just fine, but if I attempt to run the jar file by double clicking on it then it still could not load the main class.
Windows 10 default programs for JAR files says Java(TM) Platform SE Binary - tried forcibly changing this to point to the java.exe for 1.8.0_161 but that still doesn't work.
The JAVA Settings Console doesn't look like the ones in various web queries - I think it changed with 64-bit JAVA.
So I suspect my system is no longer properly configured.
How do I fixup the configuration to get back to where I can simply double click a JAR file in order to run it.
Best Regards
SteveM

How do I install Pentaho BI CE on windows?

I'm sure this has a relatively simple answer -_- , but I keep getting a ton of errors and I have no idea why.
Here is the guide I am following:
http://akbarahmed.com/2012/05/12/install-pentaho-bi-server-4-5-on-windows-7-x64/
I am using Java 1.8.0.05, and biserver-ce-5.0.1-stable
When I run start-pentaho.bat, and the Tomcat window opens, I get a whole host of errors.
If I go to localhost:8080/pentaho, I get the following errors:
One or more system listeners failed. These are set in the systemListeners.xml.
org.pentaho.platform.api.engine.PentahoSystemException: PentahoSystem.ERROR_0014 -
Error while trying to execute startup sequence for
org.pentaho.platform.repository2.unified.BackingRepositoryLifecycleManagerSystemListener
I have gone through this entire process 3 times, but nothing seems to work.
There are 3 things you have to take care of:
When running on windows, it is easy to run into Windows' path-length limitation. This then will break the jar-loading which in return gives you random errors as the Tomcat server cannot find the classes contained in these jars. So when you install, do not install it deep into a directory, keep it at the root of your disk. From hard experience, I now always install it in DRIVE:\Pentaho
The Server will not run without the system database. If your logs show you a Quartz-Error, or a Hibernate error, then your HSQL database is not running. In the download, you'll find a "data" directory. Start the "start-hypersonic.bat" before you start the main Pentaho server.
Pentaho does not run with Java 8. There seem to be some incompatible changes in the JDK and I have not been able to actually start it up correctly. You have to use JDK 1.7 to be successful. ALso make sure that your JAVA_HOME or PENTAHO_JAVA_HOME points to the correct JDK.
The Pentaho bat files try to locate a Java installation automatically, and without explicitly setting these environment variables, any JDK may be picked up at random. Usually that is the last JDK that has been installed or updated. So to be safe, lock down the JDK by setting these variables (via Control Panel-> System -> Advanced System Settings -> Environment Variables)
You need to check the catalina.out and pentaho.log files (both should be at biserver-ce/tomcat/logs).
They'll give you more detail on why the server is not starting.
I was having the same error when I installed Java 8 and even after I reinstall Java 7 without removing Java 8 completely.
Remove all Java installations, then you install Java SDK 7
Set the environment variable PENTAHO_JAVA_HOME as your Java 7 path
Then you reboot your computer
Then you start Pentaho BI Server
Hope this help you.
BTW, don't use IE or Safari.

VisualVM "not supported for this JVM" on all local applications?

I have already spent a long time to load and test my application, now I need to profile it. But unluckily, the VisualVM always says "not supported for this JVM" on my local applications?
The applications were started on the same JVM with VisualVM.
I found out that (at least under Windows) one can easily write small batch files to run VisualVM in combination with specific JVMs, which is important for me, since I have installed the 32bit JDK alongside with the 64bit JDK (I need both, so this is sensible for me).
I have created two batch files in the folder "S:\applications\visualvm\bin\":
run_32.bat:
#echo off
START "VisualVM 32" visualvm.exe --jdkhome "C:\Program Files (x86)\Java\jdk1.7.0_07"
run_64.bat:
#echo off
START "VisualVM 64" visualvm.exe --jdkhome "C:\Program Files\Java\jdk1.7.0_07"
Obviously, all paths may differ on your system, but the general idea should still work correctly (on all 64bit versions of Windows). The benefit is that I can use the 32bit batch file when I want to use VisualVM in combination with Java applications that run on the 32bit JVM, and so on for 64bit.
The "start" command has the only benefit that the batch file launches the application without waiting for it to finish, so the command prompt window closes immediately. This is not a feature of VisualVM, but of the Windows batch file interpreter.
In my case, even with the JVMs matching (both 64-Bit), the only way to get things working was sending the argument -Dcom.sun.management.jmxremote to the JVM to be monitored. That also works if you are having problems to connect via Java Mission Control (JMC).
According to JMX's documentation, this what the argument does:
Setting this property registered the Java VM platform's MBeans and published the Remote Method Invocation (RMI) connector via a private interface to allow JMX client applications to monitor a local Java platform, that is, a Java VM running on the same machine as the JMX client.
This was supposed to be enabled automatically, but for some reason it wasn't on my Linux.
VisualVM needs to be run with the same JVM - at least Java 6 with the same 32-bit/64-bit size - as the program to be profiled. (You also need to be the same user, but then this message does not apply).
I would be triple-check that it was the exact same JVM in your situation.
On Linux:
Make sure that your /etc/hosts correctly references the effective ip address of your "hostname"
It appears that a discrepancy here totally confuses the poor jvisualvm and its programmers.
I too got the same problem for local tomcat, I search for solutions for stackoverflow. after some serious debugging, I figured out that VisualGC don't have permissions to get GC informations from tool.jar file.
by links
http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstatd.html#SECURITY
https://stackoverflow.com/a/42107355/3876619
I following steps to solve the issue
1) Create a permission file
vim /tmp/tools.policy
Add
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
save it
2) Now add /tmp/tools.policy to JVM startup parameters
-Djava.security.policy=/tmp/tools.policy
3) Run jvisualVm with sudo
An issue that I just found, thanks to the hint from #user3356656, is that if you start the program while your machine is on one IP, and then try to connect while it is on a different IP, it will fail.
I also met this issue. My case is that on linux, I started tomcat with tomcat_user but I run jvisualvm with root user. It works after I start tomcat with root user.
I was having the problem having of visualvm detect my local tomcat installation on Windows 7. I could connect manually, but then things like memory snapshots and visualgc plugin were not enabled. I confirmed that I was using same JVM version, temp file permissions, etc. Didn't work. Then I found that starting visualvm first, and then tomcat, solved the problem.
As you can see, you are running VisualVM on 32bit JVM
You don't need to unistall 32bit JVM. Just tell VisualVM to use tour 64bit JVM.
If you want to change it permanently, you can edit
in visualvm_13\etc\visualvm.conf and specify the path of jvm here
My problem was JVM optimizations - -XX:+PerfDisableSharedMem flag will break VisualGC. This is apparent if jps will not show your app in the listing.
I can reproduce next behaviour.
I have a java application with right-click menu item to open jvisualvm.
I'm running this java application as standalone setup from a bat file.
It means I modify %path% and other needed environment variables like JDK
accordingly to form my environment.
The BAT that starts application is marked running as non-admin. Environment points to a 64-bit JDK.
Then I start other java application as admin. VM lives from the to same 64-bit JDK-source.
Then I start jvisualvm from first app with the right click ie.as non-admin.
I can see the app in jvisualvm ‘Applications list’ but clickin ‘System properties’ gives error. Message is “Not supported for this JVM”.
JVM arguments are exposed.
Solution is like in some other previous comments:
Starting my right-click jvisualvm-starter as admin I can see also "system properties" .
Certainly if JDKs would be 32-bit and other 64-bit it would not work. been there.
I thought this notion needs to be added here.
In my case, the application was running with admin permissions. So, visualVM also need to be running as admin.
I have changed name to my Windows User and set it all lowercase, restarted my PC and it all works now.
For me, the reason is that I have run the "jstatd" with a different user with the JVM process. I have a special user in the linux to start the JVM thread(it is a tomcat), but I start the jstatd process with root. If you use root to run jps, you cannot see any information of the JVM threads belonging to other users. That is the trouble.
I killed the "jstatd" process started by root, su to the owner of the JVM process, and restart the "jstatd" process and everything wokrs fine now.

Java Web Start and allowArraySyntax is not set

ref: http://bugs.sun.com/view_bug.do?bug_id=6434149
My problem is that sun.lang.ClassLoader.allowArraySyntax is not set to true when using java webstart (javaws) later than 1.6.0_05 (JRE is 1.6.0_14).
I have tried:
set JAVAWS_VM_ARGS=-Dsun.lang.ClassLoader.allowArraySyntax=true
or manually specifying it:
javaws.exe -J-Dsun.lang.ClassLoader.allowArraySyntax=true ...
But when outputting the system property I only get null (if later than 1.6.0_05).
I really need web start to work, any ideas?
Some setup information:
Weblogic 9.2 on Windows (server)
Java client also running on Windows
Due to some strange characters at the beginning of my jnlp-file, javaws, apparently, did a second launch (this could be seen where the java-console started twice) where the vmargs were lost...
Facing this issue myself with a weblogic service and I cannot update the server platform at this time. Looks like this VM setting can be passed in through the JNLP file in the j2se or java tag
java-vm-args="-Dsun.lang.ClassLoader.allowArraySyntax=true"
But there seems to be a java 6 bug that is not passing this setting on to the JVM, see https://bugs.openjdk.java.net/browse/JDK-6953324. This is said to be fixed in java release 6u23 and seems to work in the 6u45 or so.
I found another webstart article stating that this setting can be done in a Property tag but have not found that to work.

I am not able launch JNLP applications using "Java Web Start"?

Up until recently, I was able to launch/open JNLP files in Firefox using Java web start.
Don't know what happened all of a sudden JNLP files stopped launching, a splash screen appears saying Java Starting... and then nothing happens. Even the Java Console in the browser and javacpl.cpl applet doesn't open.
Tried all possibilities: removed all older version and installed the latest JRE (java version "1.6.0_17"), still it doesn't work.
Done some googling for this problem, people suggested to start javaws.exe with -viewer option but same behavior (a splash screen appears saying "Java Starting..." and then disappears)
The problem is that I don't know any place (logs etc.) to look for to see what is causing the problem.
I am using WinXP SP3, and some of the screenshots below shows further info about my system.
I can provide any other detail if required but please help me solve this problem.
Have a look at what happens if you run javaws.exe directly from the command line.
I know this is an older question but this past week I started to get a similar problem, so I leave here some notes regarding the solution that fits me.
This happened only in some Windows machines using even the last JRE to date (1.8.0_45).
The Java Web Start started to load but nothing happened and none of the previous solution attempts worked.
After some digging i've found this thread, which gives the same setup and a great explanation.
https://community.oracle.com/thread/3676876
So, in conclusion, it was a memory problem in x86 JRE and since our JNLP's max heap was defined as 1024MB, we changed to 780MB as suggested and it was fixed.
However, if you need more than 780MB, can always try launching in a x64 JRE version.
i had the same problem here. go to your Java Control Panel and Settings... Uncheck 'Keep temporary files on my computer'. Apply changes and try again your .jnlp
Note: Tested on different machines; Windows Server 2012, Windows Server 2008 and Windows 7 64bit.
Java Version: 1.7++ since my jnlp app is built on 1.7
Please let me know your feedback too. :D
Java web start should be enabled.
Check if javaws (Java web start is enabled for your system), Use below command in console to open java control panel.
javaws -viewer
If javacpl does not open and gives you Could not find the main class:, it could be that Java is confused because of changes in deployment.properties (can be found in C:\Users\<username>\AppData\LocalLow\Sun\Java\Deployment on Win7). Delete that file and everything's fine.
This bug seems to be 6 years old, cf. An app should be able to ignore properties that have become obsolete over time, shouldn't it?
Although this question is bit old, the issue was caused by corrupted ClearType registry setting and resolved by fixing it, as described in this ClearType, install4j and case of Java bug post.
ClearType, install4j and case of Java bug Java
Do you know what
ClearType (font-smoothing technology in Windows) has in common with
Java (programming language and one of the recommended frameworks)?
Nothing except that they were working together hard at making me
miserable for few months. I had some Java software that I couldn’t
install. I mean really couldn’t – not even figure out reason or
reproduce it on another PC.
Recently I was approved for Woopra beta (site analytics service) and
it uses desktop client written in Java… I couldn’t install. That got
me really mad. :)
Story All of the software in question was similar :
setup based on install4j; setup crashing with bunch of errors. I was
blaming install4j during early (hundred or so) attempts to solve
issue. Later I slowly understood that if it was that bugged for that
long time – solution would have been created and googled.
Tracing After shifting focus from install4j I decided to push Java
framework. I was trying stable versions earlier so decided to go for
non-stable 1.6 Update 10 Release Candidate.
This actually fixed error messages but not crashes. I had also noticed
that there was new error log created in directory with setup files.
Previously I had only seen logs in Windows temporary directory.
New error log was saying following :
Could not display the GUI. This application needs access to an X
Server. If you have access there is probably an X library missing.
******************************************************************* You can also run this application in console mode without access to an
X server by passing the argument -c Very weird to look for X-Server on
non-Linux PC, isn’t it? So I decided to try that “-c” argument. And
was actually able to install in console mode.
Happy ending? Nope. Now installed app was crashing. But it really got
me thinking. If console works but graphical interface doesn’t – there
must be problem with latter.
One more error log (in application folder) was now saying (among other
things) :
Caused by: java.lang.IllegalArgumentException: -60397977 incompatible
with Text-specific LCD contrast key Which successfully googled me
description of bug with Java unable to read non-standard ClearType
registry setting.
Solution I immediately launched ClearType Tuner from Control Panel and
found setting showing gibberish number. After correcting it to proper
one all problems with Java were instantly gone.
cleartypetuner_screenshot Lessons learned Don’t be fast to blame
software problems on single application. Even minor and totally
unrelated settings can launch deadly chain reactions. Links Jave
Runtime Environment http://www.java.com/en/download/index.jsp
ClearType Tuner
http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx
Woopra http://www.woopra.com/
install4j
http://www.ej-technologies.com/products/install4j/overview.html
I was also facing the same problem. To fix this to the following steps.
open Javaws from cmd runnig javaws -viewer command. A new window will open
Select the jnlp file which you want and click the run button.
Close the javaws viewer window.
Same solution worked as suggested by hpereira
The issue was due to JRE version was 32 bit and not 64 Bit
Check with java -version to see if your Java is 64 bit
C:\>java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) **64-Bit Server** VM (build 25.192-b12, mixed mode)
Is this an application to which you have the code? Java 6u14 included a change to the way it handles jar security that for us caused very similar issues. If your jars are signed and work with Java 6u13 or below, you might consider either refactoring your code to work around this update or requiring Java 6u13 or below. Unfortunately I don't recall exactly what we did to resolve the issue - it was panic mode at the time.
Again, if you have the code you have tools to work with. You can put in System.out.println statements in your startup routines - anything console output is displayed in the command window when you run the JNLP from the command line. Otherwise you might consider using a nice logger like log4j to get a better idea of the point of failure.
You may also consider removing the application entirely and downloading it anew. Java Web Start has a Control Panel applet that allows you to see the URL your app is downloading from (could be the wrong one), uninstall the app, set security options, etc.
I had the exact same problem. Turned out that the max-heap-size was set to 1024 and missing the unit. The configuration needed to be max-heap-size=1024m.
So apparently invalid memory configuration in the jnlp file will cause this exact behavior.
In my case, the problem was caused by starting my app from a shortcut on the public desktop (windows 7). As a result, as far as I can tell, the temporary files location was set to c:\users\public\etc. This resulted in the unable to write to cache detail. When I reset to defaults in the temporary files control applet, all worked fine.
In my case, Netbeans automatically creates a .jnlp file that doesn't work and my problem was due to an accidental overwriting of the launch.jnlp file on the server (by the inadequate and incorrect version from Netbeans). This caused a mismatch between the local .jnlp file and the remote .jnlp file, resulting in Java Web Start just quitting after "Verifying application."
So no one else has to waste an hour finding a bug that should be communicated adequately (but isn't) by Java WS.
This can also be due to environment variable CATALINA_HOME in your system. In our organization there were several cases where JNLP applications just refused to start without logging anything and emptying CATALINA_HOME solved the issue.
I had the environment variable set in the command prompt and it didn't appear in GUI. I'm not sure if setx command or register removal commands did the trick. Restart seems to be necessary after removing the variable.
I believe this is a security problem. If I download the jnpl file and execute it after a clean java 8 installation via javaws myfile.jnpl everything is working fine (I get multiple windows where I have to confirm some security problems).
I wanted to share the root cause for my issue. I was using High DPI in Windows and this caused JNLP to not launch. I had to turn off High DPI for this to work. Hope this helps.
Try Java Web Launcher, rather than Java Web Start Launcher. It worked for me.
Right-click on the JNLP file that is not opening and select Open With.
In the ‘How you want to open this File’ window, scroll down and click on Look for another app on this PC option.
When the File Explorer window opens, navigate to the following location:
C:\Program Files (x86)\Java\jre1.8.0_261\bin
or the folder for 64bit version
Select javaws.exe and click the Open button. This will open the JNLP file as intended.
Make sure to check the Always use this app to open .jnlp files.
That's all.

Categories