• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

JBoss MS SQL server connectivity problems

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
My pie came with a little toothpic holding up this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic