java.nio.channels.OverlappingFileLockException occurring randomly when attempting to embed applet? - java

Has anyone ever seen this odd error when attempting to load an applet? I get this in jconsole, although the applet activity is pretty plain. I get this exception after
java.lang.NullPointerException
at sun.plugin.AppletViewer.loadJarFiles(Unknown Source)

It's a 1.6.13 issue. It was a JRE bug.

Related

Trying to run mods in minecraft launcher VoidsWrath and i get the error java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener

(I know close to nothing about coding, just an FYI :))
While trying to launch a modpack, I get the error java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener, which i think leads to java.lang.ClassNotFoundException: javax.servlet.ServletContextListener
Heres the code to show https://pastebin.ubuntu.com/p/4ZCWwgwqNv/
(Sorry for pastebin but i cant get proper code format to work
That seems to be the only error/problem I have, I have tried looking around the internet for how to fix this issue but have gotten nothing (it was all on coding websites like Eclipse, and im doing this on Minecraft) so I have come here now to ask. Thanks for any help.
All I had to do was remove the mod LittleMaidMob and it's associated files, now the game appears to at least launch.

Spontaneous NullPointerExceptions when firing Events

I'm currently making a JavaFX Level Editor in combination with the LWJGL library in order to implement OpenGL capabilities, and thus, using multi-threading.
My problem however, is that sometimes when I fire JavaFX events (when I press a button / key etc.) I get this spontaneous java.lang.NullPointerException. I can't seem to figure out the pattern of when exactly the error occurs, and for some strange reason the stacktrace won't provide me with where the exception occurred. All I know is that it occurs when I in some way interact with the JavaFX Application Thread.
When it does occur however, it does not only print it to the console once and then crash. What happens is that the application continuously prints out the the error message over and over again until I force-close the application. It seems like I can no longer fire some specific events when the error has occurred.
This is the spontaneous repeated error message that I get:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.scene.Scene$ScenePulseListener.synchronizeSceneNodes(Unknown Source)
at javafx.scene.Scene$ScenePulseListener.pulse(Unknown Source)
at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Unknown Source)
at com.sun.javafx.tk.Toolkit$$Lambda$153/452428720.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.Toolkit.runPulse(Unknown Source)
at com.sun.javafx.tk.Toolkit.firePulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$400(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$42/424424770.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$38/12064136.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I guess that it has something to do with "synchronizing nodes". Since I'm working with multithreading in order to run a render-loop with OpenGL this might have something to do with the case. I am also using Lambda Expression from Java8, and apparently as it says in the error log it has something to do with them too.
I am not expecting someone to give me an exact answer to what my problem is, and what I've done wrong, since I do not provide any code (because my project is too big and I do not know where the Exception occurs).
However, I have a few generic questions:
What does this error log mean?
What might cause this?
Why does it not provide me with any information of where the Exception occurred?
I managed to get the line numbers from the stacktrace by switching JRE in Eclipse from the JRE installation to the jar provided by the JDK. This allowed me to get line numbers from the compiled APIs, such at JavaFX itself.
This is the new error log:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.scene.Scene$ScenePulseListener.synchronizeSceneNodes(Scene.java:2289)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2419)
at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:314)
at com.sun.javafx.tk.Toolkit$$Lambda$153/478814140.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:313)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:340)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:525)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:505)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$400(QuantumToolkit.java:334)
at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$42/1940618951.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(WinApplication.java:101)
at com.sun.glass.ui.win.WinApplication$$Lambda$38/640174177.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
My error lies within the JavaFX classes and probably somewhere within my lambda expression, since the only place where it still says (Unknown Source) is where it also says "lambda". Maybe the stacktrace can't show line numbers in lambdas?
Anyway, this is the line of code that returns a NullPointerException:
if (node.getScene() == Scene.this)
This is within the JavaFX Scene class
Not an answer, only suggestion from troubleshooting a very similar problem - a Swing one.
To avoid any guessing, we should look at the source code - resolve the "unknown source" part.
The stacktrace you provided is lacking line numbers.
This is because, the standard JRE is compiled without any debug information.
Once, I believe at Sun times, one could download a separate distribution aimed at developers with all debugging symbols in place.
That allowed, besides having the exact line numbers, also to set up breakpoints inside the JDK's code.
We could start investigating issues right from there.
If there is no JRE with debug symbols, You can always try compiling your own!
I've once successfully compiled the "src.zip" file, which accompanied the JDK distribution. It wasn't self contained though! There were several parts missing, some Linux specific classes etc. The javac from JDK itself had problems with the file - it ran out of memory all the time. Fortunately, the Eclipse's javac compiler can deal with big codebase and partially compile classes.
Then, I ran my program with the resulting jar (the src.zip compiled with debug symbols) at the bootstrap classpath. Normally, you aren't allowed to modify anything inside "java." and "sun." packages. With bootstrap classpath, you can.
Now, back to Your certain problem: both JavaFX and OpenGL solve multithreading issues, by so called "thread confinement". That means, that everything is forcefully single-threaded. Probably, Your issues arises from the fact, that both javaFx and OpenGL has their separate threads! I'm betting, you did some interaction outside of the JavaFX's EDT. But, it's only a far fetched hypothesis. Try getting the source lines, we could go on from there.
At the time I needed the debug info, I was following the answer from here: debug jdk source can't watch variable what it is
But, all the work might not be needed! I just learned, You could attach the source files itself to the boot classpath, as specified here: https://stackoverflow.com/a/10498425
Update,
So, it seems the "node" reference is null (I doubt that "this" is null).
Next step would identifying the null node and find the exact time where it was added. I'd probably put some breakpoints (or printout statements) at all sensible "addNode" invocations - from your program.
From the source code (I quickly skimmed through http://grepcode.com/file/repo1.maven.org/maven2/net.java.openjfx.backport/openjfx-78-backport/1.8.0-ea-b96.1/javafx/scene/Scene.java#2263 ) it seems, the "null" reference comes from the "dirtyNodes" array".
My best bet normally would be, that you're indirectly calling invoking the addToDirtyNodes ( http://grepcode.com/file/repo1.maven.org/maven2/net.java.openjfx.backport/openjfx-78-backport/1.8.0-ea-b96.1/javafx/scene/Scene.java#503 ) from outside the proper Thread. To my surprise, there is a first line which checks if it's called from the proper one:
Toolkit.getToolkit().checkFxUserThread();
Do You happen to see the line "Not on FX application thread; currentThread = " in your program's output?
Let's just hope, it's not a bug in JavaFX itself.
Don't modify your GUI on a non-GUI thread.
As I don't see your code I'm not sure where exactly you do it, but I had the same issue and it turns out I had passed a GUI object to a class of mine that ran a method on a non-GUI thread that was updating a GUI object. So don't do that.
As said, we also had this problem. It seems to have been caused by updating the UI from within a javafx.concurrent.Service's Task's call() method, although the updates were performed from a lambda handed over to Platform.runLater().
So I moved the UI update code from there to the Service's On-Succeeded/Failed-Handlers where it should have been in the first place. That seems to have eliminated the issue for us.
There are two JDK Bug entries related to this:
https://bugs.openjdk.java.net/browse/JDK-8095034
https://bugs.openjdk.java.net/browse/JDK-8098064
Any JDK version before 8u20 may be affected by this problem.

Exception in VOCE sample C++ app

I've been playing around with the C++ api of Voce for speech recognition in one of my projects. So far, I've been able to compile the C++ version of one of the sample apps provided by Voce named recognitionTest (provided under the samples directory in voce-0.9.1).
However, when I try running recognitionTest.exe, I hit an IndexOutOfBoundsException (console output is provided below).
[Voce] Java virtual machine created
[Voce] Initializing recognizer. This may take some time...
[Voce] Initialization complete
This is a speech recognition test. Speak digits from 0-9 into the microphone. Speak 'quit' to quit.
Exception in thread "Recognition thread" java.lang.IndexOutOfBoundsException: Index: 110,Size: 109
at java.util.SubList.rangeCheck(Unknown Source)
at java.util.SubList.get(Unknown Source)
at edu.cmu.sphinx.decoder.scorer.ScoreableJob.getFirst(ThreadedAcousticScorer.java:516)
at edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer.scoreScoreables(ThreadedAcousticScorer.java:310)
at edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer.calculateScores(ThreadedAcousticScorer.java:276)
at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.scoreTokens(SimpleBreadthFirstSearchManager.java:337)
at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.recognize(SimpleBreadthFirstSearchManager.java:258)
at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.recognize(SimpleBreadthFirstSearchManager.java:226)
at edu.cmu.sphinx.decoder.Decoder.decode(Decoder.java:94)
at edu.cmu.sphinx.recognizer.Recognizer.recognize(Recognizer.java:116)
at edu.cmu.sphinx.recognizer.Recognizer.recognize(Recognizer.java:135)
at voce.SpeechRecognizer.run(SpeechRecognizer.java:129)
at java.lang.Thread.run(Unknown Source)
I'm using Windows 8 and 32-bit version of java 1.5.
Question: Has someone encountered a similar error before? The exception seems to be thrown by the underlying cmusphinx library. So, I'm unable to debug the issue.
Any help would be greatly appreciated!
Please let me know if any additional info would be helpful in figuring out the issue.
Thanks in advance!

null pointer exception when programming for android phone from processing IDE

i am relatively new to java programming and programming for android and have been experimenting with android bluetooth comms using the Ketai library for the processing IDE specifically for use with android and tried to run the example program bluetoothcursors.pde that comes with the library but i keep getting the "application has stopped unexpectedly" error and the console indicates a null pointer exception error. The actual output is below:
FATAL EXCEPTION: Animation Thread
java.lang.NullPointerException
at ketai.net.bluetooth.KBluetoothListener.<init>(KBluetoothListener.java:56)
at ketai.net.bluetooth.KetaiBluetooth.start(KetaiBluetooth.java:207)
at processing.test.bluetoothcursors.BluetoothCursors.setup(BluetoothCursors.java:80)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:1019)
However i cant seem to see where the null pointer exception is coming from. I assume the null pointer exception relates to a variable that has not been instantiated properly. I have tried a process of elimination to try and isolate the cause but i get the same error but with slightly different source. I have also posted this question on the processing forum but have not received a reply. I just assumed that since it was part of the examples for the library it would work so maybe the error is being created somewhere else. I have tried other library examples and theses all work fine so i dont think its my setup. I also have other bluetooth programs working on android from processing but these use pure java code and are harder to follow.
I have had a look at some of the similar questions which have been sort-of helpful but i am still stuck.
I have set the correct bluetooth etc permissions and am using android version 2.3.3 and processing version 2.0.
Any help with this is much appreciated.
Cheers.

Error whenever a java applet is loaded

For the past few months or so, I've been getting an error whenever I attempt to use a java applet.
I'm getting this error on every browser I use, and I get the error occasionally in linux, too.
The java applet loads for roughly 5 seconds or so, then it stops and I get two error messages, stating that an exception occurred (java.io.EOFException).
This seems to happen regardless of what website I'm using. Going to the website shows I'm running java 6 update 20, and I get no error. Googling the error turns up nothing useful - I'm not a java developer, so most of the results don't apply to me at all.
My question is this. What's causing this error, and what can I do to fix whatever issue is causing it?
Nevermind. I looked further, turns out I had to delete the trusted.certs file under ~/Application Data/Sun/Java/Deployment/Security (~/.java/deployment/security in linux). That solved the problem.

Categories