GWT's hosted mode not working - java

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.

Related

WebStart Launching attempts to find jar locally

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.

Tomcat on Mac OS Yosemite (for iteraplan)

for those who are familiar with the web application iteraplan, I really need help. I've been having trouble getting iteraplan to work on my Mac because some factors or requirements can't be fulfilled.
For this reason I needed to install Tomcat since it's a web application but I'm a newbie to it. Tomcat doesn't work even though I installed it properly, moved it to the right folder and made sure that Eclipse recognizes it as a server. When I'm trying to open anything on Tomcat on my localhost I can't open further pages of Tomcat because I always receive the same error:"The requested resource is not available" When I'm trying to run the web application iteraplan through my terminal, the localhost doesn't open either and I get the same error.
I already changed most of the server file (which seems necessary for getting the web application to work) but that doesn't help either. Is there anything I might gave forgotten? Maybe something I would have to launch or something?
I would be glad for any advice because I desperately need this to work for my thesis.
Thanks in advance.
Yash, have you made sure that your Tomcat installation is working properly? You should be able to access the manager app (usually under localhost:8080/manager/html) and see all running applications, regardless of whether you have iteraplan deployed on the server or not. Also, to run iteraplan, you need a database (details can be found in the iteraplan installation guide: http://www.iteraplan.de/wiki/display/iteraplan34/Installation+Guide). Finally, if you just want to run the application, without modifying the code, it would be simpler to download one of the bundles available in sourceforge (http://sourceforge.net/projects/iteraplan/files/iteraplan Community Edition/). They have a Tomcat server and a database included.

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

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

Google App Engine/GWT/Eclipse Plugin Newbie Question- how to autobuild client side resources?

I'm tinkering with the default GWT application generated by the Google Eclipse plugin when I click the Google "New Web Application Project" button in Eclipse 3.5. This will no doubt be familiar to many of you.. basically there is an h1 title stating "Web Application Starter Project," a text field, and a Send button.
What I've found is that whenever I make changes to the client side resources, e.g. change the text on the Send button to "Submit" in the .java file, Eclipse does not appear to autobuild these resources. In fact I have to rebuild the entire project in order for these changes to be reflected in my browser. I do have "build automatically" selected in eclipse.
I should state that this is my second GWT project, the first was almost entirely server side (restlet on GAE) and everything built automatically nicely.
When I first tried this new project with updated client resources, on refreshing my browser, the browser stated "you may need to (re)compile your project." I'm not sure if this is relevant but I thought I'd mention it all the same.
So what's going on? How do I get Eclipse/GWT to autobuild these client side resources? Cheers for any help you can offer! :-)
I just installed Eclipse + the GWT SDK/plugins. When I run the default project, install the browser plugin, it shows me a send button. When I change the text "Send" in the .java file to "Submit" and I refresh the browser, it shows me "Submit", in other words: the .java file has been recompiled to javascript, while the server was still running.
It prints the following info, fyi:
I am running Google App Engine Development/1.3.3.1.
It looks like you are using:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3
Furthermore, I use Eclipse 3.5 Galileo. So it looks to me that it pretty much does what you want by default. I also tested this in my Windows environment, works the same there.

Categories

Resources