Java JNLP download loop - java

We have a JNLP file that on some computers gets stuck in a download loop.
When the download it started the user is presented with an "Open" or "save" option and no matter which they choose it seems to start a new download and present them with the same 2 options.
It seems to only happen on Windows 10, though not always.
Java version is 8 update 161
The same thing appears to happen in Edge, Firefox, and Chrome.
Supposedly it was resolved one time by going into java configurations, and deleting temporary internet files, however I have not been able to replicate this issue.
Has anyone experienced this sort of thing? I tried searching around a bit online but nothing seems to match. This is the first time I've made an account to ask a question, please let me know if you think there is any other relevant data I should provide.

I figured this out. It seems users had associated the .jnlp file to "Open with" a browser, as a result any time they tried to open a .jnlp file they had downloaded the browser treated the file like a new download. We simply needed to re-associate the "open with" to point at the javaws.exe.
The piece that helped clarify this was realizing that the files were in the downloads folder, so they were downloading. They must have just chosen a poor association at some point.

Related

Publish updatable Java software through Wordpress

I have just written a Java program that I now need to publish. I want to make the software easily updatable, and I therefore need your advice. The program will be used by people with minimal technical knowledge, hence usability is absolute key. The program is not open source.
The situation is this:
First time users download a zip-file containing one .jar-file and two folders that should contain the program output files (.xml-files and .png-files). I want to make it as easy as possible for the user to update the .jar (replace it with another .jar, not necessarily at run time). To my help I have a simple web-based Wordpress site that the user will view as the source of the program.
I'll list the possible solutions I've come up with:
1 (fallback solution). The user have to manually go to the Wordpress site where I'll put a separate direct download link (from Google Drive) for the .jar-file. The user then has to manually replace the .jar in the existing folder with the new one.The drawback to this is that it requires too much work from the user, and they program probably won't get updated very often.
2. Alongside the Program.jar in the zip-file the first user downloads, I place another Program-Updater.jar. This new .jar's sole purpose is to, when the user opens it, download a new version of Program.jar from the web and replace the existing one.This is better than the previous option because it requires less work, even though it's not automatic. The drawback is that I need one more .jar which can confuse the user, and most importantly I have no way of updating the Program-Updater.jar.
3. Java Web Start.I've tried reading up on how this works, but I'm wondering if there is a way to get it to work. One possible problem is that I can't really access the host, and to be able to set up the .jnlp the correct way I think you need this. I'm also wondering how the program's file structure would be (is the .jar even placed on the user's computer?) and if this could confuse the user. Also how to make it always work offline.
4. Suggest your own solution!
Any input on this matter would be greatly appreciated, and I'll gladly give more info than I already have.
Cheers
Getdown was the way to go; it is extremely easy to use.
I'll put the .zip on Google Drive with a direct download link to it on my Wordpress site.
The files used by getdown are placed in and downloaded from my public git repo.

Self updating game in java

