WebStart Launching attempts to find jar locally - java

To start off, I am launching a jar over Java webstart and it has worked fine on all browsers in my lab. An issue arises where, at a customer site with all their various IT restrictions, it only seems to work on Chrome but fails on IE and Safari browsers.
I launch the jnlp via an html file through the browser. The link I used was:
<script src="https://www.java.com/js/deployJava.js"></script>
Launch ApplicationApplication</a>
I attempted to change this to:
<script src="https://www.java.com/js/deployJava.js"></script>
Launch Application
Reason being is my company has another webstart app that works in all browsers at this customer's site and their link looks more like the replacement.
So what I'm seeing with the replacement is that the JNLP is not being launched from the browser but instead being downloaded locally. When launched it attempts to find the jar relative to where it was downloaded. Not sure what I'm missing and why it is trying to download instead of launch via webstart?
Any ideas? Thank you!

I have been fighting with this a lot in the past. So couple of rules in general needs to be followed in order to go smoothly.
make sure your URL where jnlp sits is not cached, maybe you need to develop some Pragma No Cache, etc. things on the server so it doesn't treat it as static resource
clear cache of JNLP, see https://www.java.com/en/download/help/plugin_cache.xml
Check the shortcut icon on Desktop(assuming OS is windows), sometimes it creates crappy shortcuts, you can edit the shortcut and put always your URL, not the cached one
if that doesn't help you need to upgrade or downgrade java, depending on the case
In the past I even made special script which was downloaded and executed on client machine to fix the shortcuts .lnk files because of this buggy java functionality.

Related

Cannot get Java Applets to work in any browser

We are trying to download something from GE that uses Java to download when logging into the site. This is a windows 7 Professional PC. I have other computers that are able to do this successfully. Here is my order of operations:
Log into the site and select the file I want to download
Click download
It takes me to the page that says it will start in a few seconds but nothing happens. It is supposed to have a box that asks for Java to run.
I have reinstalled Java fresh and still nothing. Tried with multiple user accounts. Added the site to the list of exceptions in the firewalls and Java configuration. I have tried an earlier version of Java. This happens in Mozilla, Chrome and IE. I have made sure that the Java plugin shows up and is enabled. I just cant think of what I am missing. And since we are a contractor GE is not going to help us. Can anyone here think of anything?
Are you sure you have the Java plugin enabled? e.g. in Firefox, go to Settings, Plugins, and change Java Platform SE8 'Next Generation Java Plugin' to 'always activate'?
This sounds similar to the issues I had with Cisco WebVPN, Java-style. Once you have Java installed correctly and set as a plugin for any of the browsers you would like to use, see below.
Before you even start looking at browsers - if you think it is already set up correctly
Look at your Anti-Virus programs or anything else that could prevent it from working. McAfee Host Intrusion Protection is known to cause many Java programs to fail. Kapersky had issues, a while back, with Java on Windows (Java Applets not loading in Windows 8 ).
You must have a 64-bit browser to use 64-bit Java (also mentioned in the Chrome link below).
See below for any specific things that can be modified in the browser.
Chrome 43 is the more complicated browser to set up. They have a dedicated page with instructions.
How do I use Java with the Google Chrome browser?
Firefox 38 will prompt you.
In Internet Explorer 11, it's under Internet Options->Security. I recommend adding the hostname the applet is on as a Trusted Site (Select Trusted Sites and click the Sites button, then add the first part of the url). Click the Custom level button and make sure that Scripting of Java applets is not disabled.
If you still have problems with the applet:
Verify your Java version will work with the applet you are accessing
Verify the plugin is enabled for the browser through the Java Control Panel, which is available in Windows Control Panel, or on Mac/Linux, execute it from the JDK directory ($JAVA_HOME/ControlPanel ).
I ended up fixing the issue. I had to allow their UK site on the list for Java and enable the SSL 2.0 for HTTP in Java config as well

Oracle plans for java plugin on chrome [duplicate]

I use Java applets in my application, today I surprisingly saw the redirect from my page and the next message from java
In details I've read about Chrome dropping 'NPAPI' support
Recently, Google has revised their plans and now state that they plan
to completely remove NPAPI by late 2015. As it is unclear if these
dates will be further extended or not, we strongly recommend Java
users consider alternatives to Chrome as soon as possible. Instead, we
recommend Firefox, Internet Explorer and Safari as longer-term
options. As of April 2015, starting with Chrome Version 42, Google has
added an additional step to configuring NPAPI based plugins like Java
to run — see the section Enabling NPAPI in Chrome Version 42 and later
below.
So will it be handled by Java somehow or it is the death of my applet in the next year ?
As of Chrome Version 42, an additional configuration step is required to continue using NPAPI plugins.
In your URL bar, enter:
chrome://flags/#enable-npapi
Click the Enable link for the Enable NPAPI configuration option.
Click the Relaunch button that now appears at the bottom of the configuration page.
So will it be handled by Java somehow ..
If they found a way, that would be a bug in Chrome (that would quickly be fixed).
..or it is the death of my applet in the next year ?
Yep. Not that they were really that 'healthy' for a long time now.
Java applets are not dead. There are a lot of intranet web applications that use them, for instance, for digital signature with applet-javascript-web page interaction. Other option is migration to Firefox.
I saw a demonstration that A Plugin written in Pepper API (PPAPI) can launch an executable and communicate with it. Oracle says at here " This change does not affect Web Start applications, it only impacts applets." But the problem is that browser downloads jnlp file but doesn't launch it. User has to click that jnlp file (of course .jnlp file association should be OK).
I think Oracle write a plugin to launch Web Start application and communicate with it for sending cookie etc. If It is written Applets can convert to Web Start applications with less effort.

