geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Geronimo Wiki] Update of "PetStore" by JacekLaskowski
Date Sat, 09 Jul 2005 16:10:56 GMT
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:
PetStore in sandbox - update the instructions

------------------------------------------------------------------------------
  
  == Prerequisites ==
  
-  * Geronimo build 208887 or later (these directions will not work for Milestone 3 or earlier)
+  * Geronimo build 209954 or later (these directions will not work for Milestone 3 or earlier)
  
   * [wiki:BuildingAndRunning Build Apache Geronimo]
  
@@ -28, +28 @@

  == Deploying PetStore ==
  
   {{{
- It's still a work in progress - current issue: javax.ejb.NoSuchObjectLocalException when
setting a value of a CMP field
+ It's still a work in progress - current issue: Element not allowed: key-generator@http://www.openejb.org/xml/ns/openejb-jar
in element entity@http://www.openejb.org/xml/ns/openejb-jar
  }}}
  
  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.
@@ -37, +37 @@

  
  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.
  
- NOTE: Commands are MS Windows specific - Linux version is on its way.
- 
  Throughout the document the following variables are assumed to be set:
  
-  * GERONIMO_HOME - the directory where Geronimo is installed or built, e.g. C:\projs\geronimo\modules\assembly\target\geronimo-1.0-SNAPSHOT
-  * PETSTORE_EAR - the directory where petstore.ear is unpacked, e.g. C:\projs\petstore\porting\petstore
+  * PETSTORE_HOME - the directory where PetStore is installed, e.g. C:\projs\petstore
-  * PETSTORE_PLAN - the plan of PetStore EAR application (it's created during the deployment
process, see below)
  
-  1. Unpack petstore.ear (one of the files that constitute the application) to a directory
PETSTORE_EAR. 
+  1. Set the {{{petstore.ear.path}}} variable to PETSTORE_HOME\petstore.ear
  
+  1. Run {{{maven -u}}} to get familiar with the available commands
-  1. Change the current working directory to PETSTORE_EAR.
- 
-  1. Edit {{{META-INF/ejb-jar}}} of (TODO: add more information)
- 
-  NOTE: Caused by: org.apache.xmlbeans.XmlException: Invalid deployment descriptor: [error:
Duplicate key '' for key or unique constraint relationship-name-uniqueness@http://java.sun.com/xml/ns/j2ee]
- 
-  1. Edit {{{META-INF/application.xml}}} so that it looks like this:
  
   {{{
+ ...
+ [petstore]                          ( NO DEFAULT GOAL )
+   deploy  ......................... Deploys PetStore
+   initdb  ......................... Initializes database
+   start  .......................... Starts PetStore
+   stop  ........................... Stops PetStore
+ ...
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN'
'http://java.sun.com/dtd/application_1_3.dtd'>
- <application>
-   <display-name>PetStoreEAR</display-name>
-   <description>The BluePrints Petstore Built On top of the Web Application Framework.</description>
-   <module>
-     <ejb>petstore-ejb.jar</ejb>
-   </module>
-   <module>
-     <ejb>customer-ejb.jar</ejb>
-   </module>
-   <module>
-     <ejb>asyncsender-ejb.jar</ejb>
-   </module>
-   <module>
-     <ejb>cart-ejb.jar</ejb>
-   </module>
-   <module>
-     <ejb>signon-ejb.jar</ejb>
-   </module>
-   <module>
-     <ejb>uidgen-ejb.jar</ejb>
-   </module>
-   <module>
-     <ejb>catalog-ejb.jar</ejb>
-   </module>
-   <module>
-     <web>
-       <web-uri>petstore.war</web-uri>
-       <context-root>petstore</context-root>
-     </web>
-   </module>
-   <module>
-     <connector>geronimo-derby-connector-1.0-SNAPSHOT.rar</connector>
-   </module>
-   <module>
-     <connector>activemq-ra-3.1-SNAPSHOT.rar</connector>
-   </module>
- </application>
  }}}
  
+  1. Run {{{maven -o petstore:deploy petstore:start petstore:initdb}}}
-  1. Create {{{petstore-plan.xml}}} (Wiki doesn't like such huge XML files, so it's to be
added to Geronimo repository)
- 
-  1. Copy {{{GERONIMO_HOME\repository\activemq\rars\activemq-ra-3.1-SNAPSHOT.rar}}} into
PETSTORE_EAR
- 
-  1. Copy {{{GERONIMO_HOME\repository\geronimo\rars\geronimo-derby-connector-1.0-SNAPSHOT.rar}}}
into PETSTORE_EAR
- 
-  1. Deploy PETSTORE_EAR
- 
-  {{{
- $ java -jar bin/deployer.jar --user system --password manager distribute PETSTORE_EAR PETSTORE_PLAN
- 23:24:59,493 INFO  [LocalConfigStore:config-store/] Loaded Configuration geronimo.config:name="org/apache/geronimo/J2EEDeployer"
- 23:25:00,325 INFO  [Configuration] Started configuration org/apache/geronimo/J2EEDeployer
- 23:25:00,655 INFO  [SecurityServiceImpl] JACC factory registered
- 23:25:03,429 INFO  [LocalConfigStore:config-store/] Loaded Configuration geronimo.config:name="org/apache/geronimo/SystemDatabase"
- 23:25:03,439 INFO  [LocalConfigStore:config-store/] Loaded Configuration geronimo.config:name="org/apache/geronimo/Server"
- 23:25:03,449 INFO  [LocalConfigStore:config-store/] Loaded Configuration geronimo.config:name="org/apache/geronimo/System"
- 23:25:03,539 INFO  [Configuration] Started configuration org/apache/geronimo/System
- 23:25:04,391 INFO  [Configuration] Started configuration org/apache/geronimo/Server
- 23:25:04,621 INFO  [Configuration] Started configuration org/apache/geronimo/SystemDatabase
- 23:25:10,309 INFO  [Configuration] Stopping configuration org/apache/geronimo/SystemDatabase
- 23:25:10,419 INFO  [Configuration] Stopping configuration org/apache/geronimo/Server
- 23:25:10,700 INFO  [Configuration] Stopping configuration org/apache/geronimo/System
- 23:25:11,080 INFO  [LocalConfigStore:config-store/] Installed configuration petstore in
location 25
- Distributed petstore
- 23:25:11,090 INFO  [Configuration] Stopping configuration org/apache/geronimo/J2EEDeployer
- 23:25:11,140 INFO  [Configuration] Stopping configuration org/apache/geronimo/DeployerSystem
- 23:25:11,150 INFO  [BasicKernel] Starting kernel shutdown
- 23:25:11,150 INFO  [BasicKernel] Kernel shutdown complete
- }}}
- 
-  1. Run PetStore: java -jar bin/server.jar -v petstore
- 
-  {{{
- $ java -jar bin/server.jar -v petstore
- Booting Geronimo Kernel (in Java 1.4.2_08)...
- 23:27:49,218 INFO  [Daemon] Server startup begun
- 23:27:49,458 INFO  [MBeanServerFactory] Created MBeanServer with ID: 1479feb:104f3327daa:-8000:xxx:1
- 23:27:49,468 INFO  [BasicKernel] Starting boot
- 23:27:49,648 INFO  [BasicKernel] Booted
- 23:27:49,828 INFO  [Configuration] Started configuration org/apache/geronimo/System
- 23:27:49,939 INFO  [ReadOnlyRepository] Repository root is file:/C:/projs/geronimo/modules/assembly/target/geronimo-1.0-SNAPSHOT/repository/
- 23:27:50,179 INFO  [RMIRegistryService] Started RMI Registry on port 1099
- 23:27:50,209 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo.config:name="petstore"
- 23:27:50,219 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo.config:name="org/apache/geronimo/SystemDatabase"
- 23:27:50,229 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo.config:name="org/apache/geronimo/Server"
- 23:27:50,940 INFO  [Configuration] Started configuration org/apache/geronimo/Server
- 23:27:51,331 INFO  [HttpServer] Statistics on = false for org.apache.geronimo.jetty.JettyServer@1add463
- 23:27:51,331 INFO  [HttpServer] Version Jetty/5.1.4rc0
- 23:27:51,331 INFO  [Container] Started org.apache.geronimo.jetty.JettyServer@1add463
- 23:27:51,451 INFO  [SocketListener] Started SocketListener on 0.0.0.0:8080
- 23:27:51,491 INFO  [SecurityServiceImpl] JACC factory registered
- 23:27:51,531 INFO  [HOWLLog] Initiating transaction manager recovery
- 23:27:51,631 INFO  [HOWLLog] In doubt transactions recovered from log
- 23:27:51,651 INFO  [GeronimoLoginConfiguration] Added Application Configuration Entry geronimo-properties-realm
- 23:27:51,651 INFO  [GeronimoLoginConfiguration] Added Application Configuration Entry JMX
- 23:27:51,691 INFO  [GeronimoLoginConfiguration] Installed Geronimo login configuration
- 23:27:51,891 INFO  [Credential] Checking Resource aliases
- 23:27:52,292 INFO  [SslListener] SslListener.needClientAuth=false
- 23:27:52,292 INFO  [SocketListener] Started SocketListener on 0.0.0.0:8443
- 23:27:52,582 INFO  [RMIConnectorServer] RMIConnectorServer started at: service:jmx:rmi://localhost/jndi/rmi:/JMXConnector
- 23:27:52,582 INFO  [server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=GBean,name=JMXService]
Started JMXConnector service:jmx:rmi://localhost/jndi/rmi:/JMXConnector
- 23:27:52,993 INFO  [Configuration] Started configuration org/apache/geronimo/SystemDatabase
- 23:27:54,075 INFO  [DerbySystem] Started in C:\projs\geronimo\modules\assembly\target\geronimo-1.0-SNAPSHOT\var\derby
- 23:27:56,328 INFO  [DerbyNetwork] Started on host localhost:1527
- 23:27:58,381 INFO  [Configuration] Started configuration petstore
- 23:27:58,441 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=asyncsender-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=AsyncSenderEJB'
started
- 23:27:58,481 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=ProfileEJB'
started
- 23:27:58,751 INFO  [Container] Started org.mortbay.jetty.servlet.WebApplicationHandler@1444986
- 23:27:58,751 INFO  [/petstore] JSR154 unwrappedDispatchSupported=true
- 23:27:58,751 INFO  [JettyWebAppContext] JettyWebAppContext started
- 23:27:58,751 INFO  [Container] Started WebApplicationContext[/petstore,PetStoreWAR]
- 23:27:58,881 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=CreditCardEJB'
started
- 23:27:58,911 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=AccountEJB'
started
- 23:27:58,942 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=petstore-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatefulSessionBean,name=ShoppingControllerEJB'
started
- 23:27:58,962 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=CustomerEJB'
started
- 23:27:59,062 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=AddressEJB'
started
- 23:27:59,082 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=petstore-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatefulSessionBean,name=ShoppingClientFacadeEJB'
started
- 23:27:59,142 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=catalog-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=CatalogEJB'
started
- 23:27:59,152 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=uidgen-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=UniqueIdGeneratorEJB'
started
- 23:27:59,172 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=signon-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=SignOnEJB'
started
- 23:27:59,202 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=signon-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=UserEJB'
started
- 23:27:59,602 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=cart-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=StatefulSessionBean,name=ShoppingCartEJB'
started
- 23:28:00,053 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=uidgen-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=CounterEJB'
started
- 23:28:00,083 INFO  [GenericEJBContainer] GenericEJBContainer 'geronimo.server:EJBModule=customer-ejb.jar,J2EEApplication=petstore,J2EEServer=geronimo,j2eeType=EntityBean,name=ContactInfoEJB'
started
- Geronimo startup complete
- 23:28:00,364 INFO  [Daemon] Server startup completed
- }}}
- 
-  1. Connect to Derby database (via Network Server) and execute the DDLs:
- 
-  {{{
- > 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 NOT NULL, zipCode varchar(255), state varchar(255),
streetName2 varchar(255), streetName1 varchar(255), country varchar(255), city varchar(255));
- ij> disconnect;
- ij> exit;
- }}}
  
   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.
  
   1. To be continued...
  
- = Getting Petstore 1.1.2 to work on Apache Geronimo =
+ = Deploying Java Pet Store Sample Application 1.1.2 =
  
  This section is based on Rajesh Ravindran's post to user@geronimo.apache.org on 2004-09-24:
- 
- 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

Mime
View raw message