I'm making a game, in Java, that has these following important features:
1) Connects to a remote Server (which i made), and will check for updates and install them if necessary
2) is NOT A SINGLE .JAR FILE (ie. has multiple .jar's and other things, such as .png, .wav, etc)
3) JAVA WEB START IS NOT AN OPTION, AS I WANT TO MAKE THIS ALL MYSELF
keeping the things above in mind, i have run into a problem. i have no clue how to implement a multiple "patch" update system. currently i have 1 .txt file, that the server reads from, and sends the files listed in the .txt to the client, which then moves them into place. The problem is, that is only useful for maybe 2 updates. I'm looking for a more useful, long term solution, and i need some help. here are some of the things i've thought of:
1) have a zip folder named after each version (problem: how would the client get ALL of the most updated files
2) have a .txt file INSIDE of each jar containing the version (problem: cant do that with png's or wav's, and i dont know how i would read the txt file to begin with)
i really need some help, i've tried googling it, i've thought about it for going on 3 weeks now, and cannot think of anything.
QUESTION: how would i make a game/program update with multiple patches?
Firstly, the best solution by a long, long way is to use Webstart / JNLP.
But if you insist on not using it (for whatever reason then) then it is technically possible. However:
It is messy and complicated.
It will either be very inefficient ('cos you have to load the entire program each time the user), or the user has to trust you enough to install your program with permissions that will allow it to install random stuff on his machine without notice.
The way to do it is to split the game into a launcher part and an application part. The launcher needs permissions to write and delete (non-temporary) files, and fetch stuff from the internet. It "calls home" to find out the latest version(s) of the application files, and then downloads and installs them. It has to cope with all sorts of error conditions, and it needs to make sure that nothing can trick it into installing bad stuff on the user's machine, etcetera, is someone spoofs your update service.
Of course, JNLP takes care of all of this, and lots more besides. People are going to be more willing to install the JNLP infrastructure that yours ... which might be insecure, or actively nasty (for all they know). (I for one wouldn't install a self updating application on my machine unless it was supplied by a company with impeccable credentials.)
I think you need here JNLP framework.
JNLP provides followed things:
allows to user to download jars from server
on launch verifies if application need to update
runs on local JVM
Actually, every java application you can convert to JNLP. Just to sign on all jars that your game contains, create executable jar from your game and create single Web page from where you can download your game

Java Applet: Edit and upload changed documents

In a work-related project, we want users to be able to write a document (in say Word) then upload this to our central web server. When they want to make changes, they visit the website and downloads the document. When changes are registered, the document is uploaded automatically.
I have written a few Java classes that does the work for me (FTP upload/download, File monitoring etc), but I'd like some input on how to solve the practical part of it.
Should the web page include a Java Applet that contains a Download button? When clicked, the document is downloaded and the associated editor is opened.
If so, how should I proceed? If the user closes his browser, wont be applet be terminated as well?
I have never worked on a such project before, and since Stackoverflow is filled with incredible smart people, maybe some of you could come up with some ideas?
PS: I'm new to posting on Stack, so please let me know if I should be more specific / add more information etc. :)
Best regards!
EDIT:
The application is only going to be used internally in our offices. Sorry if I caused confusion. :)

Trying to find the cause of a Java exception, where are the files?

I have no particular Java knowledge whatsoever. We are running an opensource application which is mainly written in Java. Internet connection dropped while I was editing a job (this is some sort of a translation project management tool) and I cannot open the job anymore.
I checked the database to see if anything is wrong there and all looks fine (I compared values to a working job). Then I logged in to the server and checked logs and seems like this application may be relying on some data which is stored somewhere other than the database.
The log contains tons of lines but I guess this is the one that provides the hint:
ERROR;com.globalsight.everest.workflow.WorkflowProcessAdapter;There is error in create the workflowinstance for the process instance id 54
java.lang.IllegalArgumentException: the userrole value cannot be null
Looks like userrole got messed up while the connection dropped. Now that userrole is not assigned anywhere in the database. I thought I will browse the source files to see where it may be coming from but I am not able to find those. For instance, an exception line says :
com.globalsight.everest.taskmanager.TaskManagerLocal.acceptTask(TaskManagerLocal.java:165)
I browse to that localization and there is a TaskManagerLocal folder there but it is empty. I assume this is compiled in the jar file (right?). Can somebody with Java knowledge shed a light as to how I can dig and find where userrole may be saved and bring by application back up?
Many thanks in advance
com.globalsight... -> globalsight.com
The website states that the sources are on SourceForge
If the project is open source, the code may be packaged inside the JAR file. This is not always the case, as the actual code that is run from the JAR is in compiled bytecode form.
You could try unzipping the JAR using:
jar -xvf the_jar_file.jar
This will create a number of directories/files which may include a src directory. If not, the source is probably not included in the JAR in its un-compiled form, in which case you'd have to download the source from the project site.
Since this error is specifically related to that tool, I'd go to the GlobalSite at http://globalsight.com and ask there. I did a quick search of the site for this error and didn't find anything but you should be able to get some answers (I would think) after posting this on their forum.

How to avoid no main class and no class def found error using DropBox and Eclipse for Java

I use Eclipse to write Java code and use DropBox to sync my code with others' across our multiple computers. Most of the time, everything works as expected: if anyone makes a change on either end, the change is saved and when the other person refreshes the Eclipse workspace, the changes come through and can be viewed and run successfully.
Sometimes, one of several errors arises. Sometimes Eclipse says it cannot find a main class and sometimes it says it could not find the class itself. Sometimes it will not report an error but for some reason will not actually update the .class file and therefore run an old version even though the compiler displays the new source code and that saves. I've then noticed that if I manually copy the code into a new .java file elsewhere in the file system and then compile it, it works fine, but for some reason it refuses to regenerate the .class file and I have to delete it manually and replace it with the one generated in the other project--then it works. But for solving the other problems everything needs to be manually copied, deleted, and re-pasted....
[The actual errors include NoClassDefFoundError, UnsupportedClassVersionError, and some other error related to not having a main class.]
I realize that the description here is somewhat vague, but unfortunately I'm not entirely sure what's going on. I hope I'm just missing some basic fact that would help solve all these problems.
Thanks!
I'm sure you will see issues using Dropbox for sharing your source.
Eclipse does not know what Dropbox is doing whilst it's uploading and downloading updates and their activities will certainly not be synchronised. At arbitrary points in time when Eclipse tries to do builds etc. it will find unexpected activity going on, maybe even partially downloaded source files which might explain the specific errors you are seeing.
You're trying to do something more complex than sharing photos or documents. The advice I would give is to use a source control system like git or subversion for source code sharing and control. You can then make use of plugins for Eclipse that are designed to integrate these systems in an easy to use way. There's a learning curve there, but the skills will serve you well.
You can use online versions of these solutions like github and unfuddle if you want to consume sharing, backup and version control of source as a service like you do with Dropbox. They're free, too.
Subversion, Git and all version control software solve all of these problems for you.
Dropbox is not really an adapted system for sharing code. What you should do is set up a SVN, and commit only the source files. This way, you won't have these kind of errors.
Dropbox does have versioning (you can restore old versions of a file), and doesn't seem to be a horrible solution for the problem. I keep my Eclipse repository on Dropbox so it is available on any computer; but since I only use it myself, I haven't encountered your problems.
There is one case I can absolutely see you running into problems--it's if your class files are stored in the dropbox as well. This would just screw everything up. Make sure you specify a location on your local hard-drive for all build artifacts (classes, jars, ...) and that the only thing on your dropbox is the .java sources.
In fact, I suggest you don't keep your eclipse project in your dropbox, just create your eclipse project and point it to the java files in your dropbox.
If this doesn't work for you, go with what other people here said and set up a SVN repository somewhere, it's easier than you would think.
Oh, another possible problem--dates! You may want to make sure the date on your java files isn't jumping forwards and backwards (as might happen if one of your developers were in another time zone). In this case, Eclipse may prefer not to re-compile your file.
Also, instead of the copy/etc procedure you are currently going through, try forcing a project clean.
Response to request for more info:
When you start Eclipse, select/create a workspace that is NOT on your dropbox. The best place is probably off your home directory. If you have already specified a default workspace, there should be a switch workspace item in the file menu.
Create your project. select "Create project from existing source" and specify the source files in your dropbox. I think you want "create separate folders for source and class files" to keep your class files out of your dropbox. If you see anything saying "Copy files into your workspace, say "no".
This should give you a valid, working project. I hope you don't see those problems any more.
One more thing may help--and this may work on your existing project--without the above procedure...
Whenever you refresh your files (f5) to load in changes from the dropbox, select the Project/clean menu and select the project. This should delete all the class files and rebuild them.
If your classfiles are shared on the dropbox, this could still have strange consequences on other people with eclipse open, so I really do suggest rebuilding your workspace as I said above.
How to avoid no main class
Provide one. That issue has nothing to do with DropBox

Categories

Resources