• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Problem looking up local interface of Session Beans - WSAD 5.1, WAS 5.0 Test Env

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To ALL J2EE Guru's,

I am getting some problems in looking up my beans local home interface(Details under), however when I look up the remote home interface its fine. Please look into my problem when you have a minute. Appreciate your help.
---------------------------------- Details --------------------
1. I have 2 beans, one stateful, other stateless and both have remote and local interfaces
2. I can access both using remote interfaces but not using local interfaces
3. However TestClient works fine for both Remote and Local interfaces:

Followings are the urls TestClient looks up:

Stateless Bean remote Interface:

http://localhost:9080/UTC/jndiLookup?name=com/selectica/configejb/CxConfigStatelessHome&random=0.032660621190745975

Stateless Bean LocalInterface:

http://localhost:9080/UTC/jndiLookup?name=local:/ejb/com/selectica/configejb/CxConfigStatelessHome&random=0.32728747419322335

In my client program I used following JNDI:

I. For looking up remote home : com/selectica/configejb/CxConfigStatelessHome (Works OK)
II. For Looking up local home: local:ejb/com/selectica/configejb/CxConfigStatelessHome (throws following exception)


javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: local
at com.ibm.ws.naming.jndicos.CNContextImpl.checkForUrlContext(CNContextImpl.java:2770)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1220)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at GetServiceProgramsLocal.getEJBObjectHandle(GetServiceProgramsLocal.java:130)
at GetServiceProgramsLocal.main(GetServiceProgramsLocal.java:54)


4. My Client module and ejb module are in same .ear.
5. I have created local references (Deployment descriptor is pasted below)

Some more Details:

Look up Code:


private static CxConfigLocalStateless getEJBObjectHandle() throws NamingException, CreateException, RemoteException {
CxConfigLocalStateless config = null;
final InitialContext ic = new InitialContext(); // get initial context
final CxConfigLocalStatelessHome home = (CxConfigLocalStatelessHome) ic.lookup("local:ejb/com/selectica/configejb/CxConfigStatelessHome");
config = (CxConfigLocalStateless)home.create();

return config;
}


Deployment Descriptor:

<?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 id="ejb-jar_ID">

<enterprise-beans>
<session id="Session_1076368683641">
<ejb-name>SelecticaConfigEJB_Stateful</ejb-name>
<home>com.selectica.configejb.CxConfigHome</home>
<remote>com.selectica.configejb.CxConfig</remote>
<local-home>com.selectica.configejb.CxConfigLocalHome</local-home>
<local>com.selectica.configejb.CxConfigLocal</local>
<ejb-class>com.selectica.configejb.CxConfigBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
<env-entry id="EnvEntry_1076368726516">
<env-entry-name>CODEBASE</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>c:/selectica/kbs/;</env-entry-value>
</env-entry>

<env-entry id="EnvEntry_1076368726517">
<env-entry-name>DATASOURCE_CONFIG_FILE</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>ds.xml</env-entry-value>
</env-entry>

<env-entry id="EnvEntry_1076368726518">
<env-entry-name>DEBUG</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>False</env-entry-value>
</env-entry>

<ejb-local-ref id="EJBLocalRef_1129752409153">
<ejb-ref-name>ejb/SelecticaConfigEJB_Stateful</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.selectica.configejb.CxConfigLocalHome</local-home>
<local>com.selectica.configejb.CxConfigLocal</local>
<ejb-link>SelecticaConfigEJB_Stateful</ejb-link>
</ejb-local-ref>
</session>

<session id="Session_1076368683642">
<ejb-name>SelecticaConfigEJB_Stateless</ejb-name>
<home>com.selectica.configejb.CxConfigStatelessHome</home>
<remote>com.selectica.configejb.CxConfigStateless</remote>
<local-home>com.selectica.configejb.CxConfigLocalStatelessHome</local-home>
<local>com.selectica.configejb.CxConfigLocalStateless</local>
<ejb-class>com.selectica.configejb.CxConfigStatelessBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry id="EnvEntry_1076368726531">
<env-entry-name>CODEBASE</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>http://localhost:8080/;c:/selectica/kbs/;</env-entry-value>;
</env-entry>
<env-entry id="EnvEntry_1076368726532">
<env-entry-name>DATASOURCE_CONFIG_FILE</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>ds.xml</env-entry-value>
</env-entry>

<env-entry id="EnvEntry_1076368726533">
<env-entry-name>DEBUG</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>False</env-entry-value>
</env-entry>

<ejb-local-ref id="EJBLocalRef_1129752409223">
<ejb-ref-name>ejb/SelecticaConfigEJB_Stateless</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.selectica.configejb.CxConfigLocalStatelessHome</local-home>
<local>com.selectica.configejb.CxConfigLocalStateless</local>
<ejb-link>SelecticaConfigEJB_Stateless</ejb-link>
</ejb-local-ref>
</session>
</enterprise-beans>

<assembly-descriptor id="AssemblyDescriptor_ID">
<container-transaction id="MethodTransaction_1076368726531">
<method id="MethodElement_1076368726547">
<ejb-name>SelecticaConfigEJB_Stateful</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>

<trans-attribute>Required</trans-attribute>
</container-transaction>

</assembly-descriptor>
</ejb-jar>

Regards,
Sakti
[ October 21, 2005: Message edited by: Sakti Singh ]
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic