Blogs

SpringSource Blog

Using Cloud Foundry from STS

Christian Dupuis

By now you probably heard about Cloud Foundry, the open PaaS from VMware that was announced yesterday; if not make sure to check out the recording of the webcast. Eventually you have already read earlier blog posts introducing the Spring support for Cloud Foundry, the add-on for Spring Roo and the Grails plug-in.

With this post I’d like to introduce the Eclipse-based support for Cloud Foundry that lets you manage your cloud deployments, including configuration of Services and service bindings, application scaling, access to file resources and much more.

Installing the Cloud Foundry for Eclipse and STS

There are three options to install the Cloud Foundry plugin into SpringSource Tool Suite (STS) and plain Eclipse. I will go through those options step-by-step in order to help you get started quickly.

Installing through the STS Extension Install

Probably the easiest way to get started with the Cloud Foundry plugin is by installing it into a pre-installed copy of STS. You should have at least version 2.5.1.RELEASE installed; 2.6.1.SR1 is better. STS for various supported operating systems can be found on the download page.

Within STS select “Help > Dashboard” and click on the Extension tab at the bottom of the Dashboard. Wait for the extension listing to be loaded and select “Cloud Foundry Integration” from the “Server and Clouds” category; click “Install” to launch the installation procedure.

From here on you can just follow the steps of the installation wizard. Along the way you need to review and accept the license agreement and restart STS to finalize the installation. After restarting STS you’re ready to connect to Cloud Foundry.

Installing from Eclipse Marketplace

The Cloud Foundry plugin can quite easily be installed into plain Eclipse installations. To make sure that all dependencies can be satisfied during installation you should start be installing the “Eclipse IDE for JEE Developers” package. This package can be downloaded from the Eclipse download page or from the SpringSource member distribution page.

Start the installation by launching the Eclipse Marketplace client by selecting “Help > Eclipse Marketplace”. Type “cloud foundry” into the search field and select “Go”. This will find the “Cloud Foundry Integration” which you can install by clicking the “Install” button next to the listing in the search results.

Again, now you just need to follow the steps in the software installation wizard; accept the license terms, eventually agree to install un-signed content and restart Eclipse when being asked to do so. After restarting your Eclipse you’re ready to connect to Cloud Foundry and deploy your first application from inside your development environment.

Manual install from Update Site

If you don’t like or can’t use the STS Extension Install mechanism or Eclipse Marketplace Client you can install the integration plugin manually from the following update site:

http://dist.springsource.com/milestone/TOOLS/cloud/e3.6

Please note: the update site does not support directory indexing. Therefore you’ll get a “Access Denied” error message when hitting the URL with your web browser.

Connecting to Cloud Foundry

The Cloud Foundry Integration plugin tightly integrates the cloud into the Web Tools Project (WTP) Server infrastructure. This is the most commonly known approach to deploying Java web applications from Eclipse. Most of you probably used the Servers View to deploy to a local Tomcat or tc Server instance.

With the Cloud Foundry Integration for Eclipse you will continue to use the Servers view to deploy your applications to the cloud. To start we first need to create a new WTP Server. This server represents your Cloud Foundry account and you’ll be able to connect to your Cloud Foundry account; much like using “vmc target ; vmc login” from the command line.

The following steps guide you through the process of connecting to Cloud Foundry:

  • Open the “Servers” view from “Window > Show view … > Other … > Servers”
  • Right click in the “Servers” view and select “New > Server”
  • Select “Cloud Foundry” from the “VMware” category and click “Next"
  • Enter your account information and select the cloud you want to connect to. If you have a Cloud Foundry account select “VMware Cloud Foundry – http://api.cloudfoundry.com” from the URL drop-down box. You can also use the Cloud Foundry Integration with a local installation of Cloud Foundry. Finally press “Validate Account” to check if the connection can be established successfully.
  • Click “Finish” to close the “New Server” wizard

