A Null Pointer
A Null Pointer

Reputation: 2277

How to convert an existing eclipse GWT project into a Dynamic Web Project?

I am using Eclipse Juno and I have a Java GWT project (SDK version 2.2). I tried setting the project facets to use Dynamic Web Module and also got rid of the GWT dependencies by going to the web toolkit settings and unchecking the selected options.

The project builds fine and bundles the output into a war file. But when I try to run the project on the Tomcat server from within Eclipse, it just doesn't seem to pick up any war file and deploy. What could be the problem here? Am I converting the GWT project to a dynamic web project the right way?

Upvotes: 2

Views: 3248

Answers (1)

Mayank Pandya
Mayank Pandya

Reputation: 1623

Try this way this may not really what you want but it may helps you, one of the best method that I follow many times. so through this you can debug also GWT module and server module both at a time.

It should probably a little bit easier, but it's possible. Here's how I do it:

  1. Setting up the dynamic web project

    File > New > Project... > Web/Dynamic Web Project

    Select the target runtime which is tomcat.

    Important: In Context Root, enter /

  2. Adding the GWT module

    Project > Properties > Google > Web Toolkit > Use Google Web Toolkit

    Important: I always need to change the order in the Java Build Path (Project > Properties > Java Build Path > Order and Export)

    Project > Properties > Google > Web Application: War directory = "WebContent",

    also check "Launch and deploy from this directory"

    Copy your GWT contents to newly created project

    run project as GWT application and also a dynamic web project.

  3. Now you can debug both the server and the client part (I still need to click two Debug icons to start both!) I can manage the client side from the "Development Mode" view, and the server side from the "Servers" view.

    At the end of the day, it works great, and using the "Automatically publish when resources change" feature (Servers view > myServerName > Open > Publishing), sometimes even better than with the integrated Jetty.

Upvotes: 3

Related Questions