Announcement Announcement Module
Collapse
No announcement yet.
Building Spring 3 Pet Clinic Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Building Spring 3 Pet Clinic

    How to build the Pet Clinic sample project that comes with the latest Spring 3 milestone?

    Have Spring spring-framework-3.0.0.M3
    OS: MACOSX
    JDK: Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)

    Thanks

  • #2
    Hey Javapda,

    You can just download Spring Tool Suite (get 2.1.0 or above), install it, and then "file" --> "import" --> "Spring Tool Suite" --> "sample" -->

    It will give you two choices: "Pet Clinic" + "Hotel Booking App". Make sure PetClinic is checked, and click "Ok".

    STS will do the rest

    Good Luck,
    -- litius

    P.S. These are Spring 3.0 samples

    Comment


    • #3
      I just start to learn spring now.

      I installed:
      Windows Vista
      Spring tool suite 3
      Java SDK 1.6

      I tried to open the sts and import a sample project. I believe everything will be downloaded automatically by the sample. But it failed.
      Would anyone can tell me how to run the sample step-by-step?
      thanks a lot.

      Comment


      • #4
        @Vick,


        What is failed? Could not download the project / dependencies or you could not deploy the sample app?

        Comment


        • #5
          Could not get Spring Tool Suite in import

          Hi,
          Spring Tool Suite Version 2.3.0.RELEASE

          Right click Import-> import source is not showing the Spring tool suite option.

          Comment


          • #6
            I have also installed STS 2.3.2 on Eclipse 3.5 and I don't see an import > STS > sample?

            Does STS no longer support to import the sample projects?

            Comment


            • #7
              @jb_mahadevan, @ttruong,

              It is there under "File" --> "Import" --> "Spring Tool Suite" --> "Sample Projects".

              I am running 2.3.0. I see no reason why it would be removed in 2.3.2. In fact, changelogs do not mention about any change for sample projects.

              /Anatoly

              Comment


              • #8
                Trust me in 2.3.2 the is no option to select STS as an import source under File>Import.

                I did a clean install of 2.3.2 by following the instructions by installing the following (7 from 10) STS plugins:
                - Core / dm Server Tools
                - Core / Spring IDE
                - Core /STS
                - Extensions (Incubation) / Spri
                - Extensions / Spring IDE
                - Extensions / STS
                - Integrations / Spring IDE
                Due to another STS (build path) problem I have pointed the STS problem here as well: http://forum.springsource.org/showth...t=86902&page=2

                The problem here is that via STS the samples cannot be installed.

                Nevertheless doing a manuall installation of the petclinic as a project into eclipse I am facing another (third) problem as pointed out here: http://forum.springsource.org/showthread.php?t=87691

                I am getting stucked over several places

                Tai

                Comment


                • #9
                  I just did a clean install of eclipse-jee-galileo-SR2-win32.zip and STS 2.3.2. Samples import is not possible. Under File>Import I can select only the usual suspects like General, CVS, EJB, Java EE, Maven, ... SVN, Tasks...

                  Comment


                  • #10
                    Look in File->Import->Other->Sample Projects
                    Should see three projects
                    Hotel Booking Reference App
                    PetClinic
                    SpringTravel

                    Version: 2.3.2.RELEASE
                    Build Id: 201003230009

                    Comment


                    • #11
                      Sorry. I cannot see "Other" under File>Import but looking in Eclipse Installation Details I can see that I have the same STS with version 2.3.2.201003230009-RELEASE

                      But I have also installed Sprind IDE (2.3.2.201003220227-RELEASE). Does that interfere with STS? What is the difference between Spring IDE and STS?

                      Tai

                      Comment


                      • #12
                        It says in the spring-framework-3.0.2.RELEASE spring-framework-reference.pdf file :

                        The Spring distribution ships with the PetClinic sample, a web application that leverages the
                        annotation support described in this section, in the context of simple form processing. The
                        PetClinic application resides in the org.springframework.samples.petclinic
                        module.
                        In another place in that same reference document it says:

                        Code:
                        PetClinic example
                        
                        The PetClinic sample application included with the full Spring distribution illustrates several features of
                        the Spring TestContext Framework in a JUnit 4.5+ environment
                        Well I downloaded spring-framework-3.0.2.RELEASE-with-docs.zip and the PetClinic is not in it, or at least I can't find it there.
                        And so I downloaded spring-framework-3.0.2.RELEASE-dependencies.zip and PetClinic is not in it either.

                        So am I to understand when the reference manual says, "The PetClinic sample application included with the full Spring distribution " that it actually means I have to install STS and then do ""file" --> "import" --> "Spring Tool Suite" --> "sample" --> " ?

                        Does this merit creation of a JIRA issue: either a JIRA to report PetClinic is missing from the full Spring distribution, or else a JIRA to report the Spring Reference manual does not accurately explain how to obtain the PetClinic?
                        Last edited by RobertGloverJr; Apr 21st, 2010, 11:06 AM.

                        Comment


                        • #13
                          I'm also having a little problem with the petclinic app.

                          I got Spring and petclinic installed after a little difficulty along the lines of previous posts.

                          I'm running hsql. I had several errors in the petclinic.script file. It didn't like the 'public' schema. It's also missing a semicolon somewhere.

                          Anyway, I worked through all that. When I run the petclinic app from the SpringSource Tool Suite I get the following:

                          Code:
                          Data access failure: PreparedStatementCallback;
                          bad SQL grammar [SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like ?];
                          nested exception is java.sql.SQLException:
                          Table not found in statement
                          [SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like ?]
                          org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback;
                          bad SQL grammar [SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like ?];
                          nested exception is java.sql.SQLException:
                          Table not found in statement [SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like ?] at
                          org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276) at
                          (snip)
                          At this point I'm getting stuck - I'm running the hsql manager - I can see the owner table and it is populated. So I'd surmise the petclinic application is using the wrong schema. I don't know how to tell it to use 'public'. How can I determine if the 'sa' user uses the 'public' schema?

                          Comment


                          • #14
                            Robert,

                            Spring 3.0.x no longer comes with PetClinic. Thus if the documentation you came across (e.g., in the Spring Reference Manual) says PetClinic is included in the distribution, then yes, please open a JIRA issue so that this does not get overlooked for 3.0.3 and 3.1.x.

                            Thanks,

                            Sam

                            p.s. FYI: sample applications are now available stand-alone in a new "sample-apps" repository. Also, the Spring team is working on a replacement for PetClinic called PetCare.

                            Comment


                            • #15
                              Location of Sample App

                              Hi Robert and Sam,

                              I found instructions for downloading the Spring 3.0 version of PetClininc here:
                              http://stackoverflow.com/questions/2...ate-backed-jpa

                              Is there a better location for accessing the source than the SVN repository they list in that post?

                              Best regards,
                              Tim

                              Comment

                              Working...
                              X