After finishing the “New Server” wizard you should see a new entry in the “Servers” view for Cloud Foundry. The connection to Cloud Foundry will automatically be established and you’ll see your deployed applications below the Cloud Foundry server node in the Servers view.

You may notice that the “Start” and “Stop” actions in the view’s toolbar are disabled. Instead you’ll find “Connect” and “Disconnect” actions in the context menu when right-clicking the Cloud Foundry server.

Deploying Applications

Deploying applications to Cloud Foundry is now just a question of dropping the application onto the Cloud Foundry server in the “Servers” view. Alternatively you could use the “Add and Remove …” action from the server’s context-menu.

Once the application has been added to Cloud Foundry it can be started: right-click the application in the “Servers” view and select “Start”. This will bring up the application deployment wizard that allows you specify the application name, URL and memory reservation. We’ll add more configuration options in the future.

After clicking “Finish” the plugin will upload and start the application on Cloud Foundry. You can review the status of your application deployment by double-clicking the application in the “Servers” view. This brings up the “Server Editor” that has been extended to show Cloud Foundry specific information.

Service Provisioning and Binding

The application that you want to deploy likely needs to access Services provided by Cloud Foundry. To initially provision the services you can use the “Server Editor”: on the “Applications” tab press the “Add service” action from the toolbar of “Services” section.

Once the services are provisioned to your Cloud Foundry account, you can bind them to your applications. To do so just drag and drop the services you want to bind to certain application to “Application Services” table on the right side of the “Server Editor”. If your application needs to access services during startup and would fail to start without the services being available, bind the services before you start your application.

Remote File Access

The Cloud Foundry Integration for Eclipse provides access to remote file resources, much like “vmc files ” and “vmc logs –all”. Click the “Remote Systems View” link on the bottom right of the application details pane in the “Server Editor”. This brings up the "Remote Systems" view which will let you browse the file tree and open files, e.g. log files, directly from within Eclipse.

What's next

We'll continue to improve the Cloud Foundry Eclipse support over the coming weeks. As always we very much value community feedback. Therefore please take some time to check out the plugin and let us know what you think.

In case you find any issues please raise JIRAs in the STS issue tracker.

Similar Posts

Share this Post
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Slashdot
  • Technorati
  • Twitter
 

