I am unable to run more than one instance of java webstart at any given time.
For example, I am unable to run both the production & QA instance of an application at once, both of which are launched via java webstart. Additionally, I am unable to run the java webstart cache viewer at the same time as either the production or QA instance of my application.
I am however able to run any of the above three webstart launches when they are run in isolation of each other. When I try to bring up a second option, I see the 'Java Loading...' screen which then disappears and nothing happens.
Additionally, I have tried to delete the webstart cache (via the java webstart cache viewer) and I receive the following error regardless of which JRE I point to:
"Bad installation. Error invoking Java VM (execv)
'path to my javaw.exe'"
I expect both the problems I mention above are interlinked. I do not believe I have changed any configuration recently and I have been happily running java webstart for years.
Has anyone seen such a problem before?
Thanks,
Jack
EDIT: When the second instance of webstart attempts to run, during the display of the 'Java Loading...' screen I can see in the task manager that a new javaw.exe process is spawned. This process almost immediately dies though. I'm not sure how to inspect the failure in that process, but I expect it is similar to the failure when trying to clear my cache through the webstart cache viewer.
You may be able to use javaws from the command line to run a second instance in -offline mode. The verbose option is handy, too.
javaws -offline -verbose MyApplication.jnlp
I think it is because both instances of the application use the same folder as current working directory. I do not remember exactly but it is somewhere under user home and the folder contains the application name or something...
So, if this is correct the solution is to change the application name like "My Application - QA" vs. "My Application" used on production.
The name is somewhere in jnlp.xml.
The reason may be the startup parameters for client java/javaw, which do not allow to run more than one instance of Java. For example because of set debug port. These parameters can be set in the command line or in the Java Control Panel -> Java -> button View.
Related
I encounter some very strange behavior and I don't know how to handle it.
I suspect that the behavior started to reproduce after last Windows upgrade. But I am not sure if it has anything related to it. (I discovered it when I tried to run maven, which uses java)
The behavior is the following: when run java (e.g. java.exe -version) from command line, it does nothing (like below). The process looks like it is hanged.
enter image description here
I did the following tests:
make a clone of java.exe (e.g. jv.exe) and run it. It works.enter image description here
rename another application to java.exe (e.g. processmonitor.exe to java.exe). When run application, it doesn't open.enter image description here
renamed java.exe to java.exe.bkp and make a link 'java.exe' to 'jv.exe' (which works), and the process is hanged.
make another link java1.exe to jv.exe and it works.enter image description here
did all the operations with&without network, and no difference (java.exe doesn't work, the others work)
restart windows in 'save mode' (+/- network) and java.exe works
I disabled the firewall from windows, and/or I added rules for java.exe. It doesn't work.
Initially I had many JVMs installed. I uninstalled all of them and installed only the one in images. All above tests are made after new installation.
Also, I observed that every time I run java.exe (but not when I run jv.exe or java1.exe) there is a new file java.exe.XXX.dat created in c:\Users\user.name\AppVerifierLogs.enter image description here Searching on google, it seems that is some kind of log file, which can be viewed with this application (https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/application-verifier) but I don't find the standalone application. Maybe it is already installed in the system, but I don't know where or how to enable it.
It seems that for some reason, the Windows is blocking all processes named 'java', no matter if it is actually the java program or any other application. But I'm out of ideas regarding what could be the cause, or how to continue to investigate.
If anyone can help me, I will be grateful to him.
Thank you.
I am building a statistical analysis application on Netbeans RCP for solving tests faster and with less effort https://github.com/PaulMaxAvalosAguilar/Statistikos-Klubas.
The thing is very simple:
1.-There's a module called TrabajosViewer which uses the nodes API to display workspaces where you can organize your samples with some meaningful name, first you create a workspace and then you add some data to it.
2.- You open editor top component which calculates some descriptive satistics stuff for all the sample you entered
3.- All stuff you need for a test is done! Samples are stored in an embedded H2 database(datos module) and results are calculated each time you click on a TrabajosNode.
However when I was testing the app I had to add the following sample:
https://1drv.ms/t/s!AkZmosJJMvdIu3c_IiVkD6JAVVgk (3344 elements); as the app had multithreading capabilities everything was fine, except that after building a release as OS independent zip the app froze from the swing Top Component which was very rare as that wasn't happening on inside Netbeans IDE. I think it has something to see with the build script since I built a Gradle version an everything worked fine https://github.com/PaulMaxAvalosAguilar/Statistikos-Klubas2
If you have an app - any Java app really, not just NetBeans RCP - and it freezes then what you want to do is obtain a thread dump. The thread dump will almost always give the clue as to why there's a freeze.
Java has 5 or 6 different ways to obtain a thread dump for a running application (just google it). Out of these methods, the one preferred is the so-called Ctrl-Break method because it is the one which gives most information. The downside of the method is that you need to have started your application from a console window. But if you can consistently replicate the freeze, then I don't think that's a problem for you. Here's what you would do if you are on Windows:
Start cmd.exe
From the command window, start your application, e.g. bin\sillyapp64.exe.
Wait for the freeze to happen on your application
Now press Ctrl-Break in the command window. This will give you a thread dump printed into your command window.
Upload the thread dump as part of your question. (or host it somewhere if it is too big)
Instructions for Linux/MacOSX are similar albeit in step 4 you would instead send your process a QUIT signal using the kill command.
I have created a java application.
I also created another java application which install the first application.
The program runs perfectly.
However the program isn't displayed in control panel->programs.
I also want to create an uninstaller (let's say unintaller.bat). But i want to works like any other uninstaller. When someone goes to Control Panel->serach program->uninstall this program it will run the uninstaller.bat
In other words, the concept is how to declare the java application in windows...
Any idea???
Installing an application doesn't necessarily mean registering it with the operating system. For example, for a Mac, I can open an App without having it added to the Applications folder.
Same with Windows. Just because a new file can be added to the Start menu, it doesn't mean it was registered.
Use a Windows installer. There are tons that are open source, and even MS provides a free one: http://support.microsoft.com/kb/942288.
This will allow you to install an uninstall an application using standard tools. Yes. It can be called from a bat file.
Java open source installers: http://java-source.net/open-source/installer-generators
Due to a suite of antivirus and security policies, a java applet I developed for my organization loads very slowly. The problem is not the cache or the applet, but rather it's JVM. When Windows first loads, if I go to command window and enter "java", it will take nearly a minute for the response (the command usage text) to come up. Subsequent commands are responded immediately.
So, one mitigation I can think of is to set all users to run java once as they login. I can either put a shortcut to Start Up folder in the start menu, or create a registry key. If I want this to be as least intrusive as possible (load it in background and in low priority), what's the best way to do this?
Did you consider Windows Task Scheduler and task that starts on windows start-up?
You can add the call to java to the registry, under
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
http://msdn.microsoft.com/en-us/library/aa376977(v=vs.85).aspx
But what about not using java?
After spending half a day searching and trying, I'm finally giving up.
I have a java application of which I create a runnable jar (to include any other libs and just have a single jar file). With launch4j and the runnable jar I'm making an executable "MyApp.exe".
The executable ist working fine, but I want to pin it to my windows 7 taskbar. For now, I just have the taskbar entry "Close window".
After reading and implementing the following solutions with JNA
Pinning a Java application to the Windows 7 taskbar
Using JNA to get/set application identifier
my Application displays it's "Application User Model ID" correctly in the gui (just for testing purpose).
BUT: my program is shown as "javaw.exe" in the Task Manager and I still can't pin it to the taskbar, even though I set the launch4j option "custom process name and XP style manifest".
Background information: I'm working with a windows 7 admin account and I don't want the app the require admin rights.
Anyways, if I start the app "as administrator" from the context menu and confirm the UAC message, I can now pin to the taskbar. BUT: even though I set the "Application User Model ID" properly, windows still wants to pin "javaw.exe", even though my program is now shown as "MyApp.exe" in the TaskManager.
I'm totaly confused. But I'm obviously not the only one, having these issues.
=> See the last comments to Gregory Pakosz answer in Using JNA to get/set application identifier
Final questions:
Gregory Pakosz way with JNA to set the "Application User Model ID" ( https://stackoverflow.com/a/1928830/1128689 ) is working for me. But still, windows recognizes my app as an instance of "javaw.exe". What else do I have to do?
Did maybe some windows or java update break something here?
Do I really have to run my app with elevated user rights? I really don't want to...
Are there some more options in launch4j which I have to set?
Do I have to use a manifest file in launch4j?
I got this working by creating an Exe from a runnable jar with the help of JSmooth
.Pinned it to the taskbar, and ran it with no problems.
Hope this helps
No problem with winrun4j either, which is newer and easier to use than Jsmooth
The root cause: javaw is registered as a Host process (in Windows' registry). The shortcut behaviour is probably caused by following (source: Application User Model IDs (AppUserModelIDs))
Application-Defined and System-Defined AppUserModelIDs
Some applications do not declare an explicit AppUserModelID. They are
optional. In that case, the system uses a series of heuristics to
assign an internal AppUserModelID.
[...]
if the process was launched through a shortcut that contains launch
arguments (usually the target content to host as the "application"),
the system can determine identity and the application can be pinned
and relaunched.
About the Host Process behaviour:
Registering an Application as a Host Process
An application can set
the IsHostApp registry entry to cause that executable's process to be
considered a host process by the taskbar. This affects its grouping
and default Jump List entries.
Are you looking for this, which I used in my application to show the running Java application on windows taskbar..
SystemTray systemTray = new SystemTray(composite, parent.getShell(), parent.getDisplay(), "My Application");
systemTray.makeSystemTray();