File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes purpose of jboss-web.xml file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "purpose of jboss-web.xml file?" Watch "purpose of jboss-web.xml file?" New topic
Author

purpose of jboss-web.xml file?

Kevin Kilbane
Ranch Hand

Joined: Sep 22, 2008
Posts: 42
Hi,

Warning: newbie question ahead.

I'm having problems trying to set up JNDI DataSources in JBoss 5.1.0. A lot of the solutions to similar issues refer to the jboss-web.xml file in the WEB-INF directory of the WAR file. Could someone explain to me why this file exists and what it's purpose is? What does it provide that a normal web.xml does not?

Thanks.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10048
    
163

In the context of datasources, the jboss-web.xml allows to specify the JNDI name at which the datasource is available. The web.xml doesn't allow for a way to specify the jndi name. Since you are looking for datasource related configuration, I think this thread might help.

[My Blog] [JavaRanch Journal]
Kevin Kilbane
Ranch Hand

Joined: Sep 22, 2008
Posts: 42
Thanks for the response. That was one of the solutions I had seen previously.

Does the <resource-ref> entry in the web.xml file not allow us to specify the JNDI name?

Why does JBoss require the an app-server specific config file when other servers do not?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10048
    
163

Kevin Kilbane wrote:

Does the <resource-ref> entry in the web.xml file not allow us to specify the JNDI name?

Not in Java EE5.

Kevin Kilbane wrote:
Why does JBoss require the an app-server specific config file when other servers do not?


You don't really have to configure a resource-ref for the datasource. However, if you do configure a resource-ref then app server specific config files are required to point it to JNDI names.

If you want to just lookup and use a datasource in your web application, then just use the java:<jndiname> specified in your *-ds.xml file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: purpose of jboss-web.xml file?