Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JBoss MS SQL server connectivity problems

 
Olivia Jones
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am a new user of Jboss and currently working on an EJB based application on JBoss 3.2.3 with MS SQL server. I have been successful in deploying EJBs. But my problem is that I am not able to establish database connectivity. Could any of you please help me.
Here are the relevant details.
1.extract of the program to get connection:
import javax.naming.InitialContext;
import javax.sql.DataSource;
import java.sql.Connection;
InitialContext initctx=new InitialContext();
DataSource ds=(DataSource) initctx.lookup
("java:comp/env/jdbc/BSCDSN");
Connection connection=ds.getConnection();
return connection;

2. standardjbosscmp-jdbc.xml
<datasource>java:/DefaultDS</datasource>
<datasource-mapping>Hypersonic SQL</datasource-mapping>
3. extract of mssql-ds.xml
<datasources>
<local-tx-datasource>
<jndi-name>MSSQLDS</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://192.168.100.18:1433;DatabaseName=BSCProdServer
</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
<password>sa</password>
4. after deploying mssql-ds.xml(Jboss log)
09:39:06,796 INFO [MainDeployer] Starting deployment of package:
file:/C:/jboss-3.2.3/server/all/deploy/mssql-ds.xml
09:39:06,875 INFO [RARDeployment] Started
jboss.jca:service=ManagedConnectionFactory,name=MSSQLDS
09:39:06,875 INFO [JBossManagedConnectionPool] Started
jboss.jca:service=ManagedConnectionPool,name=MSSQLDS
09:39:06,921 INFO [MSSQLDS] Bound connection factory for resource adapter for ConnectionManager
'jboss.jca:service=LocalTxCM,name=MSSQLDS to JNDI name 'java:/MSSQLDS'
09:39:06,921 INFO [TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=MSSQLDS
09:39:06,937 INFO [MainDeployer] Deployed package:
file:/C:/jboss-3.2.3/server/all/deploy/mssql-ds.xml
5.But during start up, the following error message is shown:
Depends On Me: org.jboss.deployment.DeploymentException: Error: can't find datasource:
java:/DefaultDS; - nested throwable: (javax.naming.NameNotFoundExceptio
: DefaultDS not bound)]
After I input information in the Login page of my application, I do not see any message in the Jboss log confirming JDBC connection being established. The application displays a customized an error message instead.
Any help in this regard is highly appreciated.
Thank You.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic