Running PetStore 1.3 on JBoss 3.0
ehenne Dec 4, 2002 1:18 PMTo learn more about EJB and JBoss I decided to try to run Petstore on JBoss with Oracle as database. As it turned out this is not an easy undertaking as Petstore 1.3 uses some features which are not yet available in JBoss 3.0 (e.g. unknown foreign keys, deployment descriptors for submodules on ear-level). But solving all those problems resulted in a lot of experience and that was just what I wanted to get out this experiment.
In this topic I will try to share my results in small steps:
I am using Wnidows NT 4.0, PetStore 1_3_01, JBoss 3.0.2 and Ant 1.5.1.
1) Building PetStore
PetStore consists of 4 applications:
petstore.ear
petstoreadmin.ear
opc.ear
supplier.ear
To build all of them run <petstore-home>\src\build.bat but for starting it is much better to concentrate on the store core which is in petstore.ear. This can be build with <petstore-home>\src\apps\petstore\src\build.bat. The result will be created in <petstore-home>\src\apps\petstorebuild\petstore.ear and it can now be deployed to JBoss by copying it into <jboss-home>\server\default\deploy.
2) Relationship names
This will generate the jboss error: ejb-relation-name must be unique in ejb-jar.xml file
Because petstore.ear (open it with WinZip) contains a lot of submodules (components) which all have ejb-jar.xml files it is not clear from the error message which one must be changed. But by looking at the JBoss logfile <jboss-home>\server\default\log\server.log you can see that the last opened module is petstore.ear-contents/customer-ejb.jar.
The corresponding source file is <petstore-home>\src\components\customer\src\ejb-jar.xml and there we find several empty relationship names "<ejb-relation-name></ejb-relation-name>". We must give them unique names, e.g. "<ejb-relation-name>RelCustomerEJBAccountEJB</ejb-relation-name>".
Rebuilding petstore and deploying it will now end up in a first successful deployment. You can now already access the petstore start page on http://localhost:8080/petstore/
But there are several new errors on the log and you cannot yet enter the store. I will talk about this in my next post.