Date: 2004-10-24T10:56:56 Editor: RalfBarkow <[EMAIL PROTECTED]> Wiki: Apache Geronimo Wiki Page: PetStore URL: http://wiki.apache.org/geronimo/PetStore
Appended Rajesh Ravindran's "To get Petstore 1.1.2 work on geronimo" Change Log: ------------------------------------------------------------------------------ @@ -1,20 +1,21 @@ -#pragma section-numbers off +'''Contents''' +[[TableOfContents]] -= '''About''' = +---- -Let's dust it off and see how much Geronimo improved since the last update (it was really a long time ago). += Deploying Java Pet Store Demo 1.3.2 = The page is about deploying [http://java.sun.com/blueprints/code/index.html#java_pet_store_demo Java Pet Store Demo 1.3.2] in Apache Geronimo. The Java Pet Store Demo is a sample application brought to you by the [http://java.sun.com/blueprints Java BluePrints] program at [http://java.sun.com Java Software], [http://sun.com Sun Microsystems]. -= Prerequisites = +== Prerequisites == * [wiki:BuildingAndRunning Build Apache Geronimo] * Download [http://java.sun.com/blueprints/code/index.html#java_pet_store_demo Java Pet Store Demo 1.3.2] -= Deploying PetStore = +== Deploying PetStore == Before going on, please keep in mind that {{{"whom ever wrote petstore should be hunted down..."}}}. It's been said during one IRC session and I couldn't resist to include it. @@ -244,4 +245,136 @@ at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1079) at org.apache.geronimo.kernel.Kernel.invoke(Kernel.java:231) at org.apache.geronimo.system.main.CommandLine.main(CommandLine.java:93) +}}} + + + += Getting Petstore 1.1.2 to work on Apache Geronimo = + +Rajesh Ravindran wrote on 2004-09-24 to [EMAIL PROTECTED] : + +I had a chat with David Blevins & he asked me to share my experiences +on making petstore work in geronimo with everyone. + +First of all I would like to state that I did not work on the latest +version of petstore i.e. 1.3.2 . I used the petstore that comes with +Weblogic 6.1. (which i believe is 1.1.2) I got that working on +geronimo. In doing this I got a lot of help from Gianny & a lot of +guys on the mailing lists & friends who worked with me on this: +Sai,Prem & Vandana. I hope this would be of some help. Please respond +with any queries and feedbacks. This is not a detailed list of +changes, but just an overview. So you can push me for details. + +I had to make the following changes to get petstore running. + +== Had to provide the ejb-link ... == +... at all places wherever extenal ejb's were being referenced. It seems it doesnt work at least in geronimo-jetty.xml if we just give the ejb-ref & give the target-name. Faced problems there. + +For instance, in the web.xml + {{{ +<ejb-ref> + <ejb-ref-name>ejb/catalog/Catalog</ejb-ref-name> + <ejb-ref-type>Session</ejb-ref-type> + <home>com.sun.j2ee.blueprints.shoppingcart.catalog.ejb.CatalogHome</home> + <remote>com.sun.j2ee.blueprints.shoppingcart.catalog.ejb.Catalog</remote> +<!----------------------------------------------------------------> + <ejb-link>TheCatalog</ejb-link> + + <!--This had to be added as geronimo requires the links to be available--> +<!-----------------------------------------------------------------> +</ejb-ref> +}}} + +== Another factor was that the japanese screen definitions ... == +... were not working due to the use of unicode encoding & I guess the app server +could not identify it. So removed those screendefinitions from +requestmappings.xml +i.e remove the following line from requestmapping.xml + {{{ +<screen-definition url="/WEB-INF/xml/ja/screendefinitions.xml" +language="ja_JP"/> +}}} + +== Two setters & getters in the petstore code ... == +... were giving me errors. + +These were the setNumItems & setStartIndex. This was due to the fact +that the setter accepted String & the getter was returning an int. Had +to change the setter to accept int. + {{{ + public void setNumItems(String numItemsStr) { + numItems = Integer.parseInt(numItemsStr); + } + + public void setStartIndex(String startIndexStr) { + startIndex = Integer.parseInt(startIndexStr); + } +}}} + + had to be changed to + + {{{ + public void setNumItems(int numItems) { + this.numItems = numItems; + } + + public void setStartIndex(int startIndex) { + this.startIndex = startIndex; + } +}}} +This has to be done in the following files: + ListTag.java,ProductListTag.java,CartListTag.java,SearchListTag.java,ProductItemListTag.java, + MyListTag.java + +== Had to use an adapter (tranql generic adapter) ... == +... & had to write the corresponding geronimo-jetty.xml to use the oracle database (or +cloudscape if you are using that) from where to access the inventory +and other databases used by petstore. The adapter jar had to be packed +along with the ra.xml, geronimo-ra.xml & the required drivers. + +Pack it up in a *.rar archive. + +== To get the petstoreAdmin.ear working: == + +Had to create the petstore realm (this was for getting the +petstoreAdmin working) + +the following user & group properties files had to be created + {{{ +# groups.properties +gold= +cust=j2ee +admin=jps_admin +{{{ + {{{ +# users.properties +j2ee=j2ee +jps_admin=admin +{{{ + +A petstore-plan.xml to be created for security + +The petstore security plan had to be added to maven.xml, & then build it. + +In web.xml changed the realm from default to petstore-realm + {{{ +<login-config> + <auth-method>FORM</auth-method> + <realm-name>petstore-realm</realm-name> <!--changed from default +to petstore-realm--> + <form-login-config> + <form-login-page>/login.jsp</form-login-page> + <form-error-page>/error.jsp</form-error-page> + </form-login-config> +</login-config> +}}} + +In the ejb-jar.xml had to make the following change: + {{{ +<env-entry> + <env-entry-name>user/AdminId</env-entry-name> + <env-entry-type>java.lang.String</env-entry-type> +<env-entry-value>petstore-realm:[org.apache.geronimo.security.realm.providers.PropertiesFileGroupPrincipal:admin]</env-entry-value> + <!-changed the value from jsp_admin to the whole nested name of +the principal--> }}}