Dependency on 3rd party at runtime? - java

We have created an applet with javafx and it seems that in order to load the applet several jar, jnlp and js files are required to be downloaded from dl.javafx.com. I tried to work out which files were needed so I could host them on our own server but after spending an hour or so on it I got tired of reading code and gave up. Doesn't it seem bizarre that to use javafx the client has a dependency on the javafx server? There was an instance a few months ago where their server was down which is completely unacceptable. I feel like scrapping it and starting again in something else but I can't throw a years work away.
What are everyone else's views? Have you experienced/solved this? Any suggestions where I should go from here will be gratefully accepted.

This issue has come up a few times and it is one of the main gripes people have with JavaFX. There is a dependency on the runtime, however I believe it is technically possible to distribute an app "offline" (though I've never tried it). See here and here.
I am not sure whether or not it is a breach of the license to distribute offline.
I have sympathy with your frustration, but I would argue that it would not be worth scrapping a year's work. I imagine the uptime of the Oracle servers would be no worse than any outage that could be expected of any web application.

Related

LWJGL GLFW hangs on native glfwInit call

I originally posted this question on GameDev stackexchange however I'll also ask the question here to try and get more outreach, especially since I wasn't sure my problem was specific to game development since it's a problem with a Java native call.
For the past months I've been working on creating my own game engine for personal use in LWJGL using pieces here and there, especially from developer ThinMatrix's rightfully credited code, to learn as much as I can while building it. Only recently there has been strange behavior happening when I launch the engine from IntelliJ for testing:
After about 6-10 individual times I click run, all subsequent runs suddenly take about 60 seconds for the window to appear.
Whenever I restart my PC this hanging resets and I have another 6-10 runs before it hangs everytime again.
I located the issue to glfwInit, more specifically at the call to the native method:
#NativeType("int")
public static boolean glfwInit() {
long __functionAddress = Functions.Init;
return invokeI(__functionAddress) != 0; // Right here
}
I also noticed that this issue only started when I attempted to implement text support in my engine using the STBTrueType library. It was perfectly fine before that. I tried removing the TrueType code but it didn't fix it.
Here's a list of things I've tried:
Clearing my temp folder in case a buggy or corrupted file was present.
Recompiling and rebuilding the entire LWJGL jars twice.
Building glfw.dll from the GLFW sources and replacing the glfw.dll in the native jars with the former.
Reinstalling Java and actually upgrading JDK versions (from 13.0.2 to 14.0.2)
Switching IDEs even if I suspected it wouldn't work.
Updating my NVIDIA drivers, and reinstalling them.
I'm quite confused as to what it could be, and I'd be more than happy to share code, thread dumps, or debug info if you deem it necessary. Here is the Github repository with the latest, "faulty" code (fault in quotes because I'm not too sure the code is the problem.)
Thank you very much for any guidance.
P.S: Please tell me if this is better asked in StackOverflow instead of here.
So I fixed the issue, it turns out it wasn't even related to anything to do with programming, or STBTrueType, or the library itself. The problem was as pointed out in this StackOverflow post, where this hanging behavior was due to a faulty driver or, in my case, my keyboard USB being plugged in the "wrong" USB port. I moved my computer at the same time I started working on text in my engine, hence why I wrongly linked the issue with the TrueType library. If you're having the same issue, look at the aforementioned post or if that doesn't work, look for a peripheral that might cause interference.

Wiki on a Stick - can it work on Chrome?

I've been using "Wiki on a Stick" for several years and have a few wikis that are full of info (and would be a pain to try to move onto something else). A year or two ago the editing features stopped working on all browsers aside from IE, apparently due to how those browsers handle Java or something.
However, I really hate using IE, so I was trying again to see if I could get it to work on Chrome. When I try it on Chrome, the error message reads: "The TiddlySaver Java applet was not available. Please check that the TiddlySaver.jar is in the same directory as this WoaS and that you have enabled Java permissions for it."
It IS in the same directory, so it sounds like all I need to do is "enable Java permissions for it"... but HOW do I do that?
Thanks.
I am afraid I have some bad news for you. Chrome (and practically all other non-legacy browsers) do no longer support the NPAPI, the technology behind Java "applets". So the applet will never run again. Especially not in Chrome.
The most recent activity in WoaS was more than five years ago, the board and mailing list died, so I doubt there will be an updated version anytime soon.
But I have learnt from the documentation, that the wiki's content is stored in a well-formated XHTML-File; so the parsing/extraction of your content shouldn't be that hard. But this is just from an outside perspective, I did not look into the product any further.
My advice would be to migrate you data as fast as possible, java applet technologie is a dead end.

Connection Reset using Java's FileUtils or BufferedInputStream

we are having problems downloading a file from a remote server. We have a very high chance of getting a connection reset exception, although the same code works fine with other files we download from different servers.
We already tried using BufferedInputStream, but had the same problem there. That's why we switched to FileUtils copyURLToFile() method in hope that this will be a bit more robust. But that didn't improve the problem.
It seems like browsers don't have a problem downloading the file (at least it worked every time we tried), we just have the problem in Java (or Lucee using Java to be precise). Lucee's (and Railo's before that) built in functions had the same problem, that's why we started using Java in the first place. So far with no success.
Are there any ways to make this download more robust?
We also have little to no influence on the server that hosts the file, so ideally we should fix the problem on our side.
Thanks a lot!

java 8u31 plugin causes signed applets to load much slower

i have noticed that signed applets are loaded much slower with the latest plugin (included in java 8u31 and 7u75). I have debugged the situation quite a lot and i found out that the problem is directly related to the size of the jar files that are referenced in the jnlp file. The problem is that each time the applet starts, there is some 're-indexing' of the cached jar files that takes time.
To reproduce the issue i did this:
I created a minimal applet and in the jnlp file i used to deploy it, I added several irrelevant .jar files (that are not even referenced, so the classloader does not load them) of considerable size (e.g. 30MB). Of course i am using versioning in the jnlp and capture all http traffic to make sure that the delays are not because of traffic (either re-downloading or certificate revocation checks, etc). I run the applet with the trace enabled and then went through the xml trace log file and found out where the delays come: they are always from the JarSigningVerifier ....
Has anyone else seen something like that?
It is very easy to see and reproduce this behavior and i wonder if there is something i am overlooking. Having worked on applets for the past years extensively, i am totally lost at what can be happening. I can verify that reverting to the previous version of the plugin (and every other version before) works as expected.
I have submitted a bug report with oracle, but i haven't heard back still. Any info or idea will help,
TIA
Same here. I thought already I'm getting crazy. Thanks for sharing this.
We are using Java Web Start, but it's sharing the same problem of re-indexing all jar files (in our case it's an app with quite some jars, so starting takes ages).
Aside from the fact that Oracle suddenly decided to check the certificate of the deploy TLS, which caused some hickup on Linux and Macs (we used a StartSSL certificate there, which isn't included in the Java keystore - on Windows it works as it uses the platforms root certs, too).
And, to make it even worse, on Windows x86 the 8u31 silently dies if -XX:+DoEscapeAnalysis or -XX:+OptimizeStringConcat is present in the JVM arguments, though both parameters are standard in Java 8 (but not in 7, that's why they've been included, still). The 64bit engine doesn't have that problem.
The next thing they changed is they now overwrite the start icons if they've been changed (we changed them to put the 64bit engine's path in there), so it stubbornly changes the path back to the 32bit engine every time.
The behaviour of Oracle is not helpful at all, as they didn't announce any of these changes in their changelogs, let alone announcing the certs changes a few days ahead.
I would like to hear from anyone who's sharing the problems and possible workarounds.
Patric
Have you been able to solve this issue? Have you had a reaction from Oracle?
UPDATE START
I've tried everything I can think of and haven't managed to solve the
issue, so I posted my own question on this issue.
A similar bug report can be found here and is backported to at
least Java 8u51 which I tested. Yet again they managed to increase
startup time for our application.
END UPDATE
We are using Java Web Start for an Eclipse RCP-based application with jars that are all signed.
Startup time is 8s within the IDE, Java version doesn't seem to matter here. With web start the story is different. It becomes (much) worse with every Java update:
7u?? (<60): +2s (10s)
7u60: +5s (13s)
7u75: +15s (23s)
8u31: +12s (20s)
8u40: +21s (29s)
8u51: +23s (31s)
Have you tried your jnlp without versioning? In my experience Java jnlp is very buggy specially if you change the jnlp default values. Versioning support is disabled by support, so try it without versioning and see if it still slow?
For me, I noticed some bugs when I used update="background" value, so I no longer change the default update method. My theory is that Oracle only tests jnlp against default values before they release new Java versions.

System requirements for Cometd/Bayeux Usage on Android

I'm trying to implement a Cometd/Bayeux server on Android using iJetty. The Jetty implementation itself works just fine serving static pages along with servlets. I am trying to up the ante a bit and create a Bayeux application on the phone but I'm having some trouble. I can hit the page that has the dojo cometd scripts on it, but I am unable to subscribe to the channel. When I view firebug/chome developer tools, I see a series of posts/gets that last a couple of milliseconds (~14). However, when I run a cometd application on a normal machine, the posts/gets last several seconds (~14 seconds) before timing out and reopening the connection. This second scenario makes sense to me with my understanding of how continuation in HTTP works. So I'm thinking that something is not allowing those connections to hang open and prematurely returning a value and consequently closing the connection. I would post my source but I'm not sure what to post short of posting everything...(it is open source though so if you want to have a look it's at http://webtext-android.googlecode.com).
So my question is, does anybody think that there could be some underlying limitation imposed by the Android system that is preventing these servlets from working? Are there assumptions that are made by the Jetty Bayeux implementation with regards to the underlying system? Or is it more likely that somehow I have a bad implementation of the ContinuationCometdServelt? I should note that all of the posts/gets from the client return 200 OK messages so I'm not inclined to think that the Android system is simply terminating the connection.
I know this is a bit off the wall and I'm definitely trying to do something a bit out of the ordinary but any suggestions or tips would be greatly appreciated.
In case anybody discovers this and has similar problems (this applies to all cometd implementations regardless of host), I discovered that the issue was with using the Google js library. For some reason, the dojo scripts I was loading from Google (1.4) didn't have a valid implementation of cometd. I switched my dojo script to the one that was used by the jetty-1.6.23 example and it works perfectly.

Categories