File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb-jar.xml (Help!)

 
Ravi Singh
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between the <resource-ref> and <resource-env-ref> tags?
 
Aboo Bolaky
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello..
<resource-refs> may be any resource being used/referenced by the bean..like a connection pool or a topicconnection/queueconnection factory
on the other hand..
<resource env ref> can be any string or data format that u look up via jndi context ...like a string u place in the java:comp/env/ namespace
this occurs when u would like to create a well known string with a given value and then look up that value from ur bean....instaed of declaring it inside ur code, u look it up from JNDI...
hope it helps..
:roll:
 
Ravi Singh
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.

How is the <resource-env-ref> different from the <env-entry> then?
 
Aboo Bolaky
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry what i meant for <resource -env entry> is actually meant for <env entry>..
the real defn for resource env refs is that they provide a way of accessing, via JNDI lookups, administered objects associated with a resource. For example, an application may need to access a JMS Destination object. The <resource-env-ref> element, defined in the standard deployment descriptors lets applications declare the resource requirements.

The main difference between <resource-env-ref> and <resource-ref> element is the absence of specific resource authentication requirement; both these elements have to be backed up by a resource factory descriptor.

resource-env-ref>
<description> My Topic </description>
<res-env-ref-name> jms/MyTopic </res-ref-name>
<res-env-ref-type> javax.jms.Topic </res-type>
</resource-env-ref>

in order these resource-env-ref variables to work, the administrators will have to make target resource factories available at run-time.
 
Ravi Singh
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

What do you mean by an administered object?

Does this mean the resource made available through <resource-ref> is managed by the J2EE container, but the resource made available through <resource-env-ref> is managed by some other server?
 
Aboo Bolaky
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
administered objects with reference to JMS are ConnectionFactories and destinations. these are looked up via JNDI...and are both managed by the J2EE server...
 
Aboo Bolaky
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for more information about connection factories and destinations visit Sun's JMS tutorial

connection factories and destinations are created with the J2EE admin console and are best managed adminitratively rather than programmatically..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic