Rajesh,
I just committed a new ejb-ref matcher that will look for a single ejb with the specified home and remote interface. Can you check if petstore can without the added ejb-links?
Thanks,
-dain
On Sep 24, 2004, at 12:08 PM, Dain Sundstrom wrote:
For this one:
<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>
I will look at adding another ejb-ref matcher that checks for an ejb in the same ear with matching home and remote interfaces. Don't expect it right away but I'll add it to my todo list.
-dain
-- Dain Sundstrom Chief Architect Gluecode Software 310.536.8355, ext. 26
On Sep 24, 2004, at 8:20 AM, Rajesh Ravindran wrote:
Hi all,
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.
1. 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>
2. 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"/>
3. 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,P roductItemListTag.java,
MyListTag.java
4. 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.
5. 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.PropertiesFileGroupPrinc ipal:admin]</env-entry-value>
<!-changed the value from jsp_admin to the whole nested name of
the principal-->
This is the list, in case I ve forgotten something, I ll post it soon.
Thanks Rajesh Ravindran
