Announcement Announcement Module
Collapse
No announcement yet.
Spring Template Project Now Working with Cloud Foundry Server Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Hey!

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

    -Martin

    Comment


    • #3
      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!

      Comment


      • #4
        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

        Comment


        • #5
          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!!!

          Comment


          • #6
            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

            Comment


            • #7
              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, 03:57 AM.

              Comment


              • #8
                Hey!

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

                Hope this helps!
                -Martin

                Comment


                • #9
                  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!

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      Hi,

                      I just want to follow up my post here. I can now successfully deploy a spring project in cloudfoundry. I've found out that the problem is with my version of tomcat. I'm currently using version 7. I've changed it my tomcat to version 6. And try to deploy it locally. Then I tried it again with cloudfoundry and luckily it is now working. :-)

                      Comment


                      • #12
                        Hey!

                        First of all, I am glad to hear that you got it working!!!

                        But I would like to investigate in more detail why it failed before. From what I understood is: you created your Spring MVC template project and deployed it on a local Tomcat 7. That worked. Then you deployed it to Cloud Foundry and that failed. But after switching your local Tomcat to version 6 and deploying your app to that Tomcat, it works. Then you tried again to deploy to Cloud Foundry and then it worked. Is that correct? And what happens if you switch your local Tomcat back to 7 and do the same again? Does it reproduce the error?

                        Thanks for your help!
                        -Martin

                        Comment

                        Working...
                        X