5 Replies Latest reply on Sep 24, 2002 9:15 PM by duhengfei

    petstore 1.3.01

    Greg Rokita Newbie

      Where can I find instructions of what changes are necessary to deploy Sun Petstore 1.3.01 on JBOSS 3.0.0beta2 ?

        • 1. Re: petstore 1.3.01
          nusa Novice

          Hi,

          This is what I get so far http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ still struggling ...

          • 2. Re: petstore 1.3.01
            far Newbie

            Petstore3.01 doesn't run on Jboss3.beta. It runs on jboss3.01. Try to use the last version of Petstore1.3.1
            I'll be setting my website soon where I will put some instruction on how to run ,use and reuse Petstore web application

            --IF U KNOW HOW TO CREATE jbosscmp-jdbc.xml for the 9 cmp enties the rest is easy
            Faisal

            • 3. Re: petstore 1.3.01
              nusa Novice

              Hi,

              When will your website be online ?
              In the mean time, could you share with us what are those 9 cmp entries ?

              Thanks.


              • 4. Re: petstore 1.3.01
                far Newbie

                9 CMP enrtries ...I was to write Beans
                Using the Petstore 1.3.1 - it has far better and smarter Controller (MVC) bla bla ..than Petstore1.3.01.
                If u check the ejb-jar.xml u will find many relationships
                between the local CMP beans - u should find them(10) in the file atttached . In my case i rebuilt the whole application to get better understanding of the its architecture especially the WAF- smart stuff..
                In your case u should create jbosscmp-jdbc.xml for every ejb-jar.xml -use my jbosscmp-jdbc as ref
                There is also one prb i encountred which is getting access an loading xml files from Tomcat WEB-INF

                SO I DID THIS
                instead of URL u =ServletContext.getResource("....xml")
                I USED
                URL u =Thread.currentThread().getContextClassLoader.getResource("....xml")-it solved the problem for good and I had to put my xml files in classes dir;

                in Catalog module u have also to adapt the sql to your RDBMS - I am using mysql so I had to add LEFT before JOIN

                Hope this help!
                I am thinking of setting a Web site a kind of forum for Jboss users,best practices and Open Source stuff - there are many questions which go unanswrered in most of the time ...and Jboss team is concerned about marketing their product ..well they have to.

                Faisal



                I ve tried to attach the file with no luck
                here it is copied:

                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN" "C:/DTDS/j2ee/jbosscmp-jdbc_3_0.dtd">
                <jbosscmp-jdbc>

                <remove-table>true</remove-table>

                <enterprise-beans>

                <ejb-name>PurchaseOrderEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>purchaseorderejb</table-name>
                <cmp-field>
                <field-name>poId</field-name>
                <column-name>poId</column-name>
                <not-null/>
                </cmp-field>
                <cmp-field>
                <field-name>poUserId</field-name>
                <column-name>poUserId </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>poEmailId</field-name>
                <column-name>poEmailId </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>poDate </field-name>
                <column-name>poDate </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>poLocale</field-name>
                <column-name>poLocale</column-name>
                </cmp-field>
                <cmp-field>
                <field-name>poValue</field-name>
                <column-name>poValue </column-name>
                </cmp-field>

                <!-- supplierorder-->

                <ejb-name>SupplierOrderEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>supplierorderejb</table-name>
                <cmp-field>
                <field-name>poId </field-name>
                <column-name>oiId</column-name>
                <not-null/>
                </cmp-field>
                <cmp-field>
                <field-name>poDate</field-name>
                <column-name>poDate</column-name>
                </cmp-field>
                <cmp-field>
                <field-name>poStatus</field-name>
                <column-name>poStatus</column-name>
                </cmp-field>

                <!-- customer -->

                <ejb-name>CustomerEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>customerejb</table-name>

                <cmp-field>
                <field-name>userId </field-name>
                <column-name>userId </column-name>
                <not-null/>
                </cmp-field>

                <!-- profile-->

                <ejb-name>ProfileEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>profileejb</table-name>
                <cmp-field>
                <field-name>preferredLanguage</field-name>
                <column-name>preferredLanguage</column-name>
                <not-null/>
                </cmp-field>
                <cmp-field>
                <field-name>favoriteCategory</field-name>
                <column-name>favoriteCategory</column-name>
                </cmp-field>
                <cmp-field>
                <field-name>myListPreference</field-name>
                <column-name>myListPreference </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>bannerPreference</field-name>
                <column-name>bannerPreference</column-name>
                </cmp-field>

                <!-- account -->

                <ejb-name>AccountEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>accountejb</table-name>
                <cmp-field>
                <field-name>status</field-name>
                <column-name>status </column-name>
                <not-null/>
                </cmp-field>



                <ejb-name>UserEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>userejb</table-name>
                <cmp-field>
                <field-name>password </field-name>
                <column-name>password </column-name>
                </cmp-field>

                <cmp-field>
                <field-name>userName</field-name>
                <column-name>userName</column-name>
                <not-null/>
                </cmp-field>





                <ejb-name>ManagerEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>managerejb</table-name>


                <cmp-field>
                <field-name>status</field-name>
                <column-name>status</column-name>

                </cmp-field>

                <cmp-field>
                <field-name>orderId</field-name>
                <column-name>orderId</column-name>
                <not-null/>
                </cmp-field>



                <ejb-name>CounterEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>counterejb</table-name>
                <cmp-field>
                <field-name>counter </field-name>
                <column-name>counter</column-name>
                <jdbc-type>INTEGER</jdbc-type>
                <sql-type>INTEGER</sql-type>
                </cmp-field>
                <cmp-field>
                <field-name>name </field-name>
                <column-name>name</column-name>
                <not-null/>
                </cmp-field>



                <ejb-name>CreditCardEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>creditcardejb</table-name>
                <cmp-field>
                <field-name>expiryDate</field-name>
                <column-name>expiryDate </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>cardType</field-name>
                <column-name>cardType </column-name>
                <not-null/>
                </cmp-field>
                <cmp-field>
                <field-name>cardNumber </field-name>
                <column-name>cardNumber </column-name>
                </cmp-field>

                <!-- line item -->

                <ejb-name>LineItemEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>lineitemejb</table-name>
                <cmp-field>
                <field-name>categoryId</field-name>
                <column-name>categoryId</column-name>
                <not-null/>
                </cmp-field>
                <cmp-field>
                <field-name>productId</field-name>
                <column-name>productId</column-name>
                </cmp-field>
                <cmp-field>
                <field-name>itemId </field-name>
                <column-name>itemId </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>lineNumber </field-name>
                <column-name>lineNumber </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>quantity </field-name>
                <column-name>quantity </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>unitPrice </field-name>
                <column-name>unitPrice </column-name>
                </cmp-field>
                <cmp-field>
                <field-name>quantityShipped</field-name>
                <column-name>quantityShipped</column-name>
                </cmp-field>

                <!-- address-->

                <ejb-name>AddressEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>addressejb</table-name>
                <cmp-field>
                <field-name>streetName1</field-name>
                <column-name>streetName1</column-name>
                </cmp-field>
                <cmp-field>
                <field-name>streetName2</field-name>
                <column-name>streetName2</column-name>
                </cmp-field>
                <cmp-field>
                <field-name>city</field-name>
                <column-name>city</column-name>
                </cmp-field>
                <cmp-field>
                <field-name>state</field-name>
                <column-name>state</column-name>
                </cmp-field>
                <cmp-field>
                <field-name>zipCode</field-name>
                <column-name>zipCode</column-name>
                <not-null/>
                </cmp-field>
                <cmp-field>
                <field-name>country</field-name>
                <column-name>country</column-name>
                </cmp-field>

                <!-- contactinfo -->

                <ejb-name>ContactInfoEJB</ejb-name>
                <remove-table>true</remove-table>
                <table-name>contactinfoejb</table-name>
                <cmp-field>
                <field-name>familyName</field-name>
                <column-name>familyName</column-name>
                <not-null/>
                </cmp-field>


                <cmp-field>
                <field-name>givenName</field-name>
                <column-name>givenName</column-name>
                </cmp-field>


                <cmp-field>
                <field-name>telephone</field-name>
                <column-name>telephone</column-name>
                </cmp-field>


                <cmp-field>
                <field-name>email</field-name>
                <column-name>email</column-name>
                </cmp-field>




                </enterprise-beans>

                <!-- (1)PURCHASE ORDER HAS CONTACTINFO -->
                <ejb-relation>
                <ejb-relation-name>PurchaseOrder-ContactInfo</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>contactinfo-for-purchaseorder</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>purchaseorder-has-contactinfo</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>poId</field-name>
                <column-name>PO_ID</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!--(2) PURCHASE ORDER -HAS CARD -->
                <ejb-relation>
                <ejb-relation-name>PurchaseOrder-Card</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>card-for-purchaseorder</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>purchaseorder-has-card</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>poId</field-name>
                <column-name>poIda</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!--(3) purchase order -has lineitem -->
                <ejb-relation>
                <ejb-relation-name>PurchaseOrder-LineItem</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>lineItem-for-purchaseorder</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>purchaseorder-has-lineitems</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>poId</field-name>
                <column-name>poIdb</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!-- (6) supplier -has-lineItemssssss -->
                <ejb-relation>
                <ejb-relation-name>SupplierOrder-LineItem</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>lineItem-for-purchaseorder</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>purchaseorder.getLineItems()</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>poId</field-name>
                <column-name>poIdc</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!-- (7) supplierorder -has -contactinfo-->
                <ejb-relation>
                <ejb-relation-name>SupplierOrder-ContactInfo</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>address-for-purchaseorder</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>purchaseorder.getContactInfo()</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>poId</field-name>
                <column-name>poIdd</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!-- (4) customer -has-profile-->
                <ejb-relation>
                <ejb-relation-name>customer-has-profile</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>ProfileEJB.getCustomer()</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>CustomerEJB.getProfile()</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>userId</field-name>
                <column-name>userId</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!-- (5) customer -has-account-->
                <ejb-relation>
                <ejb-relation-name>customer-has-account</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>AccountEJB.getCustomer()</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>CustomerEJB.getAccount</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>userId</field-name>
                <column-name>userId </column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!-- (10) contactinfo -has address-->
                <ejb-relation>
                <ejb-relation-name>contact-has-address</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>address-in-contactinfo</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>contactinfo-has-address</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>familyName</field-name>
                <column-name>familyName</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!--(8) account -has contactinfo -->
                <ejb-relation>
                <ejb-relation-name>account-has-contact</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>ContactInfoEJB.getAccount()</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>AccountEJB.getContactInfo()</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>status</field-name>
                <column-name>status</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>
                <!-- (9) account -has-creditcard-->
                <ejb-relation>
                <ejb-relation-name>account-has-creditcard</ejb-relation-name>
                <foreign-key-mapping/>
                <ejb-relationship-role>
                <ejb-relationship-role-name>CreditCardEJB.getAccount()</ejb-relationship-role-name>
                <key-fields/>
                </ejb-relationship-role>
                <ejb-relationship-role>
                <ejb-relationship-role-name>AccountEJB.getCreditCard()</ejb-relationship-role-name>
                <key-fields>
                <key-field>
                <field-name>status</field-name>
                <column-name>status</column-name>
                </key-field>
                </key-fields>
                </ejb-relationship-role>
                </ejb-relation>

                </jbosscmp-jdbc>

                • 5. Re: petstore 1.3.01
                  duhengfei Newbie

                  I`d like to know how do you connect the petstore1.3.1 to mysl? According to the CONFIGURING.HTML from document of petstore of SUN, some modifications are necessary, what`s kind of name should replace the CLOUDSCAPE?
                  And, my jboss3.0.0RC1+tomcat4.0.3 can connect to database, how to communicate petstore1.3.1 with jboss?