File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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;
}

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Err while trying to lookup ejb2 enity bean on was7 Naming Name comp/env/ejb not found context "java"
 
Similar Threads
Local Lookup Problem in WSAD!!
Error looking up EJB LocalHome (in web.xml)
"comp/env/ejb/DcOtherInStateBenefitsSessionEJB" not found in context "java:"
JNDI lookup problem with ejb local interfaces
New to EJB, advice please