wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes ejb-jar.xml (Help!) 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 "ejb-jar.xml (Help!)" Watch "ejb-jar.xml (Help!)" New topic
Author

ejb-jar.xml (Help!)

Ravi Singh
Ranch Hand

Joined: Aug 02, 2004
Posts: 51
What is the difference between the <resource-ref> and <resource-env-ref> tags?
Aboo Bolaky
Greenhorn

Joined: Apr 02, 2004
Posts: 19
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:


Regards,<br />Aboo
Ravi Singh
Ranch Hand

Joined: Aug 02, 2004
Posts: 51
Thank you.

How is the <resource-env-ref> different from the <env-entry> then?
Aboo Bolaky
Greenhorn

Joined: Apr 02, 2004
Posts: 19
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

Joined: Aug 02, 2004
Posts: 51
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

Joined: Apr 02, 2004
Posts: 19
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

Joined: Apr 02, 2004
Posts: 19
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
 
subject: ejb-jar.xml (Help!)
 
Similar Threads
Warning: Resource reference is not defined for JNDI name
DD elements for JNDI
Do we have this in DD?
security issue
difference between two xml tags