I have a Java applet that downloads data from where it's hosted, using HTTP. The applet has default permissions for an applet, that is, not many. Randomly during download, maybe 90% chance of reproductibility, at a specific part of the log, the java executable hosted by Firefox will exit abruptly, and the Java Console will be closed.
I thought it was my first JVM crash after just a few weeks of Java, but could not find the Fatal Error Log. Until I found out that when Chromium is used to open the applet, it works 100% (many tries in various conditions, alterning with Firefox)
Both browsers execute use the same commandlines for the java executable
Firefox: /usr/lib/jvm/java-6-sun-1.6.0.26/jre/bin/java -D__jvm_launched=20972388862 -Xbootclasspath/a:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/deploy.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/javaws.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/plugin.jar -Djava.class.path=/usr/lib/jvm/java-6-sun-1.6.0.26/jre/classes -Dsun.awt.warmup=true sun.plugin2.main.client.PluginMain write_pipe_name=/tmp/.com.sun.deploy.net.socket.5712.287531591049678510.AF_UNIX
Chromium: /usr/lib/jvm/java-6-sun-1.6.0.26/jre/bin/java -D__jvm_launched=20858056974 -Xbootclasspath/a:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/deploy.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/javaws.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/plugin.jar -Djava.class.path=/usr/lib/jvm/java-6-sun-1.6.0.26/jre/classes -Dsun.awt.warmup=true sun.plugin2.main.client.PluginMain write_pipe_name=/tmp/.com.sun.deploy.net.socket.5428.6724684151611746860.AF_UNIX
Then I booted a Windows 2000 partition and also noticed that the applet was working 100% with the same version of Firefox and JRE. Could not try Chrome, not available on this platform.
Now I'm not necessarily asking for a solution as my 'client' will use Windows 2000 to run the applet. I was posting this to know if someone experimented with java crashes could find an explanation to this. Is it the communication between Firefox Linux and java that could make java exit? If you had to make this work, how would you proceed? Try to produce an SSCCE for Mozilla?
Versions:
Firefox 9.0.1 (both on Linux and Windows 2000)
Chromium 9.0.597.45 (70550) Built on Debian 6.0, running on Debian 6.0.2
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
EDIT: I found more information. When listening to Firefox's stderr, running the applet and then exiting Firefox after java exits, I get this. Not so useful though, it just tends to show that Firefox didn't even know that java exited.
Exception in thread "main" netscape.javascript.JSException: Plugin instance for applet ID 1 was already released
at sun.plugin2.main.server.LiveConnectSupport.getInfo(LiveConnectSupport.java:405)
at sun.plugin2.main.server.LiveConnectSupport.shutdown(LiveConnectSupport.java:41)
at sun.plugin2.main.server.JVMInstance.unregisterApplet(JVMInstance.java:1300)
at sun.plugin2.main.server.JVMInstance.recycleAppletID(JVMInstance.java:385)
at sun.plugin2.main.server.JVMManager.recycleAppletID(JVMManager.java:316)
at sun.plugin2.main.server.MozillaPlugin.stopApplet(MozillaPlugin.java:325)
at sun.plugin2.main.server.MozillaPlugin.destroy(MozillaPlugin.java:225)
Try to produce an SSCCE for Mozilla?
Yes. (I recommend that.)
You will need it for a bug report to either Oracle or Mozilla. Unless reported, problems do not get fixed.
Related
I'm having a very odd issue with Java exiting abruptly and randomly.
I have a Macbook with M1 system (2021 model), with 32GB RAM. I'm running a Windows 11 (ARM64 Insider Preview) VM with Parallels. I have 16GB of RAM allocated for the VM, and 6 cores. I have Liberica JDK 8 (full with JavaFX) installed both on the host and the VM. I'm developing a multi-module Maven project, same project on both the host side and the VM side (the project depends on some Windows side things for some tasks, which is the reason I'm running the Windows VM on the side).
Output from java -version:
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode)
I've also tried with Azul JDK and had the same issue with it.
On the host side everything works as it should. Maven and Java commands both run successfully with no interruption or issues. On the Windows VM side however, it seems that Java just randomly exits with no error logs or anything really. I noticed it just hangs for a few seconds, and then just exits abruptly. I noticed that it may happen while running a Maven command, or for example running a .jar package with java -jar. Here's a picture of what it looks like (same happens on the picture above though):
A couple weeks back I had no issues at all. But then I had to reinstall Parallels and the VM (reinstalled the whole W11 OS), and suddenly these issues started occurring. I've tried adding -XX:+HeapDumpOnOutOfMemoryError to MAVEN_OPTS environment variable to see if it's a OutOfMemoryError, but it did not seem to have any results.
Any ideas?
In case anyone runs into this issue: I was able to resolve this issue by installing the Windows 11 VM into Parallels from an image downloaded from UUP Dump.
I tried reinstalling the VM downloaded from the Microsoft's Insider Preview page, but the issue still persisted and nothing seemed to be able to fix it. Java still exited randomly pretty frequently.
I downloaded the latest Windows 11 image from UUP Dump and installed that one instead. Installed the exact same versions of Maven, Java, Groovy etc. and surprisingly, the issue vanished. I've been able to run Java on my VM for a day now without issues, whereas with the image downloaded from Microsoft I was able to reproduce the issue pretty much within minutes after configuring my environment and cloning the Git repo of the project I'm developing.
A lot improved for me after switching to ARM64 Java (Microsoft's was first one I found, there may be others).
Some background: not sure if I had exactly the same issue, but vscode compiling and code checking was slow and unreliable, and my Mendix Java application kept crashing or not even starting. Since that uses Java 11, that's what I installed the ARM64 version of. This is in Windows 11 ARM, from Microsoft's Preview page, updated (hang the first try, but worked the second).
I'm trying to use the java-language-server vscode extension, but I am getting an error that the extension is not starting up:
[Error - 11:07:14 AM] Starting client failed
Error: spawn UNKNOWN
at ChildProcess.spawn (internal/child_process.js:403:11)
at Object.spawn (child_process.js:570:9)
at c:\Users\tdalt\.vscode-insiders\extensions\georgewfraser.vscode-javac-0.2.39\node_modules\vscode-languageclient\lib\main.js:357:40
Looks like that line is trying to run this script: dist\lang_server_windows.sh. When I manually run that script, I get this error:
/mnt/c/Users/tdalt/.vscode-insiders/extensions/georgewfraser.vscode-javac-0.2.39/dist/launch_windows.sh: 13: /mnt/c/Users/tdalt/.vscode-insiders/extensions/georgewfraser.vscode-javac-0.2.39/dist/windows/bin/java: not found
which makes me think that something needs to run before that script runs.
Haven't looked much more into it than that. I have heard good things about this extension, but just haven't been able to get it working. Has anyone run into this issue before or is able to help me resolve it?
My java -version results in
openjdk version "11.0.9.1" 2020-11-04 LTS
OpenJDK Runtime Environment Zulu11.43+55-CA (build 11.0.9.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+55-CA (build 11.0.9.1+1-LTS, mixed mode)
Operating System: Windows 11 Home v22000.493
VS Code: VSCode-Insiders (Latest version)
As a side note, if anyone has a good vscode bazel setup for Java, I would love to hear any tips on setup.
I had the same problem. You're probably trying this as a Windows Standard User. This worked for me...Log out of your Standard User Windows session and log into Windows as an Admin user and then run 'VS Code' (make sure the Java extensions are present within this Admin instance of 'VS Code'). You should then be able to debug Java code avoiding the error (although the JDK will request access through Windows firewall if not already granted). Once granted, quit 'VS Code' and the Admin Windows session. Log back into Windows as Standard User, Right-click 'VS Code' and Run As Administrator and use your Admin account to run 'VS Code' It should function normally after that, just keep in mind that VS Code is running under your Windows Admin account.
Situation
The problem I have encountered is that there will be no sound output from running my *.jar file. I will start it with java -jar cgoban.jar and it works fine except there is no sound.
Possible Solutions
There is a workaround for this problem discussed here: https://senseis.xmp.net/?CgobanProblemsAndSolutions.
It says to employ the Java Web Start with
LIBXCB_ALLOW_SLOPPY_LOCK=true padsp javaws http://files.gokgs.com/javaBin/cgoban.jnlp
and use the jlnp file from here: http://files.gokgs.com/javaBin/cgoban.jnlp.
However, since this workaround includes downloading the jar-file on every start this is not an option for me (as I use an offline machine, bandwidth limitations etc.)
A possible solution might be to run (since it works with javaws)
LIBXCB_ALLOW_SLOPPY_LOCK=true padsp java -jar cgoban.jar
but there is still no sound. I don't understand why it works for javaws, but not for java -jar.
Unluckily it did not help to run
java -jar -Dsun.sound.useNewAudioEngine="false" cgoban.jar
But thanks for commenting.
Another possible solution that I attempted was to download and edit above jlnp-file. I don't want to download the jar-file every time the application starts. So maybe it is possible to download the jar-file once and then have the local jlnp-file point to the local copy (instead of the remote jar-file). However, as my programming skills suck, I have not been able to pull this off.
Additional Information
I'm running an Ubuntu machine with Java installed. java -version gives me the following output:
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
An up-to-date version of cgoban.jar for download is available from here:
http://files.gokgs.com/javaBin/cgoban.jar
Any applet I click on from the web prompts me to update Java, even though I had the most recent version. The prompt directed me to a download (on the real Java site, don't worry) so I installed it. I went back to the applet, and the prompt persisted.
I searched for help and found another forum post that said the prompt directs you to an outdated version of Java - it's a bug in the Applet manager. Okay, I downloaded the newest version of Java available on the website and had it uninstall all older versions on my computer. I looked at another applet, and the prompt was still there.
What am I doing wrong? Applets in general can't be broken - they must have tested it.
C:\...>java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
If I understand correctly, the applet version can be different than your regular version of Java. When I go to http://java.com/en/download/installed.jsp, I get the same prompt, but the filename is marked with (2), because I've downloaded it and installed it twice.
Update: I visited the same page again, and Java crashed, nearly taking out my browser in the process. It recovered and told me it needed to uninstall 8 update 5 so it could install 8 update 20, but it failed to uninstall (probably because it crashed Java.) Meanwhile, checking in Programs and Features, as well as the -version check I posted above, I can see that version 8 update 20 is installed.
I'll post the updates as I go - I'm uninstalling all Java from my machine in the hopes that one was interfering with the other somehow.
I'm running an application with ADF in JDeveloper 10.1.3.4.
When an Application Module is created, I get an exception with the error code mentioned in the title: "ORA-01866 the datetime class is invalid". It has absolutely nothing to do with code, I can assure you that. It only happens on my computer, there are other computers where this problem does not appear, same code and all. After the application module (BC4J) is created, everything works fine. It's very weird. To strengthen my point, in one part of the Application I create a new Thread (since I want to execute code in background in my web page), so I create a new application module, and here the exception appears again.
I'm running Windows XP with Service Pack 3. Java version is the one that comes with this version of JDeveloper. java.exe -version yields:
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
Thanks!
Have you tried the solution suggested in this thread on Oracle's forum:
In the system registry, go to HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Controls/TimeZoneInformation
Remove the DisableAutoDaylightTimeSet property, or set it to 0.