Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Rick Feenstr
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To whoever is interested in knowing this value for MySql..the datasource-mapping is mySQL (yes its case sensitive). hope this helps someone too..
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!