Every other resource gets defined in a sar or service file in the
deploy directory.. i.e. message queues and topics, jdbc
datasources,
mail services..
But the URL environment reference gets defined directly inside the
jboss deployment descriptors.. This is inconsistent. If this was the
way it was supposed to be then why not write the URL directly into
the ejb-jar.xml..
So if you like your ear, jar and war files zipped up for neatness and
you want to change the URL that an env-resource is pointing to..
you have to open up your ear, jar and war files to change it..
instead of say just editing a service file.
Also if you want to patch your app.. rather than just overwrite the
ear file with your shiny new one you are going to have to open it
up and change the URL references to suit the environment you are
in.
Logged In: YES
user_id=175228
You don't write the URL in the ejb-jar.xml, web.xml because
they do not support it. Resources like queues, datasources,
etc. are unique independent of who is referencing them. This
is not the case for env entries. The binding of a env-ref is
specific to the component making the reference.
Logged In: YES
user_id=559447
I didn't make myself clear.. I meant resource-ref (a URL resource ref)
that is not specific to a component.. and the deployment descriptors that
I refer to are the jboss ones. I know that you don't define URLs in the
J2EE ones.
The matter still stands.. All other resource references are defined outside
the EAR.. but the URL *resource ref* has to be defined inside the *jboss*
deployment descriptors and hence inside the EAR.. this is not consistent
and other app servers (specifically Websphere) don't do it that way.
Please reread my original post ignoring 'environment'. Apologies for the
confusion.
Logged In: YES
user_id=175228
I still don't know what your talking about. How would
websphere map the following ejb-jar resource-refs to the
deployment environment JNDI location?
<ejb-jar>
<display-name>ENC Tests</display-name>
<enterprise-beans>
<session>
<!-- JDBC DataSources (java:comp/env/jdbc) -->
<resource-ref>
<description>The default DS</description>
<res-ref-name>jdbc/DefaultDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<!-- JavaMail Connection Factories
(java:comp/env/mail) -->
<resource-ref>
<description>Default Mail</description>
<res-ref-name>mail/DefaultMail</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<!-- URL Connection Factories
(java:comp/env/url) -->
<resource-ref>
<description>The JBoss Web Site
HomePage</description>
<res-ref-name>url/JBossHomePage</res-ref-name>
<res-type>java.net.URL</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
</enterprise-beans>
</ejb-jar>
Logged In: YES
user_id=559447
Currently (in JBoss using your example ) you would have to add to your
jboss.xml
<resource-ref>
<res-ref-name>url/JBossHomePage</res-ref-name>
<res-url>file:///c:/foo/bar/</res-url>
</resource-ref>
which puts the URL and hence the 'definition of the resource' explicitly
into the jboss.xml that sits inside the EAR..
What I think should happen is to have say :
<resource-ref>
<res-ref-name>url/JBossHomePage</res-ref-name>
<jndi-name>java:/MyURL</jndi-name>
</resource-ref>
Where the URL resource is bound to this jndi name outside of the EAR in
the same way as it is for all other resources.. mail, queues, data etc.
Logged In: YES
user_id=175228
Ok, so your just asking for the same indirection as other
resources. Fine, we can support that.
Logged In: YES
user_id=175228
jboss-4.0.0RC3 now supports setting a java.net.URL
resource-ref to a location in jndi using the jndi-name.
Given a resource-ref like:
<resource-ref>
<description>XYZ HomePage</description>
<res-ref-name>url/IndirectURL</res-ref-name>
<res-type>java.net.URL</res-type>
<res-auth>Container</res-auth>
</resource-ref>
This can be bound to the URL found under the jndi name
urls/XYZHomePage using:
<resource-ref>
<res-ref-name>url/IndirectURL</res-ref-name>
<res-url>urls/XYZHomePage</res-url>
</resource-ref>
The value of the java:comp/env/url/IndirectURL is the
java.net.URL bound under the global jndi name urls/XYZHomePage.
Logged In: YES
user_id=559447
Apologies for reopening this but I submitted a patch and
noone noticed!!
I have written the URLResource service that compliments this
feature.. you can now register your URLs in a
url-service.xml file and hot deploy them.. finishing off
this RFE.
If you close this RFE then you will probably also want to
close this patch
http://sourceforge.net/tracker/index.php?func=detail&aid=1069543&group_id=22866&atid=376687
Patch against Jboss-4.0.1RC2
Logged In: YES
user_id=9459
All issues have been moved to http://jira.jboss.com. Existing
issues have been moved. New issues will be closed with this
canned reponse.