This is a documentation bug about jboss-web.xml. It is in "The jboss-web.xml ENC Elements" as well as in the appendix "The JBoss server jboss-web.xml descriptor DTD":
The <resource-ref> element has the same form as in jboss.xml, especially when using an URL (type is "java.net.URL") you have to use <res-url> instead of <jndi-name>. I had to look up this in the jboss source.
I have not found an updated DTD.
So is this the correct format for jboss-web.xml? I grabbed this from the DTD for jboss.xml. I just want to make sure, but I'll test it anyways.
I'm getting this weird error when I try to deploy my war with the URL resource:
10:43:16,210 INFO [MainDeployer] Starting deployment of package: file:/C:/www/j
10:43:16,421 WARN [NestedThrowable] Duplicate throwable nesting of same base ty
pe: class org.jboss.deployment.DeploymentException is assignable from: class org
My jboss-web.xml has the following:
Which package is this in? Looking at the source now.
here is an example form my jboss-web.xml, I think the res-type entry is required because they look for res-url if the type is java.net.URL:
[/pre]The relevant source is in org.jboss.metadata.ResourceRefMetaData.importEjbJarXml()
This method is used for ejb-jar, jboss and jboss-web.
I hope this helps,
> [/pre]The relevant source is in
Okay, that's being executed, but that's for web.xml. The corresponding method call for jboss-web.xml is:
I added some debug logs to this class and this method isn't being called at all.
yes you are right, I looked at the wrong header, importJbossXml has the relevant code for parsing res-url.
"jboss-web.xml" is loaded via importJBossWebXml which in turn calls importJbossXml for the resource-ref entries. I just looked at the sources, so I am not totally sure if it is actually called, but using res-url inside jboss-web.xml worked for me.