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.