1 Reply Latest reply on Apr 16, 2007 5:42 AM by jaikiran pai

    problem with JNDI Lookup for Entity beans

    prakash Dumbre Newbie

      I am migrating our application from Weblogic 7.0 to JBoss 4.0.5. I have succesefully Deployed our ear file after changing all xml files on JBoss. But now i am facing problem regarding to ejb JNDI lookup


      16:20:44,347 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'BusinessSKUEntity' to jndi 'local/BusinessSKUEntity@23128226'

      In this case application server takes 'local/BusinessSKUEntity@23128226' as JNDI name.

      How it takes that name? and each time '@23128226' value has been chenged.

      I am confused how should I lookup?

      when I am accessing other pages that time above error occures

      Following are the xml descriptor for BusinessSKUEntity entity bean

      jboss.xml


      <ejb-name>BusinessSKUEntity</ejb-name>
      <ejb-ref-name>BusinessSKUEntity</ejb-ref-name>
      <local-jndi-name>BusinessSKUEntity</local-jndi-name>

      <entity-descriptor>



      <entity-cache>
      <max-beans-in-cache>4000</max-beans-in-cache>
      <idle-timeout-seconds>600</idle-timeout-seconds>
      <concurrency-strategy>Readonly</concurrency-strategy>
      <cache-between-transactions>False</cache-between-transactions>
      </entity-cache>


      <is-modified-method-name>isModified</is-modified-method-name>
      <delay-updates-until-end-of-tx>False</delay-updates-until-end-of-tx>
      <persistence-use>
      <type-identifier>JBoss_CMP_RDBMS</type-identifier>
      <type-version>4.0.5</type-version>
      <type-storage>META-INF/jbosscmp-jdbc.xml</type-storage>
      </persistence-use>



      <entity-clustering>
      </entity-clustering>

      </entity-descriptor>

      <transaction-descriptor>
      </transaction-descriptor>

      <reference-descriptor>
      </reference-descriptor>





      ejb-jar.xml




      <![CDATA[This bean represent one business specific product]]>

      <ejb-name>BusinessSKUEntity</ejb-name>
      <local-home>com.xxxx.server.product.ejb.BusinessSKUEntityHome</local-home>
      com.xxxx.server.product.ejb.BusinessSKUEntity
      <ejb-class>com.xxxxx.server.product.ejb.BusinessSKUEntityEJB</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>com.xxxxx.server.product.ejb.BusinessSKUEntityPK</prim-key-class>
      False
      <abstract-schema-name>BusinessSKUEntity</abstract-schema-name>
      <cmp-field>
      <field-name>businessskuid</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>owningbusinessid</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>ownersku</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>ownerskudescription</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>department</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>description</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>baseprice</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>marginpercentage</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>wholesalediscountpctg</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>minimumspreadpctg</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>weight</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>totalexcessinvforavail</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>skusetid</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>markdownlevel</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>createddate</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>createdby</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>modifieddate</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>modifiedby</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>preorder</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>instoredate</field-name>
      </cmp-field>

      <ejb-local-ref id="EJBLocalRef_1040043976657">
      Local Ref for BusinessSKUEntity
      <ejb-ref-name>BusinessSKUEntity</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.xxxxx.server.product.ejb.BusinessSKUEntityHome</local-home>
      com.xxxxx.server.product.ejb.BusinessSKUEntity
      <ejb-link>BusinessSKUEntity</ejb-link>
      </ejb-local-ref>




      <query-method>
      <method-name>findByBusinessAndBusinessSKUID</method-name>
      <method-params>
      <method-param>int</method-param>
      <method-param>int</method-param>
      </method-params>

      </query-method>

      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM BusinessSKUEntity o WHERE ((o.owningbusinessid = ?1) AND (o.businessskuid = ?2))]]></ejb-ql>


      <query-method>
      <method-name>findByBusinessAndOwnerSKU</method-name>
      <method-params>
      <method-param>int</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>

      </query-method>

      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM BusinessSKUEntity o WHERE ((o.owningbusinessid = ?1) AND (o.ownersku = ?2))]]></ejb-ql>




      <assembly-descriptor>
      <method-permission>



      <![CDATA[This entity bean represent a row in the database for the table CederaSKU]]>
      <ejb-name>BusinessSKUEntity</ejb-name>
      <method-name>*</method-name>


      <ejb-name>BusinessSKUEntity</ejb-name>
      <!-- method-intf>Local</method-intf -->
      <method-name>*</method-name>


      <ejb-name>BusinessSKUEntity</ejb-name>
      <!-- method-intf>LocalHome</method-intf -->
      <method-name>*</method-name>




      <ejb-name>ProductService</ejb-name>
      <method-intf>Remote</method-intf>
      <method-name>*</method-name>


      </method-permission>
      <container-transaction>

      <ejb-name>BusinessSKUEntity</ejb-name>
      <!-- method-intf>LocalHome</method-intf -->
      <method-name>*</method-name>


      <ejb-name>BusinessSKUEntity</ejb-name>
      <!-- method-intf>Local</method-intf -->
      <method-name>*</method-name>

      </container-transaction>
      </assembly-descriptor>


      jbosscmp.xml

      <jbosscmp-jdbc>

      <enterprise-beans>



      <ejb-name>BusinessSKUEntity</ejb-name>


      java:/orderPool
      <datasource-mapping>Oracle9i</datasource-mapping>

      <table-name>BusinessSKU</table-name>
      <cmp-field>
      <field-name>businessskuid</field-name>
      <column-name>BUSINESSSKUID</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>owningbusinessid</field-name>
      <column-name>OWNINGBUSINESSID</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>ownersku</field-name>
      <column-name>OWNERSKU</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>department</field-name>
      <column-name>DEPARTMENT</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>description</field-name>
      <column-name>DESCRIPTION</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>ownerskudescription</field-name>
      <column-name>OWNERSKUDESCRIPTION</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>baseprice</field-name>
      <column-name>BASEPRICE</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>marginpercentage</field-name>
      <column-name>MARGINPERCENTAGE</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>wholesalediscountpctg</field-name>
      <column-name>WHOLESALEDISCOUNTPCTG</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>minimumspreadpctg</field-name>
      <column-name>MINIMUMSPREADPCTG</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>weight</field-name>
      <column-name>WEIGHT</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>totalexcessinvforavail</field-name>
      <column-name>TOTALEXCESSINVFORAVAIL</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>skusetid</field-name>
      <column-name>SKUSETID</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>markdownlevel</field-name>
      <column-name>MARKDOWNLEVEL</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>createddate</field-name>
      <column-name>CREATEDDATE</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>createdby</field-name>
      <column-name>CREATEDBY</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>modifieddate</field-name>
      <column-name>MODIFIEDDATE</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>modifiedby</field-name>
      <column-name>MODIFIEDBY</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>preorder</field-name>
      <column-name>PREORDER</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>instoredate</field-name>
      <column-name>INSTOREDATE</column-name>
      </cmp-field>


      <!-- <optimistic-column>MODIFIEDDATE</optimistic-column> -->

      </enterprise-beans>


      </jbosscmp-jdbc>