This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Trying to deploy a war file with datasources to JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Trying to deploy a war file with datasources to JBoss" Watch "Trying to deploy a war file with datasources to JBoss" New topic
Author

Trying to deploy a war file with datasources to JBoss

Mark Tobin
Ranch Hand

Joined: May 05, 2010
Posts: 37
I am trying to deploy a war file that connects to a database to Jboss an failing miserably.

Is there any good step by step guide in setting up a datasource for a war file in Jboss.

Like tomcat you have the web.xml application-context if you are setting the datasource inside the paa and the context.xml if setting it up in tomcat.

Mkunal badgujar
Greenhorn

Joined: May 18, 2010
Posts: 5
you have to put the configuration in oracle-ds.xml. under <datasources>

Mark Tobin
Ranch Hand

Joined: May 05, 2010
Posts: 37
or mssql-ds.xml under C:\jboss\server\default\deploy then add my war file to C:\jboss\server\default\deploy\jboss-web.deployer.

To tell the truth I dont think its a datasource problem.

I have a war file I can deploy an run on tomcat, well I have to run it on JBoss and I am getting lots of interesting unhelpful error messages.


I have added a empty jboss-web.xml under my WEB-INF I have a application-Contect-persistent.xml set up under WEB-INF. I have another JBoss problem I am going to raise
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37900
    
  22
Welcome to JavaRanch, Mkunal badgujar
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

Besides placing the *-ds.xml file for your datasource in the deploy directory, there are some settings you will need in web.xml and jboss-web.xml. Here is a post I did a while ago that lists the specifics:
http://community.jboss.org/message/251298#251298

Oh, I should mention that the instructions in the above link are is you want to use the java:comp/env context. If you don't want to use that context, then the JNDI name you use for lookup is "java:xxx" where xxx is the <jndi-name> value in *-ds.xml.


JBoss In Action
Mark Tobin
Ranch Hand

Joined: May 05, 2010
Posts: 37
Thanks Peter will give that a try.
 
 
subject: Trying to deploy a war file with datasources to JBoss
 
Similar Threads
Example Context doesnot respond (Jboss With tomcat)
Tomcat to JBoss
Core Java Server Faces 2 - Database (Ch 5) example, not working
How to deploy Servlet in Tomcat?
Deploying Web Applications in JBoss