Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 93777 invoked from network); 6 Jul 2005 20:30:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jul 2005 20:30:53 -0000 Received: (qmail 175 invoked by uid 500); 6 Jul 2005 20:30:52 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 150 invoked by uid 500); 6 Jul 2005 20:30:51 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 131 invoked by uid 99); 6 Jul 2005 20:30:50 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2005 13:30:38 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 5671312 for ; Wed, 6 Jul 2005 22:30:34 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Apache Wiki To: scm@geronimo.apache.org Date: Wed, 06 Jul 2005 20:30:34 -0000 Message-ID: <20050706203034.17418.57748@ajax.apache.org> Subject: [Geronimo Wiki] Update of "PetStore" by JacekLaskowski X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Wiki user, You have subscribed to a wiki page or wiki category on "Geronimo Wiki" for change notification. The following page has been changed by JacekLaskowski: http://wiki.apache.org/geronimo/PetStore The comment on the change is: Not yet complete, but almost done - CMP mapping is incorrect yet ------------------------------------------------------------------------------ = Deploying Java Pet Store Demo 1.3.2 = - This section of 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. + This section of the page is about deploying [http://java.sun.com/blueprints/code/index.html#java_pet_store_demo Java Pet Store Demo 1.3.2] onto 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]. @@ -21, +21 @@ == Deploying PetStore == + {{{ + NOTE: 07/06: It's still a work in progress + }}} + 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. NOTE: Explanation on what particular file or configuration setting do(es?) will be added later. NOTE: There're a lot of steps to be done that require creating files manually. Most, if not all, files will be created by a JSR-88-compliant tool during the deployment process. - 1. Unpack petstore.ear (one of the files that constitute the application) to a directory, say ''/petstore/ear'' (on Windows it'd be ''c:/petstore/ear'') + NOTE: Commands are MS Windows specific - Linux version is on its way. - 2. Change the current working directory to /petstore/ear. + NOTE: - 3. Edit {{{META-INF/application.xml}}} and change the root tag ''application'' to: + i. GERONIMO_HOME - the directory where Geronimo is installed or built, e.g. C:\projs\geronimo\modules\assembly\target\geronimo-1.0-SNAPSHOT + i. PETSTORE_HOME - the directory where petstore.ear is unpacked, e.g. C:\projs\petstore\porting\petstore - {{{ - - }}} + 1. Unpack petstore.ear (one of the files that constitute the application) to a directory PETSTORE_HOME - Note: this is an optional task. Indeed, Deployment Descriptors, namely ''application.xml'', ''web.xml'', ''ra.xml'' and ''ejb-jar.xml'', are transparently upgraded upon deployment. In other words, if you have an old deployment descriptor based on a ''.dtd'' (''e.g.'' ''application_1_3.dtd'') then it will be turned into a deployment descriptor compliant with the corresponding ''.xsd'' (''e.g.'' ''application_1_4.xsd''). - How does it work exactly? See ''org.apache.geronimo.schema.SchemaConversionUtils''. - Create {{{META-INF/geronimo-application.xml}}}: + 2. Change the current working directory to PETSTORE_HOME. + + 3. Edit {{{META-INF/application.xml}}} so that it looks like this: {{{ - - - - - + + + PetStoreEAR + The BluePrints Petstore Built On top of the Web Application Framework. + + petstore-ejb.jar + + + customer-ejb.jar + + + asyncsender-ejb.jar + + + cart-ejb.jar + + + signon-ejb.jar + + + uidgen-ejb.jar + + + catalog-ejb.jar + + + + petstore.war + petstore + + + + geronimo-derby-connector-1.0-SNAPSHOT.rar + + + activemq-ra-3.1-SNAPSHOT.rar + }}} + 4. Create {{{META-INF/geronimo-application.xml}}}: - Note: this is an optional task. Indeed, Geronimo specific Deployment Descriptors are created on the fly if not present. The current implementation is really basic and not really useful “as is” for some J2EE components. Indeed, some logic needs to be added in order to infer the configuration of these Geronimo specific Deployment Descriptor (''e.g.'' JNDI name of an EJB, CMP mapping et cetera). - - Create {{{META-INF/openejb-jar.xml}}}: {{{ - + + + petstore-ejb.jar + petstore-ejb.xml + + + customer-ejb.jar + customer-ejb.xml + + + asyncsender-ejb.jar + asyncsender-ejb.xml + + + cart-ejb.jar + cart-ejb.xml + + + signon-ejb.jar + signon-ejb.xml + + + uidgen-ejb.jar + uidgen-ejb.xml + + + catalog-ejb.jar + catalog-ejb.xml + + + petstore.war + petstore.xml + + + geronimo-derby-connector-1.0-SNAPSHOT.rar + derby-connector.xml + + + activemq-ra-3.1-SNAPSHOT.rar + jms-connector.xml + + + }}} + Note: The file configures alternate Geronimo deployment descriptors so that we don't have to modify any jars. These deployment descriptors configure Geronimo resources which are mapped to the virtual ones defined in ejb-jar.xml's, e.g. JNDI name of an EJB, CMP mapping, etc. - + 5. Create {{{petstore-ejb.xml}}}: - - petstore/jars/servicelocator.jar - + {{{ + - + + + CatalogEJB + + jdbc/CatalogDB + DerbyDatasource + + + url/CatalogDAOSQLURL + http://localhost:8080/petstore/CatalogDAOSQL.xml + + + }}} + 6. Create {{{customer-ejb.xml}}}: - and add it to every EJB module: - - * asyncsender-ejb.jar - * cart-ejb.jar - * catalog-ejb.jar - * customer-ejb.jar - * petstore-ejb.jar - * signon-ejb.jar - * uidgen-ejb.jar - - using the following command: {{{ - jar -uvf META-INF/openejb-jar.xml + + + DerbyDatasource + + + + CustomerEJB + CUSTOMERS + + + userId + userId + + + + ProfileEJB + PROFILES + + id + java.lang.Integer + id + + + preferredLanguage + preferredLanguage + + + myListPreference + myListPreference + + + favoriteCategory + favoriteCategory + + + bannerPreference + bannerPreference + + id + + geronimo.server:J2EEServer=geronimo,J2EEApplication=petstore,J2EEModule=customer-ejb,j2eeType=PKGenerator,name=AutoEntityGenerator + java.lang.Integer + + + + CreditCardEJB + CREDITCARDS + + id + java.lang.Integer + id + + + cardType + cardType + + + expiryDate + expiryDate + + + cardNumber + cardNumber + + id + + geronimo.server:J2EEServer=geronimo,J2EEApplication=petstore,J2EEModule=customer-ejb,j2eeType=PKGenerator,name=AutoEntityGenerator + java.lang.Integer + + + + ContactInfoEJB + CONTACTINFOS + + id + java.lang.Integer + id + + + familyName + familyName + + + telephone + telephone + + + givenName + givenName + + + email + email + + id + + geronimo.server:J2EEServer=geronimo,J2EEApplication=petstore,J2EEModule=customer-ejb,j2eeType=PKGenerator,name=AutoEntityGenerator + java.lang.Integer + + + + AddressEJB + ADDRESSES + + id + java.lang.Integer + id + + + zipCode + zipCode + + + state + state + + + streetName2 + streetName2 + + + streetName1 + streetName1 + + + country + country + + + city + city + + id + + geronimo.server:J2EEServer=geronimo,J2EEApplication=petstore,J2EEModule=customer-ejb,j2eeType=PKGenerator,name=AutoEntityGenerator + java.lang.Integer + + + + AccountEJB + ACCOUNTS + + status + status + + status + + geronimo.server:J2EEServer=geronimo,J2EEApplication=petstore,J2EEModule=customer-ejb,j2eeType=PKGenerator,name=AutoEntityGenerator + java.lang.Integer + + + + + + CustomerEJBaccount + + CustomerEJB + + CustomerEJB + + + account + + + + userId + AF1 + + + + + + ContactInfoEJBaddress + + ContactInfoEJB + + ContactInfoEJB + + + address + + + + id + AF1 + + + + + + CustomerEJBprofile + + CustomerEJB + + CustomerEJB + + + profile + + + + userId + AF1 + + + + + + AccountEJBcontactInfo + + AccountEJB + + AccountEJB + + + contactInfo + + + + status + AF1 + + + + + + AccountEJBcreditCard + + AccountEJB + + AccountEJB + + + creditCard + + + + status + AF1 + + + + + + + + geronimo.server:JCAResource=geronimo-derby-connector-1.0-SNAPSHOT.rar,name=DerbyDatasource,J2EEServer=geronimo,J2EEApplication=petstore,j2eeType=JCAManagedConnectionFactory + + + insert into customer_ejb_sequence_table (dummy) values (1) + + + java.lang.Integer + + + }}} + 1. Create {{{asyncsender-ejb.xml}}}: - Once it's done, delete META-INF/openejb-jar.xml file. - - Change the value of tag in META-INF/ejb-jar.xml from ''False'' to ''false''. - - The affected files are: - - * customer-ejb.jar - * signon-ejb.jar - * uidgen-ejb.jar - - For each EJB jar listed above do the following: {{{ - jar -xf META-INF/ejb-jar.xml - ....edit META-INF/ejb-jar.xml.... - jar -uf META-INF/ejb-jar.xml + + + + AsyncSenderEJB + + jms/QueueConnectionFactory + QueueConnectionFactory + + + jms/AsyncSenderQueue + AsyncSenderQueue + + + + }}} + 1. Create {{{cart-ejb.xml}}}: - Note: this is an optional task as upon deployment this attribute is transparently upgraded. For the records, the supported values of the ''reentrant'' element was either ''True'' or ''False''. Since 2.1, these values must be either ''true'' or ''false''. - - Change the value of tag in META-INF/ejb-jar.xml from the empty string to a unique one within relationships. - - The affected files are: - - * customer-ejb.jar - - For each EJB jar listed above do the following: {{{ - jar -xf META-INF/ejb-jar.xml - ....edit META-INF/ejb-jar.xml.... - jar -uf META-INF/ejb-jar.xml + + + + CatalogEJB + + jdbc/CatalogDB + DerbyDatasource + + + url/CatalogDAOSQLURL + http://localhost:8080/petstore/CatalogDAOSQL.xml + + + + }}} + 1. Create {{{signon-ejb.xml}}}: - Change the position of tag in WEB-INF/web.xml so that it occurs between and . - - The affected files are: - - * petstore.war - - For each WAR listed above do the following: {{{ - jar -xf WEB-INF/web.xml - ....edit WEB-INF/web.xml.... - jar -uf WEB-INF/web.xml + + + DerbyDatasource + + + + UserEJB + USERS + + password + password + + + userName + userName + + + + }}} - The sample stanza looks like: + 1. Create {{{uidgen-ejb.xml}}}: {{{ - - param/CatalogDAODatabase - java.lang.String - cloudscape - - + + + DerbyDatasource + + + + CounterEJB + COUNTER + + + counter + COUNTER + + + name + NAME + + + + }}} - Note: this is an optional task as elements of Deployment Descriptors are transparently sorted upon deployment. This is part of the upgrade process from ''.dtd'' to ''.xsd''. + 1. Create {{{catalog-ejb.xml}}}: - Create {{{WEB-INF/geronimo-web.xml}}}: + {{{ + + + + CatalogEJB + + jdbc/CatalogDB + DerbyDatasource + + + url/CatalogDAOSQLURL + http://localhost:8080/petstore/CatalogDAOSQL.xml + + + + + }}} + + 1. Create {{{petstore.xml}}}: {{{ + - - - /petstore - false + false + + ShoppingControllerEJB + #ShoppingControllerEJB + + + jdbc/CatalogDB + DerbyDatasource + + + url/CatalogDAOSQLURL + http://localhost:8080/petstore/CatalogDAOSQL.xml + }}} - and add it to petstore.war using the following command: + 1. Create {{{derby-connector.xml}}}: {{{ - jar -uvf petstore.war WEB-INF/geronimo-web.xml + + + + + + javax.sql.DataSource + + DerbyDatasource + petstore + petstore + PetStoreDatabase + create + + + + + + 10 + 5000 + + + + + + + + }}} + 1. Create {{{jms-connector.xml}}}: - Once it's done, delete WEB-INF directory. - - Note: this is an optional task as a ''geronimo-web.xml'' DD is transparently created upon deployment. - - jar up /petstore/ear directory. {{{ - jar -cf ../petstore.ear * + + + + activemq/jars/activemq-core-3.1-SNAPSHOT.jar + + + + PetStore JMS Resources + tcp://localhost:61616 + geronimo + geronimo + + DefaultWorkManager + + + + + javax.jms.ConnectionFactory + + QueueConnectionFactory + javax.jms.QueueConnectionFactory + javax.jms.TopicConnectionFactory + + + + + + 10 + 5000 + + + + jms/ConnectionFactoryLocalTx + javax.resource.spi.security.PasswordCredential + + + + + + javax.jms.Queue + org.codehaus.activemq.message.ActiveMQQueue + + AsyncSenderQueue + AsyncSenderQueue + + + }}} + 1. Copy {{{GERONIMO_HOME\repository\activemq\rars\activemq-ra-3.1-SNAPSHOT.rar}}} into PETSTORE_HOME - Note: Geronimo supports deployment of unpacked J2EE modules. This is intended to remove the development overhead of packaging your modules. Actually, this is not an overhead "as such" as the task is pretty simple and not really time consuming. Having said that, the "ultimate" goal is to support development against unpacked module and especially "in place". - In the current case, you can unpack the ''ear'' and its nested modules. Then, you just have to update the ''application.xml'' file with the directory in which you have unpacked the nested modules. - 1. Go to the home directory of Geronimo (i.e. ''/geronimo/target/geronimo-1.0-SNAPSHOT'' assuming that as above it's decided to place Geronimo sources to /geronimo directory). + 1. Copy {{{GERONIMO_HOME\repository\geronimo\rars\geronimo-derby-connector-1.0-SNAPSHOT.rar}}} into PETSTORE_HOME + + 1. Deploy PETSTORE_HOME: java -jar bin/deployer.jar distribute PETSTORE_HOME {{{ - cd /geronimo/target/geronimo-1.0-SNAPSHOT + $ java -jar bin/deployer.jar distribute c\:/projs/petstore/porting/petstore + 22:19:45,148 INFO [LocalConfigStore:config-store/] Loaded Configuration geronimo.config:name="org/apache/geronimo/J2EEDeployer" + 22:19:45,829 INFO [Configuration] Started configuration org/apache/geronimo/J2EEDeployer + 22:19:46,149 INFO [SecurityServiceImpl] JACC factory registered + 22:19:48,703 INFO [LocalConfigStore:config-store/] Loaded Configuration geronimo.config:name="org/apache/geronimo/SystemDatabase" + 22:19:48,713 INFO [LocalConfigStore:config-store/] Loaded Configuration geronimo.config:name="org/apache/geronimo/Server" + 22:19:48,723 INFO [LocalConfigStore:config-store/] Loaded Configuration geronimo.config:name="org/apache/geronimo/System" + 22:19:48,803 INFO [Configuration] Started configuration org/apache/geronimo/System + 22:19:49,324 INFO [Configuration] Started configuration org/apache/geronimo/Server + 22:19:49,614 INFO [Configuration] Started configuration org/apache/geronimo/SystemDatabase + 22:19:55,002 INFO [Configuration] Stopping configuration org/apache/geronimo/SystemDatabase + 22:19:55,172 INFO [Configuration] Stopping configuration org/apache/geronimo/Server + 22:19:55,312 INFO [Configuration] Stopping configuration org/apache/geronimo/System + 22:19:55,913 INFO [LocalConfigStore:config-store/] Installed configuration petstore in location 92 + Distributed petstore + 22:19:55,923 INFO [Configuration] Stopping configuration org/apache/geronimo/J2EEDeployer + 22:19:56,134 INFO [Configuration] Stopping configuration org/apache/geronimo/DeployerSystem + 22:19:56,134 INFO [BasicKernel] Starting kernel shutdown + 22:19:56,134 INFO [BasicKernel] Kernel shutdown complete }}} - 2. Create ''repository/petstore/jars'' directory underneath the home directory of Geronimo and copy the ''servicelocator.jar'' jar to it. + 1. Run PetStore: java -jar bin/server.jar petstore {{{ - mkdir repository/petstore/jars - cp /petstore/ear/servicelocator.jar repository/petstore/jars + $ java -jar bin/server.jar petstore + 22:20:44,854 INFO [Daemon] Server startup begun + 22:20:44,864 INFO [Daemon] java.endorsed.dirs=c:\apps\j2sdk15\jre\lib\endorsed;C:\projs\geronimo\modules\assembly\target\geronimo-1.0-SNAPSHOT\lib\endorsed + 22:20:45,004 INFO [BasicKernel] Starting boot + 22:20:45,174 INFO [BasicKernel] Booted + 22:20:45,384 INFO [Configuration] Started configuration org/apache/geronimo/System + 22:20:45,495 INFO [ReadOnlyRepository] Repository root is file:/C:/projs/geronimo/modules/assembly/target/geronimo-1.0-SNAPSHOT/repository/ + 22:20:45,695 INFO [RMIRegistryService] Started RMI Registry on port 1099 + 22:20:45,725 INFO [LocalConfigStore:config-store] Loaded Configuration geronimo.config:name="petstore" + 22:20:45,785 INFO [LocalConfigStore:config-store] Loaded Configuration geronimo.config:name="org/apache/geronimo/SystemDatabase" + 22:20:45,795 INFO [LocalConfigStore:config-store] Loaded Configuration geronimo.config:name="org/apache/geronimo/Server" + 22:20:46,426 INFO [Configuration] Started configuration org/apache/geronimo/Server + 22:20:46,786 INFO [HttpServer] Statistics on = false for org.apache.geronimo.jetty.JettyServer@8dcd5d + 22:20:46,786 INFO [HttpServer] Version Jetty/5.1.4rc0 + 22:20:46,796 INFO [Container] Started org.apache.geronimo.jetty.JettyServer@8dcd5d + 22:20:46,857 INFO [SocketListener] Started SocketListener on 0.0.0.0:8080 + 22:20:46,927 INFO [SecurityServiceImpl] JACC factory registered + 22:20:47,037 INFO [HOWLLog] Initiating transaction manager recovery + 22:20:47,107 WARN [HOWLLog] Received unexpected log record: org.objectweb.howl.log.xa.XALogRecord@d0357a + 22:20:47,107 INFO [HOWLLog] In doubt transactions recovered from log + 22:20:47,127 INFO [GeronimoLoginConfiguration] Added Application Configuration Entry geronimo-properties-realm + 22:20:47,127 INFO [GeronimoLoginConfiguration] Added Application Configuration Entry JMX + 22:20:47,127 INFO [GeronimoLoginConfiguration] Installed Geronimo login configuration + 22:20:47,157 INFO [Credential] Checking Resource aliases + 22:20:47,578 INFO [SslListener] SslListener.needClientAuth=false + 22:20:47,578 INFO [SocketListener] Started SocketListener on 0.0.0.0:8443 + 22:20:47,758 INFO [server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=GBean,name=JMXService] Started JMXConnector s + ervice:jmx:rmi://localhost/jndi/rmi:/JMXConnector + 22:20:48,148 INFO [Configuration] Started configuration org/apache/geronimo/SystemDatabase + 22:20:48,789 INFO [DerbySystem] Started in C:\projs\geronimo\modules\assembly\target\geronimo-1.0-SNAPSHOT\var\derby + 22:20:50,632 INFO [DerbyNetwork] Started on host localhost:1527 + 22:20:52,735 INFO [Configuration] Started configuration petstore + 22:20:52,795 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=asyncsender-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeTyp + e=StatelessSessionBean,name=AsyncSenderEJB' started + 22:20:52,835 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=E + ntityBean,name=ProfileEJB' started + 22:20:53,236 INFO [Container] Started org.mortbay.jetty.servlet.WebApplicationHandler@1117681 + 22:20:53,236 INFO [/petstore] JSR154 unwrappedDispatchSupported=true + 22:20:53,236 INFO [JettyWebAppContext] JettyWebAppContext started + 22:20:53,236 INFO [Container] Started WebApplicationContext[/petstore,PetStoreWAR] + 22:20:53,366 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=CreditCardEJB' started + 22:20:53,426 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=AccountEJB' started + 22:20:53,446 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=petstore-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatefulSessionBean,name=ShoppingControllerEJB' started + 22:20:53,476 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=CustomerEJB' started + 22:20:53,546 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=AddressEJB' started + 22:20:53,566 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=petstore-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatefulSessionBean,name=ShoppingClientFacadeEJB' started + 22:20:53,626 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=catalog-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=CatalogEJB' started + 22:20:53,646 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=uidgen-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=UniqueIdGeneratorEJB' started + 22:20:53,666 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=signon-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=SignOnEJB' started + 22:20:53,696 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=signon-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=UserEJB' started + 22:20:54,087 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=cart-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatefulSessionBean,name=ShoppingCartEJB' started + 22:20:54,287 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=uidgen-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=CounterEJB' started + 22:20:54,327 INFO [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=ContactInfoEJB' started + 22:20:54,397 INFO [Daemon] Server startup completed }}} + 1. Connect to Derby database (via Network Server) and execute the DDLs: - 3. Run the deploy tool (i.e. a executable jar) - - NOTE: It's done on Cygwin mounted directory /petstore so replace the magical {{{cygpath --windows /petstore/petstore.ear}}} with the path to where PetStore is. {{{ - java -jar bin/deployer.jar --install --module `cygpath --windows /petstore/petstore.ear` + > java -cp derbytools-10.0.2.1.jar;db2jcc.jar;db2jcc_license_c.jar -Dij.driver=com.ibm.db2.jcc.DB2Driver -Dij.user=petstore -Dij.password=petstore -Dij.protocol=jdbc:derby:net://localhost:1527/ org.apache.derby.tools.ij + ij version 10.0 + ij> connect 'PetStoreDatabase;create=true'; + ij> create table USERS (password varchar(255), userName varchar(255)); + ij> create table CUSTOMER_EJB_SEQUENCE_TABLE (ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), dummy integer); + ij> create table ADDRESSES (id integer, zipCode varchar(255), state varchar(255), streetName2 varchar(255), streetName1 varchar(255), country varchar(255), city varchar(255)); }}} + 1. Point the browser of your choice to http://localhost:8080/petstore/ and select any URL - it will start the process of populating the database. - That's where our story ends up with the fancy NullPointerException (does anyone volunteer to get rid of it? :)): - - {{{ - $ java -jar bin/deployer.jar --install --module `cygpath --windows /petstore/petstore.ear` - java.lang.NullPointerException - at org.openejb.deployment.OpenEJBModuleBuilder.buildCMPSchema(OpenEJBModuleBuilder.java:613) - at org.openejb.deployment.OpenEJBModuleBuilder.addGBeans(OpenEJBModuleBuilder.java:498) - at org.openejb.deployment.OpenEJBModuleBuilder$$FastClassByCGLIB$$11bd7b20.invoke() - at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87) - at org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvoker.java:38) - at org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOperation.java:142) - at org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:744) - at org.apache.geronimo.gbean.jmx.RawInvoker.invoke(RawInvoker.java:89) - at org.apache.geronimo.gbean.jmx.RawOperationInvoker.invoke(RawOperationInvoker.java:34) - at org.apache.geronimo.gbean.jmx.CGLibMethodInterceptor.intercept(CGLibMethodInterceptor.java:111) - at org.apache.geronimo.j2ee.deployment.ModuleBuilder$$EnhancerByCGLIB$$9e45a280.addGBeans() - at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:407) - at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:312) - at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:236) - at org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLIB$$38e56ec6.invoke() - at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87) - at org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvoker.java:38) - at org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOperation.java:142) - at org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:744) - at org.apache.geronimo.gbean.jmx.RawInvoker.invoke(RawInvoker.java:89) - at org.apache.geronimo.gbean.jmx.RawOperationInvoker.invoke(RawOperationInvoker.java:34) - at org.apache.geronimo.gbean.jmx.CGLibMethodInterceptor.intercept(CGLibMethodInterceptor.java:111) - at org.apache.geronimo.deployment.ConfigurationBuilder$$EnhancerByCGLIB$$7a1ca0ae.buildConfiguration( - ) - at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:198) - at org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.invoke() - at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:87) - at org.apache.geronimo.gbean.jmx.FastMethodInvoker.invoke(FastMethodInvoker.java:38) - at org.apache.geronimo.gbean.jmx.GBeanMBeanOperation.invoke(GBeanMBeanOperation.java:142) - at org.apache.geronimo.gbean.jmx.GBeanMBean.invoke(GBeanMBean.java:765) - at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerMBeanServerInterceptor.java:218) - at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:121) - at mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(SecurityMBeanServerInterceptor.java:86) - at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:121) - at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:121) - at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invoke(ContextClassLoaderMBeanServerIntercep - tor.java:205) - 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 =