Error compiling Web app using GWT in eclipse - eclipse

I am following a tutorial to make a very simple demo app using GWT with eclipse ee.
I created a Web Application using steps: select File > New > Web Application Project. From the Eclipse menu, accepted defaults, unchecked use Google App Engine SDK & Generate GWT project sample code. Run it by Debug As > Web Application. It raises this error:
Missing required argument 'module[s]'
Google Web Toolkit 2.2.0
..................................................................................................................................................................
and
module[s] Specifies the name(s) of the module(s) to host

If you don't want to generate sample code, you have to create the gwt xml module (MyProject.gwt.xml), because eclipse doesn't generate this automatically.

Related

I get "Can't find any GWT Modules on this page"

I am trying to set up my eclipse with gwt and after I installed Jdk 8 and eclipse 2019-06 and gwt eclipse plugin 3.0 I created the sample project with code generated and when I try to run the sample code in GWT Development mode it gives me url http://localhost:9876 and when I open it I get "Can't find any GWT Modules on this page" Can you please help why It is giving me Can't find any GWT Modules on this page. I am assuming if I am running it in development mode I don't need to set up web server so I didn't. I didn't used gwt for long time and I am lost why it is giving me this can't find gwt module message when I load the page. Can you please help?
You still need a server, if you want to run any java code on your server. Such as code for talking to your database.
Gwt only does 2 things:
1: is is handling the client side, where it generate javascript from your java code.
2: It includes a .jar file, which can be used together with a java servlet server such as apache tomcat to serialize java objects which can then be send between the client and the server. And this .jar file will serialize all needed objects. And gwt will generate the needed javascript code.
Gwt does not itself include any http server. The address http://localhost:9876 is only used to configure gwt. It is just a page with 2 buttons to turn dev mode on/off.
The eclipse plugin does include a embeded webserver which can be used for gwt development. I have newer done this and I think that installing an independent java tomcat server is the best solution.
But if you want to use the eclipse embeded webserver you need the "Run in development mode with Jetty." - Jetty is the name of the embeded java servlet server.
Are you using the plugin from Google ?
If so, this is outdated. I advice you to use the plugin from branflake. You can find this plugin on GitHub : https://github.com/gwt-plugins/gwt-eclipse-plugin
Also on that GitHub page a lot of documentation is available. Like a link to a very helpfull YouTube playlist: https://www.youtube.com/watch?v=DU7ZQVLR5Zo&list=PLBbgqtDgdc_TqzA-qXrjgTFMC_6DKAQyT
My advice is to watch these YouTube videos to get you started. If you follow them all should be working without a problem.
I haven't used this plugin for a while since I switched to IntelliJ. But I did use it in GWT2.8.2 so it should still work fine.

Couldn't run in dev mode GWT

I have a GWT project and I can run it via hosted mode of build.xml.
But in case I don't have it(projects that I created by eclipse plugin) I run it by running com.google.gwt.dev.DevMode.class file but it says :
Plugin failed to connect to Development Mode server at 127.0.0.1:9997
why? :(
Well if you have the Eclipse plugin, you can use it to run your project as a GWT app. Right click on your project or module.gwt.xml file > Run as > GWT Application. If you have multiple modules, it will let you pick a module, and it might ask you to pick the hosted html file.
Doing that will use the Devmode class to run your app.

Difficulty to run simple GWT application on tomcat server

I am creating a gwt application as following steps:
First install gwt plugin in my eclipse(Helios).
Create GWT project
Add Dynamic web plugin
going to property page of the project
project Facets tab
Select Dynamic Web Module and java
ok to apply changes.
Write code
and i try to run on server tomcat7 then it shows resources not available.But when i run as internal server of gwt as just right clicking on project and selecting run as web application.
then it run successfully. so please help to run my application on tomcat server.
Thanks
Rahul
Did you Compile your Application? (GWT Compile Project)
You can then run this Ant buildfile and deploy the WAR file on your Tomcat Server.

GWT issues when using RPC

I have spend more than one day trying to create a very simple hello world application in GWT but I am not being successful. I am trying to get a hello string from the server through RPC and display it on the client.
Thanks
Download a fresh copy of Eclipse Helios for java EE
Install the appropriate GWT Eclipse plugin
Start Eclipse, go to File->New Project, search for Google/Web Application Project
Project properties, Run As... Web Application
At this point you should have a fully functional GWT application.

GWT in eclipse javax.jws.WebMethod is not supported by Google App Engine's Java runtime environment

I created a GWT application in eclipse using the GWT eclipse plugin. By default it created GreetingServiceAsync.java and GreetingService.java in client package. GreetingServiceImpl.java in server package.
Now I want to call a CXF webservice from GreetingServiceImpl.java. I used wsdl2java to generate java classes for my wsdl. I imported these generated class in my GWT project in eclipse and the package is "service". But it complains "javax.jws.WebMethod is not supported by Google App Engine's Java runtime environment", many more errors.
How do I get rid of this?
Only error is the problem otherwise application is running fine.
Is javax.jws.WebMethod in the GAE whitelist? If you're sure that this class is really supported in the App Engine, then in Eclipse try:
Right click your project in the Project Explorer.
Google -> App Engine Settings
Make sure Use Google App Engine is checked
Try changing the App Engine SDK to the latest rev, if the dialog shows multiple ones
I had this problem after doing Software Update; a new GAE SDK was installed and for some reason it confused the plugin. It was telling me that java.lang.String was unsupported. :-)