Necessary and sufficient conditions to run Java applets and JWS applications in browser?

I have already asked this and was heavily downvoted. Unfortunately, I still can't solve it. I don't know what I do, but sooner or later I loose an ability to run java applets and java web start applications in all browsers.
Here is an example what is happening.
I am opening page with applets http://csis.pace.edu/~bergin/Java/applets.htm and getting the following picture:
with signs plugins were blocked. I am trying to unblock
which causes another dialog
after OK I have another
next
if clicked
And so on.
Applet doesn't run.
After dancing with PATHes, Java updates and so one, once I can have applet run. But sooner or later I will stuck in this position again.
I would like to know, is it possible to exclude this situation in principle?
I mean I don't want to disable security at all, but I mean that in case my explicit permission everything should run. Is it possible to do that?
UPDATE
First of all, I don't understand, why can't I run applet on outdated java if I want?
I am a human and robots should obey me! :)
Suppose I wish to debug my applet on old version of java, why not?
Second, there is no information about what version it thinks I have and what version it wants?
Without this information it is possible that there is just a bug in version detection mechanism.
I have multiple versions of Java in Program Files since I am a Java developer. Then how can I know which one it uses?
UPDATE 2
I have updated my Java from 1.8.0_20 to 1.8.0_25 and now situation have changed, but applets are sill impossible to run.
The proof I have "latest" java:
The proof I have added the site above to exclusions list:
The effect of applet run:
(applet not runs)
Clicking details result:
(no any details in fact)
So, what to do?
UPDATE 3
This site is not working: http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=2012VP113;orb=1;cov=0;log=0;cad=0#orb
(show orbit diagram)
Reloading/restarting browser does not help.
I looked at your html source and realized you're using the .class file directly instead of wrapping it in a jar file. This is what you have:
<applet code="GSort.class" width=700 height=400>
I think applets no longer work when using .class files directly due to new security requirements. They have to be wrapped in jar files because you need to add some security settings to the meta-inf folder of the jar file. Here is how oracle recommends deploying an applet:
https://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html
Edit:
I tried again with adding the site url to the Java security exception list and this time I got it to work! It looks like chrome stays in memory after exiting so changing Java security doesn't affect it unless you shut down chrome completely and restart it. Easiest way is to use Internet Explorer. Try it with Internet Explorer and it should work (assuming that you still have the site added under java security exception list).

How can IE lose contact with its Java plugin?

I have a number of users who complain of a problem with an applet what I wrote. Mostly it works fine then one day it stops working. Checking the settings shows that no Java plugin is available. Once the plugin is reenabled and the browser restarted then the applet works again. I have also observed that the settings show that no plugin is enabled but following a browser restart the plugin is reenabled (without intervention of any kind) and the applet works.
Anyone have ideas how the plugin might get disabled? This has also happened to me so I can be fairly sure that the users aren't fiddling with their settings.
The installations are a mix of IE7/8 and Java 1.5/1.6.
UPDATE
I'm not 100% sure about this but it seems to me that the problem occurs when another applet is running. Many users have IBM HOD and I'm wondering if there could be some kind of clash

GWT's hosted mode not working

I've been stumped for a while trying to figure out why my GWT demo app isn't working in hosted mode so I went back and downloaded the Google Web Toolkit again, unzipped it and simply went to the samples directory and ran "ant hosted". The hosted browser launches and only shows the static html content but none of the dynamically generated js widgets, etc. However when I click "Compile/Browse" the examples launch correctly in Firefox. What could be wrong with my setup/environment?
I followed the link you provided to download gwt. Extracted and ran "ant hosted" under samples/Hello, samples/DynaTable, and samples/Showcase and they all worked successfully. I'm also running Windows XP and java 1.6.0_11.
I think that running "ant hosted" starts an embedded Jetty server that listens on port 8888. Hosted Mode Browser makes requests to that embedded server, for example: http://localhost:8888/Showcase.html.
Also, when you click "Compile/Browse", it opens your default Browser (in my case it's firefox) and it tries to make a request to the same embedded jetty server that the hosted mode browser uses.
So, if it works in your browser, then the browser is connecting to the embedded jetty server. It's very strange that hosted mode doesn't work properly but you're able to view in a browser.
I believe the difference here is that hosted mode runs pure java (some sort of javascript emulator, I'm not sure I understand 100%), while the browser is running javascript.
So, I suggest troubleshooting the jvm that is started when "ant hosted" is run. Maybe the jvm is running out of memory or something when you load it up in hosted mode browser? Maybe you can pass some jvm args to the ant script to fix the problem?
Sorry I can't be more specific, that's a strange one!
#Chris: I suspect this question may have something to do with your earlier question if it is on the same computer that you were using. The solution may be to clear your IE cache because it tends to cache the 'script' tag contents and when it got messed up earlier while you were importing other stuff, it may still be sitting around in IE. Found the potential answer at this link.
I created a new workspace, re-imported everything and used GWT 1.6.x instead (because Ext GWT 2.X, which I need for this project requires GWT 1.6.x). This did the trick... everything works ok now.
The main difference I can think of is that in the Compile/Browser you are opening the html host page like a regular file, while in the hosted mode (even in a client sample) it has to be provided by the http server via localhost:8080. Check if the server is beeing started.

Categories

Resources