• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HELP: how to set JNDI of session/enity bean with ias 6.5

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all iAS expert

It is very thankful one can provide me with answers to my below questions.
How can l configure the JNDI of session/entity bean ?
l have looked into DTD definitions of all xml doc of iAS6.5. In particular, l paid
special attention to DTDs of ias-ejb-jar.xml and property-file-name.xml. There seems no way to
set the JNDI location of session / entity bean. How can l use "ejb-ref" in ejb-jar.xml /
web.xml to map to the actual JNDI location of EJB.
thanks you a lot !
dso
 
Author
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ejb-name attribute in the ias-ejb-jar.xml file defines the name of the EJB in JNDI.
David
 
fox hk
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear David
thank you a lot for your answers to my posted question. They really help me very much
As in your reply, <ejb-name> will be the JNDI of registered ejb. l become kind of confused about this. Because as far as l know, most of app server will allow to set the JNDI name other than <ejb-name> in its app server specific descriptor.
In addition, below snippet is cut from descriptors from an e.g (ias-samples\j2eeguide\enroller\) coming with iAS.
ejb-jar.xml
<ejb-jar>
<display-name>j2eeguide-enrollerEjb</display-name>
<enterprise-beans>
<entity>
<ejb-name>StudentEJB</ejb-name>
<home>j2eeguide.enroller.StudentHome</home>
<remote>j2eeguide.enroller.Student</remote>
<ejb-class>j2eeguide.enroller.StudentEJB</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>false</reentrant>
<ejb-ref>
<ejb-ref-name>ejb/MyEnroller</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>j2eeguide.enroller.EnrollerHome</home>
<remote>j2eeguide.enroller.Enroller</remote>
<ejb-link>EnrollerEJB</ejb-link>
</ejb-ref>
<resource-ref>
<description></description>
<res-ref-name>jdbc/CollegeDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
<session>
<ejb-name>EnrollerEJB</ejb-name>
<home>j2eeguide.enroller.EnrollerHome</home>
<remote>j2eeguide.enroller.Enroller</remote>
<ejb-class>j2eeguide.enroller.EnrollerEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<description></description>
<res-ref-name>jdbc/CollegeDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
.........
ias-ejb-jar.xml
<ias-ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>StudentEJB</ejb-name>
<guid>{f85f34ad-3c45-1a41-c9a8-080020c058b0}</guid>
<pass-timeout>0</pass-timeout>
<is-thread-safe>false</is-thread-safe>
<pass-by-value>false</pass-by-value>
<pool-manager>
<factory-class-name></factory-class-name>
<commit-option>COMMIT_OPTION_C</commit-option>
<Ready-pool-timeout>0</Ready-pool-timeout>
<Ready-pool-maxsize>0</Ready-pool-maxsize>
<free-pool-maxsize>1</free-pool-maxsize>
</pool-manager>
<ejb-ref>
<ejb-ref-name>ejb/MyEnroller</ejb-ref-name>
<jndi-name>ejb/EnrollerEJB</jndi-name>
</ejb-ref>
<resource-ref>
<res-ref-name>jdbc/CollegeDB</res-ref-name>
<jndi-name>jdbc/j2eeguide/CollegeDB</jndi-name>
</resource-ref>
</entity>
<session>
<ejb-name>EnrollerEJB</ejb-name>
<guid>{b9deb571-3c45-1a41-aa98-080020c058b0}</guid>
<pass-timeout>0</pass-timeout>
<is-thread-safe>false</is-thread-safe>
<pass-by-value>false</pass-by-value>
<session-timeout>0</session-timeout>
<resource-ref>
<res-ref-name>jdbc/CollegeDB</res-ref-name>
<jndi-name>jdbc/j2eeguide/CollegeDB</jndi-name>
</resource-ref>
</session>
................
If according to your previous answer (<ejb-name> is equal to JNDI), the ias-ejb-jar.xml should be changed as follows:
<ejb-ref-name>ejb/MyEnroller</ejb-ref-name>
<jndi-name>EnrollerEJB</jndi-name>

why ???
It is highly appreciated you can help me to clear up some conceptual stuff
thx
fox
 
reply
    Bookmark Topic Watch Topic
  • New Topic