29 responses


  1. Great Post!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


  2. I enjoy reading your commentaries.


  3. I will love to read some more articles here.


  4. Christian, thank you for the great post. What would be the best way to populate tables of an application deployed to the Cloud?


  5. Stan,

    We are aware of this issue and will provide tools and techniques to simplify this vastly. Currently, applications need to populate database. For example, you could use the jdbc namespace support described in http://static.springsource.org/spring/docs/3.0.x/reference/jdbc.html#d0e24249.


  6. Is is in competition with Rackspace's OpenStack? Or altogether new?


  7. Can't wait for IntelliJ IDEA to bake in native support for CloudFoundry. v10.5 of IDEA is already including support for Spring 3.1 – CloudFoundry would be awesome. :)


  8. We just wrote a follow-up blog on how to install Cloud Foundry on Ubuntu / Amazon EC2 and get applications deployed on such instances using STS: http://blog.modeltwozero.com/2011/05/running-cloud-foundry-on-amazon-ec2-or.html


  9. Hi,I have some question about STS when I use it.I hope you can help me.
    1.How can I get a account about VMware Cloud Foundry? I have done a sign up in the website of "http://www.cloudfoundry.com/" to request a invite.

    2.How can I use STS to deploy app with salesforce? I saw some demos from website of VMforce which show that we can create a "VMforce server" in STS, but I cannot find this server in my STS(VERSION:2.6.1.RELEASE). Whether there are some plugins need download?

    That's all. Looking forward your answer.
    Thank you.


  10. XU WEN JIE:

    1. You will receive an email from CloudFoundry in a few days.
    That email will contain your account information, including your email and temporary password.

    2. You have to download the cloud foundry plug in to your sts.

    Please follow these steps :

    1.Open the STS DashBoard. You can find the icon to launch the DashBoard on the upper left hand side.
    2. On the dashboard, under the Help and documentation , click on 'extensions'.
    3. It will automatically find all the available plugins for you.
    4. Choose the CloudFoundry plugin.
    5. Install the plugin and restart the STS.
    6. You will now see the 'cloudfoundry' server option under the VMWare. You can create the new server by putting your account info, you already received in your email box.

    Hope that helps.

    Thanks,
    Nitin.


  11. Thank you! I have received the email,and download the cloud foundry plug in my sts.


  12. Hi, i need help, when i try to conect to the server foundry appears the next error:

    Failed to connect to server: Communication with server failed: 502 Proxy Error ( Connection refused )

    other thinks is when i put the password not recognizes.

    anyone can help me


  13. If you doubt that its your password, please try to validate your account before connecting to the server.
    There is a button on the same screen, when you try to connect, if the validation passes, that means your account info is good.

    If you pass the validation and still get this error , then see if you have any firewall etc on your machine, which may be preventing you to contact the server.

    Other than that, I do not see any reason for the communication failure.

    Thanks,
    Nitin.


  14. Hi Christian,

    Thanks for the great article.

    can you please give more details about "Service Provisioning and Binding"?

    I want to know and understand how can I deploy an app on cloud which uses local MYSQL database.
    how will my database instance be available in the cloud?
    Please provide steps to do it through the STS.

    An article on it will be even better, because I am sure that many of the developers would like to see that, in order to learn it, as Data access is an integral part of the any application.

    Waiting for a positive response.

    Thanks,
    Nitin.


  15. Hi,I validate the account, display"Account information is valid",but when I connect to the server,display "Failed to connect to server:Operation not permitted (403 Forbidden).My computer haven't firewall with win7 and sts2.6.1SR1.

    Please help me.
    Thank you.


  16. Cool, just deploied one site. Greate!!!!


  17. Why I can't? help me. please, thank you.


  18. I have deployed a web application to cloud foundry with mysql service.

    Now I'm blocked by MySQL. I cannot login into System because I have enabled security, and I don't know whether database have been setup or not…
    If database is setup, whether my init data is inserted or not
    And how can I check my data in cloud


  19. Using STS 2.6.1.RELEASE It seems one has to have a "hello world" war deployed in order to get to the "Server Editor", is this correct? Also, will configuring a MySQL cluster be an option in future if not now? Finally, are there plans for any messaging services?


  20. I am getting an error, when I tried to install from both 1. Software Marketplace and the 2. manual installation method.

    The error is:
    Cannot complete the install because of a conflicting dependency.
    Software being installed: SpringSource Tool Suite Cloud Foundry Integration 2.7.0.201105292341-M2 (com.cloudfoundry.sts.server.feature.group 2.7.0.201105292341-M2)
    Software currently installed: Eclipse IDE for Java EE Developers 1.4.0.20110615-0550 (epp.package.jee 1.4.0.20110615-0550)
    Only one of the following can be installed at once:
    Debug UI 3.7.0.v20110518 (org.eclipse.debug.ui 3.7.0.v20110518)
    Debug UI 3.6.0.v20100601-1530 (org.eclipse.debug.ui 3.6.0.v20100601-1530)
    Debug UI 3.6.3.v20101201_r362 (org.eclipse.debug.ui 3.6.3.v20101201_r362)
    Debug UI 3.6.1.v20100901_r361 (org.eclipse.debug.ui 3.6.1.v20100901_r361)
    Cannot satisfy dependency:
    From: SpringSource Tool Suite Cloud Foundry Integration 2.7.0.201105292341-M2 (com.cloudfoundry.sts.server.feature.group 2.7.0.201105292341-M2)
    To: com.springsource.sts.feature.group 2.6.0
    Cannot satisfy dependency:
    From: SpringSource Tool Suite (required) 2.7.0.201107041000-RELEASE (com.springsource.sts.feature.group 2.7.0.201107041000-RELEASE)
    To: com.springsource.sts.ide.ui [2.7.0.201107041000-RELEASE]
    Cannot satisfy dependency:
    From: SpringSource Tool Suite (UI) 2.7.0.201107041000-RELEASE (com.springsource.sts.ide.ui 2.7.0.201107041000-RELEASE)
    To: bundle org.eclipse.ajdt.ui 0.0.0
    Cannot satisfy dependency:
    From: Eclipse IDE for Java EE Developers 1.4.0.20110615-0550 (epp.package.jee 1.4.0.20110615-0550)
    To: org.eclipse.epp.package.jee.feature.feature.group [1.4.0.20110615-0550]
    Cannot satisfy dependency:
    From: AspectJ Development Tools UI 2.1.3.e36x-20110622-1300 (org.eclipse.ajdt.ui 2.1.3.e36x-20110622-1300)
    To: bundle org.eclipse.debug.ui [3.6.0,3.7.0)
    Cannot satisfy dependency:
    From: Java EE IDE Feature 1.4.0.20110615-0550 (org.eclipse.epp.package.jee.feature.feature.group 1.4.0.20110615-0550)
    To: org.eclipse.platform.feature.group [3.7.0.v20110530-9gF7UHNFFt4cwE-pkZDJ7oz-mj4OSEIlu9SEv0f]
    Cannot satisfy dependency:
    From: Eclipse Platform 3.7.0.v20110530-9gF7UHNFFt4cwE-pkZDJ7oz-mj4OSEIlu9SEv0f (org.eclipse.platform.feature.group 3.7.0.v20110530-9gF7UHNFFt4cwE-pkZDJ7oz-mj4OSEIlu9SEv0f)
    To: org.eclipse.debug.ui [3.7.0.v20110518]


  21. Could someone let me know how to find "“Add service” action from the toolbar of “Services” section" in STS?

    I kind of lost in looking for this panel in IDE.

    Thanks very much.


  22. @ jiarenhao, double click on the Cloud Foundry server in the 'Server' view and in the dashboard that shows, go to "Applications" tab. You will services on bottom left corner.


  23. @Raymond: I did install AJDT for Eclipse 3.7 (http://download.eclipse.org/tools/ajdt/37/dev/update). Now it installs ok!


  24. Very interesting post.


  25. I did install following all the instruction but Cloud Foundry is not listed in VMware section, I just have VMware vFabric tc Server v2.5 in that section. Am I missing something?


  26. We have gone ahead and added a backlink back to your web site from one of my clients requesting it. We have used your internet site URL: http://blog.springsource.org/2011/04/13/using-cloud-foundry-from-sts and blog title: Using Cloud Foundry from STS | SpringSource Team Blog to guarantee you get the correct anchor text. If you woud like to check out where your hyperlink has been placed, please e-mail me at: Langille@grpmax.uk. Appreciate it


  27. I have gone ahead and added a backlink back to your webpage from one of my clientele requesting it. I have used your web site URL: http://blog.springsource.org/2011/04/13/using-cloud-foundry-from-sts and blog title: Using Cloud Foundry from STS | SpringSource Team Blog to make sure you get the correct anchor text. If you woud like to check out where your hyperlink has been placed, please contact me at: Lidstrom@grpmax.uk. Cheers


  28. I just realized that there is no way to allow Spring load time weaving…


  29. i get the following error while installing micro cloudfoundry from sts.

    Can some one pls help?

    Problems occurred while performing installation: No repository found at http://dist.springsource.com/milestone/TOOLS/cloud/e3.6.
    No repository found at http://dist.springsource.com/milestone/TOOLS/cloud/e3.6.

7 trackbacks

Leave a Reply