Radhakrishnan Iyyengar

Greenhorn
+ Follow
since Jul 02, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Radhakrishnan Iyyengar

Jason: profile updated per instructions.

I am getting a naming exception:

java.lang.Exception: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException

Object not found in lookup, the entire lookup is ejb/facade.

The problem persists even with lookups that specify java:comp/env/ejb/facade or java:/ejb/facade.

The problem goes away if I use the runtime JNDI assigned by the server from NetWeaver's visual admin tool.

My questions are:

1. If I add the target bean to web.xml, can I still not use the reference name to lookup the object from the struts controller (actionclass)?

2. If not, the java:comp/env/ lookup cannot ever be used from a struts controller? I will have to stick with the runtime JNDI assignment made by the EJB container to the bean? This would cause obvious problems since the JNDI has to be hard-coded within the actionclass, not to mention maintenance if my application has to be ported on a different app server.

Roger: I have not passed initialcontext() parameters, but I can access the facade bean using direct JNDI lookup.

Any insights/corrections will be appreciated.
[ July 04, 2005: Message edited by: Radhakrishnan Iyyengar ]
15 years ago
Hello folks,

I am new to the Struts framework. I am facing a vexing problem - I am unable to access my session facade bean from the action class. The relevant portions of the xmls are attached below:

ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">;
<ejb-jar>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>SessionFacadeBean</ejb-name>
<home>licenseModule.SessionFacadeHome</home>
<remote>licenseModule.SessionFacade</remote>
<ejb-class>licenseModule.SessionFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/declarationBean</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>licenseModule.LicenseDeclarationBMPLocalHome</local-home>
<local>licenseModule.LicenseDeclarationBMPLocal</local>
<ejb-link>LicenseDeclarationBMPBean</ejb-link>
</ejb-local-ref>
</session>
</enterprise-beans>
</ejb-jar>


ejb-j2ee-engine.jar
ejb-j2ee-engine.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
<ejb-j2ee-engine>
<enterprise-beans>
<enterprise-bean>
<ejb-name>SessionFacadeBean</ejb-name>
<jndi-name>ejb/facade</jndi-name>
<session-props/>
</enterprise-bean>
<enterprise-bean>
<ejb-name>LicenseDeclarationBMPBean</ejb-name>
<entity-props/>
</enterprise-bean>
<enterprise-bean>
<ejb-name>AccessSAPBean</ejb-name>
<session-props/>
</enterprise-bean>
<enterprise-bean>
<ejb-name>LicenseMasterBMPBean</ejb-name>
<entity-props/>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>

And the call is issued like this:
try
{
InitialContext ctx = new InitialContext();
SessionFacadeHome home = (SessionFacadeHome)ctx.lookup("ejb/facade");
SessionFacade remote = home.create();

//Call the method of the facade to retrieve the license names.
c = remote.GetAllLicenseNames(sClientID);
}

I am using NetWeaver Studio for development. Thanks for taking the time to read my post. Any help will be appreciated.
15 years ago