GWT in CloudFoundry will it work? - java

My web application is made with Java, specifically with the Google Web Toolkit (GWT). The back-end used
GWT RPC RemoteServiceServlet
Hibernate/Java
MongoDB (via Morphia)
and other Java libraries
I really did not use any Spring framework at all, will my web application be able to be deployed in a CloudFoundry MicroCloud and in CloudFoundry.com hosting?
Will I be needing to reconfiguring my web application that has been tested and deployed in a Tomcat Server with MySQL and MongoDB database?

GWT should not be an issue.
If you want to deploy a java web app not using Spring, you can deploy it as a java web app, then parse the VCAP_SERVICES manually to configure your data sources from the application.
See http://blog.springsource.org/2011/10/13/using-cloud-foundry-services-with-spring-part-1-the-basics/ for details
https://github.com/SpringSource/cloudfoundry-samples/tree/master/hello-java

Why wouldn't it work?
In the event it wouldn't, that wouldn't be because of GWT at least: GWT-RPC runs in AppEngine, so there's no reason it wouldn't work in CloudFoundry.

Related

How to Consume java web-service (jetty) in C#

I am a newbie to C# development.
Scenario -
We have an application running on .NET 2.0 framework and IIS 6.5. Now, we have installed another application on a remote server which utilizes Jetty web server. For us to integrate both the applications we need to add a reference to a web service in jetty. I have found the web service path on the server which is a .class file and I want to add a reference to my .NET application.
My problem is - how do I find the URL to add a web reference to the .NET application in Visual Studio ? or is there another way to integrate both the applications ?
Thanks
Have you tried using the .wsdl of the .NET web service to generate a proxy class in the Jetty web server? I am assuming there is some type of discovery mechanism built into the Jetty web server for web service capabilities, right?

GWT Web Application project, with Hibernate?

I've made a Google Web Application Project in Eclipse and am now running into problems as I need to use from a server side point of view, with Hibernate with MySQL. I've just been told that Google Web Application projects can't run Hibernate connections to MySQL as they're deployed projects.
What's the best way for me to migrate this project somehow so it runs on say Glassfish and just uses GWT for the client side technologies that can then use Hibernate and MySQL, rather than actually being deployed?
Thanks,
David
You cannot access database from client-side directly.
GWT translates your client-side java code into Javascript which runs in browser; there is no way to directly access JDBC.
You will have to employ server-side which will handle your DB persistence. Your client can communicate via GWT-RPC, JSON, XML, or any other protocol - but the database connection part will always reside on server.
Note that the server part does not need to be in Java - it can use PHP or any other technology, as long as it understands the javascript generated out of your app.

Converting java application to web service in netbeans

I have recently created a java application(calculator) in netbeans and need to make it into a web service. How do i convert it?
You should take a look at the Java API for RESTful Webservices (JAX-RS). You can easily convert a basic POJO into a webservice using annotations (http://download.oracle.com/javaee/6/tutorial/doc/gilik.html#gilru).
Of course, if your calculator application is just a standalone Java application (ie. main method running through command such as 'java calculator') you will have to setup a web application and run it in a web container. Check out http://download.oracle.com/javaee/1.4/tutorial/doc/WebApp.html for details on getting started with Java web applications. Check out GlassFish (http://glassfish.java.net/), Tomcat (http://tomcat.apache.org/) or Jetty (http://www.mortbay.org/) for some web container options.

Developing GWT under Tomcat?

Is it possible to run GWT in hosted mode under Tomcat, not Jetty in Eclipse? I am going to integrate GWT widgets into spring app, so it make requests to spring controllers. But developing, spring is ran on one server, GWT on another... So I can't make direct requests to spring controllers, and I am tired of doing monkey work, writing servlets under jetty which make requests to spring controllers under tomcat...
You can use Tomcat instead of Jetty. You should start devmode with -noServer flag..
Here is more explanation from gwt web site

General Java Web App

I have a client server setup. I need my client to be able to call the server, and the server pass down either a file or the text contained in the file. I am new to web development. Which type of technologies should I investigate. I know that Java Web Services, Java Servlets, Java EE Applications all exist. But which one would be best for my uses? The server side application must be Java and run in Apache Tomcat.
Any suggestions would be greatly appreciated.
Thanks
Check out the Google Web Toolkit
Try Restlet in combination with Jetty container, but it works with any container (including Tomcat). Here is where you can start.
Restlet can be used for both desktop or in-browser web apps. Also it nicely integrates with Google Web Toolkit.

Categories