A number of people have asked me how I configured GWT and OSGi. Some detailed steps are available here, however, following wiki pages is not always the easiest thing. I have created a small "hello, world" example. You can get the projects here.
To use this, simply import the zip file into eclipse: (File->Import, select Existing Projects into Workspace).
Once it is imported, you should have 3 projects in your eclipse workspace:
The GWT project is simply the GWT jars wrapped in a bundle.
The client project is the client side code, and the server project is the servlet we use (it simply returns the word "World" to complete Hello, World.)
I have included an external tool to compile the client side code. Make sure you select com.example.gwtclient ant_build.xml in the external tools list.
After this runs, you should refresh your workspace (press F5). Under the com.example.gwtclient you should have www directory.
Finally, you can use the provided launch configuration to actually launch OSGi, the Jetty engine and the servlets. To do this, go to Run Configurations..., and select GWT Example Launch.
This will launch the Jetty server on port 80. If you want to change this, go to the Arguments tab and set -Dorg.osgi.service.http.port=8080 in the VM arguments.
Once running, simply hit: http://localhost/index.html
If anyone is interested, we could extend this and make it part of the Eclipse Examples project. However, there may be some licensing issues as it currently includes the GWT jars.
24 comments:
Ian,
It's always extremely useful to have a working example as a basis for starting out. The jars have Apache License, so that should be fine.
Very cool! Thanks.
Ed, to do this would I have to propose a GWT bundle for Orbit?
Unfortunately the link containing the project zip doesn't work!
would youlz send the zip file to this adress : (anouar.khemili@gmail.com)
thank you!
Could one truly have plugins this way that work on the client-side too? The main problem I see is that a plugin could not hand a class to the framework, because in client-side GWT, new instances can only be created directly from class literals (i.e., statically).
Great!! The link is working now.
Tkanks
ian,
I get a ClassCastException from SimpleServiceImpl when the server is called, what could be the reason?
PD: I quit "Require-Bundle: javax.servlet" from com.google.gwt MANIFEST to avoid nasty classloader, since gwt-user.jar contains the package.
hi ian
the file is down again
please try to upload it
i know that i'm too late but really your try the only success story i found tell now :)
The link containing the project zip doesn't work.
Would youl send the zip file to my e-mail (bruno.evert@hotmail.com)?
Thanks!
ian,
could you send it to me too
shady.shif@gmail.com
thanks.
Hi Ian,
Would you please update the link to the source?
Thank you very much!
Hi everyone,
I will track down the download and re-post it. Thanks for letting me know that the link is down.
hi Ian it still doesn't work!!
please man try to upload it ASAP i need it so much.
thanks a lot my friend.
Hello!
The link doesn't work again... can you fix it or send me? thnx..
can please repost sample
Unfortunately the link containing the project zip doesn't work! Would you plz send the zip file to this address : (ehsan2@gmx.de)
thank you!
Could you update the zip file link?
Thanks,
Diego
Thanks for the writing the article but please update the link to the zip.
It would really help get this working
Thanks
Unfortunately the link containing the project zip doesn't work! Would you plz send the zip file to this address : (baoanh4386.it)
The link containing the project zip doesn't work. Would you please send me the zip file to my address : (paveenju@gmail.com)
thank you!
Post a Comment