Difficulty to run simple GWT application - gwt

I am making gwt application as following step:
Firstly I install gwt plugin in my eclipse(Helios).
Create dynamic project.
Add gwt plugin through
going to property page of the project
Select google-webtoolkit
check "use GWT"
then go to google-web application
the directory name to "web-content".
Create gwt module in my project then create entry point class then html.
Create a button in onModule method of entry point class.
Then I run the application in tomcat server by just right clicking on project and selecting run as web application(run with tomcat server). As result of this I am getting a blank page on browser? There is no excption in server log. I am not able to debug. Where I am going wrong?
Please help me to sort out this problem.
I am not using google web application because I was getting difficulty to create war file. As a result of this I got the above process to develop GWT application.
Thanks
Rahul

why don't you try in reverse:
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 your code
and try to run on server. it will work.

Related

How to bootstrap UI5 resources without CDN in Eclipse?

I'm doing a walkthrough for SAPUI5.
The code src="/resources/sap-ui-core.js" doesn't work, because I can't find this directory in my project.
When using a CDN URL, it works fine. But I don't want to use CDN for my application.
So how can I get and import the sap-ui-core.js file into my project so that it is saved on my computer locally?
I'm working with Eclipse btw. and installed the SAPUI5 Tools for Eclipse.
The SAPUI5-Plugin for eclipse includes the SAPUI5 library files.
If you start the App using "Run as..."->"Web App Preview" on your index.html, eclipse starts a jetty http server which serves the SAPUI5 library at /resources.
As long as you don't close the preview window in eclipse you can use any browser to debug your application at the url you find in that preview window.
Check that the dependencies are correct in your project, because the general dependency file such as sap.m may be missing in the project file.

gwt - How can I use a 3rd party java library in my gwt project?

I create a Editor gwt project, which works fine.
Now I want to connect the editor's data to a db, so I use a 3rd party database helper tool for that.
I added the db tool jar into my gwt project, no complaint. I also wrote the db related codes using this tool.
But I just can't run my gwt project in the web page.
The error info in gwt console for my web browser is can't find the source/.xml for the db helper tool, at least something like that.
How can I manage this?
Thanks
You have to use the DB-Tool on the server-side of the code and retrieve the data to the client via an RPC!
See: https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC

Issue with deploying GWT app to tomcat in eclipse

Following this tutorial, I could execute GWT app using eclipse. I could access the app at http://127.0.0.1:8888/De_vogella_gwt_helloworld.html?gwt.codesvr=127.0.0.1:9997.
Then, I googled to find a way to deploy the app to tomcat, and I found this site. It has two step way to exporting GWT app to tomcat.
Exporting the src directory into jar file.
Using ant create a war file.
I copied the hello.war file into /Library/Tomcat/webapps, and open the browser with localhost:8080/hello to get this error.
When I click the HTML file in webapps directory, so I think something's wrong with the packaging.
What might be wrong?
You need to compile your GWT app to run in production mode. See this section of the GWT doc for detailed steps (for GWT 2.4).
From David's answer, I could get it working.
I had to compile the application again.
to get it working.

PlayN Maven Archetype and Running HTML5 in Eclipse

I generated a skeleton PlayN project from the playn-archetype and imported into Eclipse via m2e after verifying a successful build via
mvn clean package
After using the Google Plugin for Eclipse to successfully compile the html subproject, I then right click on the html subproject and perform a Run As -> Web Application.... Per the 'Getting Started' instructions on the PlayN wiki, I attempt to load the resulting Development Mode URL minus the ?gwt.codesvr=120.0.0.1:9997 suffix and am greeted with a dialog containing the following:
GWT module named 'project' may need to be (re)compiled.
I have verified that the <script> tag in my project.html is pointing to the appropriate javascript file (project/project.nocache.js), and I've verified that said javascript file exists and its contents browsed when navigating directly to it (i.e. http://127.0.0.1:8888/project/project.nocache.js).
The project works fine (albeit slowly) when the ?gwt.codesvr=120.0.0.1:9997 suffix is part of the URL (which is expected), and it also works fine when running mvn gae:run from the html subproject folder and browsing to http://127.0.0.1:8080/.
This is more of an annoyance than anything else, but I would at least like to know why it's happening and how to fix it :).
After you started the web application with "Run as... Web application" you need to recompile the project again (while the web application is running).
When you refresh your browser (be aware of the browser-cache) it should work.
This is a known issue is some older versions of PlayN.

Issue making a Liferay Hook with Eclipse Liferay IDE - getting only empty project

I am using Eclipse Liferay IDE for making a hook to a Liferay native portlet. I mean a porlet that comes with default installation, eg. blogs, content management or similar.
I have done the steps like following:
Select new Liferay Project
Enter project name MyHook
Made configurations (found an SDK directory and Liferay Server instance for Runtime)
Selected Plugin type to Hook
My only option after that was Finish and I ended up having a project with certain structure without any class or properties file inside.
My problem is that I could only get an empty project and don't know how to make the modifications to the files of Liferay because no Liferay originated package names can be found if I make a new class file and try to start typing com.Liferay. or org.Liferay. Because this is a Liferay Hook project, I suppose some Liferay originating tips should normally pop up for my selection, but I didn't see any.
What I am making wrong? What I am missing? Should I know the filenames by myself or is there a trick somewhere to tell the IDE to give me some help?
I use Liferay 6.0 and my IDE version is 6.0.5. At least in my eyes they should match together.
In the IDE you first create a "Liferay Hook Project". This is indeed an empty project. Then you create a Hook, select the Hook project to create it in. You can do the second step manually, but there's a wizard helping you to do this. This might be what you've been missing
I made the same steps again and it worked! Somehow at first time I managed to do a Java project although the project should be interpreted as a Liferay project.
Maybe the IDE is not 100% working always. Whoever knows.