You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Rajesh Ravindran <ra...@gmail.com> on 2004/09/24 17:20:42 UTC

To get Petstore 1.1.2 work on geronimo

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,ProductItemListTag.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.PropertiesFileGroupPrincipal: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

Re: To get Petstore 1.1.2 work on geronimo

Posted by David Blevins <da...@visi.com>.
Wow, that's great.

As a note, we shouldn't need the ejb-link section anymore as Geronimo
will try and match the home and remote interfaces up with an ejb
defined in the jar.  This works fine unless there are two or more ejbs
sharing the same interfaces.

-David

On Sun, Oct 24, 2004 at 10:13:34PM +0200, Ralf Barkow wrote:
>    
> http://wiki.apache.org/geronimo/PetStore?action=show#head-5dccd7b12f31853601d41c6451e8c8ec11e0ae75
> 
> David Blevins wrote:
> 
> >Thanks for such a detailed post!  Maybe we should throw this into the
> >wiki and invite others to try it out and update it with their own
> >comments.
> >
> >We need more people like you, Rajesh.  Great job.
> >
> >-David
> >

Re: To get Petstore 1.1.2 work on geronimo

Posted by Ralf Barkow <rg...@tiscali.de>.
    
http://wiki.apache.org/geronimo/PetStore?action=show#head-5dccd7b12f31853601d41c6451e8c8ec11e0ae75

David Blevins wrote:

>Thanks for such a detailed post!  Maybe we should throw this into the
>wiki and invite others to try it out and update it with their own
>comments.
>
>We need more people like you, Rajesh.  Great job.
>
>-David
>


Re: To get Petstore 1.1.2 work on geronimo

Posted by David Blevins <da...@visi.com>.
Thanks for such a detailed post!  Maybe we should throw this into the
wiki and invite others to try it out and update it with their own
comments.

We need more people like you, Rajesh.  Great job.

-David


On Fri, Sep 24, 2004 at 08:50:42PM +0530, 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,ProductItemListTag.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.PropertiesFileGroupPrincipal: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

Re: To get Petstore 1.1.2 work on geronimo

Posted by Dain Sundstrom <ds...@gluecode.com>.
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
>


Re: To get Petstore 1.1.2 work on geronimo

Posted by Dain Sundstrom <ds...@gluecode.com>.
Wow Great Job!

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,Pr 
> oductItemListTag.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.PropertiesFileGroupPrinci 
> pal: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