Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

purpose of jboss-web.xml file?

 
Kevin Kilbane
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kevin Kilbane
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic