Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Spring Template Project Now Working with Cloud Foundry Server

  1. #1
    Join Date
    May 2012
    Posts
    11

    Default Spring Template Project Now Working with Cloud Foundry Server

    Hi there,

    Hope someone could help me solve my problem. I'm currently trying to create a spring mvc project using STS tool.
    So I created one using the Spring Template Project provided by STS. I tried to run it using tomcat server and it's doing fine. But when I tried using the VMare Cloud Foundry Server, it is not working anymore. I'm having this kind of error:
    Code:
    org.apache.jasper.JasperException: java.lang.NullPointerException
    	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:538)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
    	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1157)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:927)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    I would appreciate any help guys!

    Thanks!

  2. #2
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey!

    What version of STS and what version of the Cloud Foundry integration for Eclipse are you using?

    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  3. #3
    Join Date
    May 2012
    Posts
    11

    Default

    Quote Originally Posted by Martin Lippert View Post
    Hey!

    What version of STS and what version of the Cloud Foundry integration for Eclipse are you using?

    -Martin
    Hi Martin,

    I looked at my eclipse installation, so here it shows:

    Spring IDE - Version: 3.0.0.201208090952-RELEASE
    Cloud Foundry Integration for Eclipse - Version: 1.2.0.201208271601-RELEASE

    I'm also using Eclipse Juno.

    Is there a version issue when using sts and cloudfoundry?

    Thanks!

  4. #4
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey!

    Those versions look fine, just wanted to make sure you are using the latest version of the right components.
    Did you try to do a "clean" on the project before you publish it to your cloudfoundry.com account?

    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  5. #5
    Join Date
    May 2012
    Posts
    11

    Default

    Quote Originally Posted by Martin Lippert View Post
    Hey!

    Those versions look fine, just wanted to make sure you are using the latest version of the right components.
    Did you try to do a "clean" on the project before you publish it to your cloudfoundry.com account?

    -Martin
    Yup I did. Actually, I didn't expect it to be this hard to run this very simple spring project in cloudfoundry. What I did was simpy create new project base on spring mvc template project. Then that's it, I already have a preconfigured spring mvc project. I did't change any configuration. So when I run it in my tomcat localhost it was running good, but with cloudfoundry, i don't know why i'ts having error. As far as I know you don't have to change any configuration with your spring project alteast.

    I'm getting a little bit frustated about it. hehe.. but I know there's a way , I just cant figure out.

    Hope you could help me.!

    Thanks!!!

  6. #6
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey!

    I tried this myself again and using a fresh STS 3.0.0 distribution with installed Cloud Foundry for Eclipse support, all this works out of the box. Here are a few things we can/should check to see why it is not working in your environment:

    - after you created a fresh MVC template project, does it build fine? Or do you see any error markers appearing?
    - are you behind a proxy/firewall? After setting up your cloud foundry server in your IDE, can you connect to it without any problems?
    - is there anything related showing up in the Error View?

    Here is what I did:
    - downloaded and installed a fresh STS 3.0.0 distribution
    - added the cloud foundry support from the dashboard
    - created a cloud foundry server in STS (Servers view -> new...)
    - created a new MVC template project
    - deployed that to CF, saw the log output in the console
    - tried to open the website and it worked

    I am sure we will figure out what is going wrong in your case... Sorry that you don't have this expected out-of-the-box experience...

    Cheers,
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  7. #7
    Join Date
    May 2012
    Posts
    11

    Default

    I really appreciate your effort to helped me. What you did is exactly what I did. But as what happened to me, I didn't have the same result with you. But wait, I just tried to create just a dynamic web project in eclipse. Added a single home page. And it was working with cloudfoundry. Here's the URL :

    http://mywebs.cloudfoundry.com/

    And this is the url of my spring mvc project based on the template from sts:

    http://rec-myspringmvcproject.cloudfoundry.com/

    on my tomcat localhost , it is working fine , the result is this

    "Hello world!
    The time on the server is September 18, 2012 3:33:50 PM SGT."

    Now, I'm sure that the problem is not with my network proxy/firewall as I could run a dynamic web project. May be it's on the configuration of my spring mvc project or something else.

    Is it possible for you to send me the spring project you created in sts? so I could compare them.

    Thanks! thanks a lot Martin!
    Last edited by redcode7000; Sep 18th, 2012 at 03:57 AM.

  8. #8
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey!

    Here is my project that I created freshly using the Spring MVC template.

    Hope this helps!
    -Martin
    Attached Files Attached Files
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  9. #9
    Join Date
    May 2012
    Posts
    11

    Default

    Hi Martin,

    Thanks, I really appreciate your help. However the project you gave me is still not working with cloudfoundry. But if it works with your set up, I guess the problem is on my machine or something else. I'll try to find a way to test it using another computer. Nevertheless , I'm sure that the problem is not with my spring configuration since it is working with you.

    Again thanks!

  10. #10
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey!

    You could also try to build the project locally using Maven (from the command line) and then deploy the WAR file via the CloudFoundry vmc command line tool - not as a workaround, but as a step towards figuring out what is going wrong on your machine.

    HTH,
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •