File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes 3.2 jbosscmp-jdbc.xml - datasource-mapping tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "3.2 jbosscmp-jdbc.xml - datasource-mapping tag?" Watch "3.2 jbosscmp-jdbc.xml - datasource-mapping tag?" New topic

3.2 jbosscmp-jdbc.xml - datasource-mapping tag?

Rick Feenstr

Joined: Jul 11, 2003
Posts: 6
In JBoss 3.2, jbosscmp-jdbc.xml file, what is the <datasource-mapping> tag refer to? I'm attempting to connect to SQL Server, and can't determine the correct value for this. During deployment of my application JAR, I get the following exception and (partial) stack trace:
10:42:52,722 ERROR [EntityContainer] Starting failed
org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : datasourc
e-mapping titandb not found
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDB
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
at org.jboss.ejb.EntityContainer.startService(

and following summary:
MBeans waiting for other MBeans:
[ObjectName: jboss.j2ee:jndiName=StatesHomeRemote,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc
.xml : datasource-mapping titandb not found]
So, what is <datasource-mapping> supposed to refer to?
Thanks in advance.
Rick Feenstr

Joined: Jul 11, 2003
Posts: 6
I got it figured out.
Unless noted, everything is defined as in the JBoss Workbook from O'Reilly.
Using the JSQLConnect jdbc driver.
Copy JBoss_home/docs/examples/jca/mssql-ds.xml to project_home/project-ds.xml. (The filename must end in �ds.xml). In my case, it is titandb-ds.xml.
Update file as:

<?xml version="1.0" encoding="UTF-8"?>
<connection-url>jdbc:JSQLConnect://DATABASE_SERVER_NAME ort/database=database_name/user=foo/password=bar/sqlVersion=6</connection-url>

Deploy this datasource descriptor by copying it to JBoss_home/server/default/deploy directory.
This creates a datasource, with the JNDI connection pool name java:/MSSQLDS.
Note the �sqlVersion=6� identifier in the jdbc connect string for SQL Server 6.5.
Note that this file is not included with the application�s JAR file; it is maintained separately.

And then project meta-data file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc PUBLIC
<datasource-mapping>MS SQLSERVER</datasource-mapping>

Note the datasource is �java:/MSSQLDS� as defined in the titandb-ds.xml file.
Note that datasource-mapping tag is �MS SQLSERVER�. For SQLServer 2000, it will be �MS SQLSERVER2000�.

I hope this helps someone. -Rick
[ July 15, 2003: Message edited by: Rick Feenstr ]
srinivasan ganesan
Ranch Hand

Joined: Mar 09, 2001
Posts: 54
To whoever is interested in knowing this value for MySql..the datasource-mapping is mySQL (yes its case sensitive). hope this helps someone too..
I agree. Here's the link:
subject: 3.2 jbosscmp-jdbc.xml - datasource-mapping tag?
It's not a secret anymore!