aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Looking up JNDI in Weblogic6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Looking up JNDI in Weblogic6" Watch "Looking up JNDI in Weblogic6" New topic
Author

Looking up JNDI in Weblogic6

vinaychandragn
Greenhorn

Joined: May 17, 2001
Posts: 6
i am writing an ststeless session bean and trying to calll the bean from a servlet. i have copied the xml descriptor files from the examples and manipulated. i can weblogic.ejbc creates the required stub and skeleton classes. but when i try to run the servlet it gives the following exception. Anybody who faced the same or similar problem do help send the suggestions to vinaychandragn@hotmail.com. or do post it here itself.
javax.naming.NameNotFoundException: Unable to resolve lookupCountryBean. Resolved: '' Unresolved:'
emaining name ''
<<no stack trace available>>

the following is the code from the servlet
Object obj = ctx.lookup("lookupCountryBean");
CountryHome home=(CountryHome)PortableRemoteObject.narrow(obj,CountryHome.class);
CountryRemote remote = home.create();
the xml file entries ar as below
ejb-jar.xml
***************************************************
<ejb-jar>
<enterprise-beans>
<session>
<description>no description</description>
<display-name>CountryBean</display-name>
<ejb-name>CountryBean</ejb-name>
<home>com.sns.training.CountryHome</home>
<remote>com.sns.training.CountryRemote</remote>
<ejb-class>com.sns.training.CountryBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>
<ejb-ref-name>ref/CountryBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.sns.training.CountryHome</home>
<remote>com.sns.training.CountryRemote</remote>
<ejb-link>CountryBean</ejb-link>
</ejb-ref>
<resource-ref>
<description>Data Source for Country Bean</description>
<res-ref-name>jdbc/CountryDSRC</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>

***************************************************
weblogic-ejb-jar.xml
***************************************************

<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>CountryBean</ejb-name>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/CountryDSRC</res-ref-name>
<jndi-name>jdbc.DBCountry</jndi-name>
</resource-description>
</reference-descriptor>
<jndi-name>lookupCountryBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
***************************************************
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Looking up JNDI in Weblogic6
 
Similar Threads
JMS 1.1 + Weblogic + Websphere MQ + XATransactions
"comp/env/ejb/DcOtherInStateBenefitsSessionEJB" not found in context "java:"
xdoclet problem while generating ejb-jar.xml
JMS subscription problem
Fail to bind javax.mail.Session object on JNDI Tree