This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Err while trying to lookup ejb2 enity bean on was7 Naming Name comp/env/ejb not found context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Err while trying to lookup ejb2 enity bean on was7 Naming Name comp/env/ejb not found context "java"" Watch "Err while trying to lookup ejb2 enity bean on was7 Naming Name comp/env/ejb not found context "java"" New topic
Author

Err while trying to lookup ejb2 enity bean on was7 Naming Name comp/env/ejb not found context "java"

SavitaSingh Raghuvanshi
Greenhorn

Joined: Feb 18, 2010
Posts: 2
Getting error while trying to lookup ejb2 enity bean on was7 Naming Name comp/env/ejb not found in context "java:",

[6/16/13 23:51:45:442 IST] 00000058 SystemOut O [wb][EntityBeanLocator][06/16 23:51:45.442][ERROR][Severity 2] [ADMINIB-NKJC3I8] lookup(entityKeyName, expectedClass) - Naming Name comp/env/ejb not found in context "java:".
[6/16/13 23:51:45:442 IST] 00000058 SystemOut O [wb][TransactionScheduleBean][06/16 23:51:45.442][FATAL][Severity 1] [ADMINIB-NKJC3I8] Fatal Error occured in storeXMLInDB(String messageType, String bodId, String mqMessageId, String xml, String updatedByjavax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:".
financing.tools.hub.shared.exception.R2FException: javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:".
at financing.tools.hub.wb.process.ejb.EntityBeanLocator.lookup(EntityBeanLocator.java:371)
at financing.tools.hub.wb.process.ejb.EntityBeanLocator.getXmlRepositoryLocalHome(EntityBeanLocator.java:869)
at financing.tools.hub.wb.contract.ejb.TransactionScheduleBean.updateDB(TransactionScheduleBean.java:388)
at

Ejb-jar.xml:

<entity id="XmlRepository">
<ejb-name>XmlRepository</ejb-name>
<local-home>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryLocalHome</local-home>
<local>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryLocal</local>
<ejb-class>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryKey</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>XmlRepository</abstract-schema-name>
<cmp-field id="CMPAttribute_1277976775421">
<field-name>xmlId</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1277976775656">
<field-name>component</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1277976775687">
<field-name>type</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1277976775703">
<field-name>bodId</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1277976775734">
<field-name>mqMessageId</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1277976775781">
<field-name>lastUpdated</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1277976775812">
<field-name>updatedBy</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1282312289968">
<field-name>xml</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1285821728199">
<field-name>errorInd</field-name>
</cmp-field>
<ejb-local-ref id="EJBLocalRef_1371376427429">
<description>
</description>
<ejb-ref-name>ejb/financing/tools/hub/wb/domain/pricing/ejb/XmlRepositoryLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryLocalHome</local-home>
<local>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryLocal</local>
<ejb-link>XmlRepository</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1371376427429">
<description>
</description>
<ejb-ref-name>ejb/financing/tools/hub/wb/domain/pricing/ejb/XmlRepositoryLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryLocalHome</local-home>
<local>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryLocal</local>
<ejb-link>XmlRepository</ejb-link>
</ejb-local-ref>

<ejb-local-ref id="EJBLocalRef_1282226295671">
<ejb-ref-name>ejb/financing/tools/hub/wb/domain/pricing/ejb/XmlRepositoryLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryLocalHome</local-home>
<local>financing.tools.hub.wb.domain.pricing.ejb.XmlRepositoryLocal</local>
<ejb-link>XmlRepository</ejb-link>
</ejb-local-ref>

ibm-ejb-jar.xml :

<ejbRefBindings xmi:id="EjbRefBinding_1280490665812" jndiName="ejb/financing/tools/hub/wb/domain/pricing/ejb/XmlRepositoryLocalHome">
<bindingEjbRef xmi:type="common:EJBLocalRef" href="META-INF/ejb-jar.xml#EJBLocalRef_1280490665812"/>
</ejbRefBindings>

Way to access :
public XmlRepositoryLocalHome getXmlRepositoryLocalHome()
throws R2FException {
if (xmlRepositoryLocalHome == null) {
xmlRepositoryLocalHome = (XmlRepositoryLocalHome) lookup("java:comp/env/ejb/financing/tools/hub/wb/domain/pricing/ejb/XmlRepositoryLocalHome",
XmlRepositoryLocalHome.class);
}

return xmlRepositoryLocalHome;
}

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Err while trying to lookup ejb2 enity bean on was7 Naming Name comp/env/ejb not found context "java"
 
jQuery in Action, 3rd edition