Forums Register Login
ejb-jar.xml (Help!)
What is the difference between the <resource-ref> and <resource-env-ref> tags?
<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..
Thank you.

How is the <resource-env-ref> different from the <env-entry> then?
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.

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

in order these resource-env-ref variables to work, the administrators will have to make target resource factories available at run-time.

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?
administered objects with reference to JMS are ConnectionFactories and destinations. these are looked up via JNDI...and are both managed by the J2EE server...
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..
get schwifty. tiny ad:

This thread has been viewed 919 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 23, 2018 05:51:14.