-
1. Re: Jboss - MS SQLSERVER2000 configuration problem
jboss_oops Nov 5, 2004 1:47 AM (in response to asite)HI Asite,
Did u get any response or solution on how to remove this error. I am also facing the same problem.
If you have the soln plz post this as a reply to this message..
thanx :) -
2. Re: Jboss - MS SQLSERVER2000 configuration problem
asite Nov 5, 2004 2:04 AM (in response to asite)HI!
This is mehul savalia from Asite Solutions.
now i am not getting the above problem.
Please follow the steps in addtion to the jars stettings.
1.Entery in MS-SQL DS
<local-tx-datasource>
<jndi-name>dmsdb</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://servname:1433;;ServerName=servername;PortNumber=1433;DatabaseName=databasename;User=sa;Password=password;SelectMethod=cursor</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
5q154
<prepared-statement-cache-size>50</prepared-statement-cache-size>
<new-connection-sql>SELECT COUNT(*) FROM sysusers WHERE 1 = -1</new-connection-sql>
<!-- sql to call when connection is created
sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<min-pool-size>25</min-pool-size>
<max-pool-size>31000</max-pool-size>
<idle-timeout-minutes>15</idle-timeout-minutes>
<track-statements>false</track-statements>
</local-tx-datasource>
2. I have modified the files from \jboss\server\default\config directory
a) standardjaws.xml
java:/dmsdb
<type-mapping>MS SQLSERVER2000</type-mapping>
false
b) standardjbosscmp-jdbc.xml
java:/dmsdb
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>
3. I have added the following xml info in login-config.xml file from \jboss\server\default\config
<application-policy name = "MSSQLDbRealm">
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password">5q154</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=dmsdb</module-option>
</login-module>
</application-policy>
4 download msvcp71.dll and msvcr71.dll and copy it in system32 folder of window dir.
Hope that it works for you. -
3. Re: Jboss - MS SQLSERVER2000 configuration problem
asite Nov 5, 2004 2:08 AM (in response to asite)one more thing when u do the lookup use
java:/datasource name
in my case it is
java:/dmsdb -
4. Re: Jboss - MS SQLSERVER2000 configuration problem
jboss_oops Nov 5, 2004 4:00 AM (in response to asite)Hi I am also trying to connect to MS SQL Server 2000. I am running JBOSS 3.2.4
My Client code is not able to do the JNDI MApping..
Here Below I am attaching the code which I have in my client code.
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
import java.io.*;
import java.util.*;
class TestJdbcJBoss
{
public static void main(String[] args) throws SQLException,IOException,ClassNotFoundException,NamingException
{
Hashtable ht=new Hashtable();
ht.put(InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
ht.put(InitialContext.PROVIDER_URL,"jnp://localhost:1099");
InitialContext ic=new InitialContext(ht);
if(ic!=null)
System.out.println("success11");
DataSource ds=(DataSource)ic.lookup("java:/MSSQLDS");
Connection conn = ds.getConnection();
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select * from testbd");
if(rs!=null)
System.out.println("sucess");
while(rs.next())
{
System.out.println(rs.getInt("test"));
}
}
}
This the error I am getting when I run my code
success11
Exception in thread "main" javax.naming.NameNotFoundException: MSSQLDS not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at TestJdbcJBoss.main(TestJdbcJBoss.java:17)
I have done all the settings and configuration in JBOSS has given in the below Link
http://www.onjava.com/pub/a/onjava/2004/02/25/jbossjdbc.html
Please guide me where I am doing wrong..
what all additional changes I have to do?
Please do reply
thanks :)
I also tried now that way you have suggested in your Previous asite mail.
But I have not downloaded msvcp71.dll and msvcr71.dll..
why do we need them??
That too is giving the same error.
What do u suggest to do? -
5. Re: Jboss - MS SQLSERVER2000 configuration problem
lviz Nov 5, 2004 7:19 AM (in response to asite)hi
here is our mssql-ds.xml<datasources> <local-tx-datasource> <jndi-name>MSSQLDS</jndi-name> <connection-url>jdbc:microsoft:sqlserver://sqlsrv.domain.me:1433;DatabaseName=db;SelectMethod=Cursor</connection-url> <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class> <user-name>user</user-name> <password>pass</password> <!-- sql to call when connection is created <new-connection-sql>some arbitrary sql</new-connection-sql> --> <!-- sql to call on an existing pooled connection when it is obtained from pool <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql> --> <min-pool-size>0</min-pool-size> <max-pool-size>10</max-pool-size> <blocking-timeout-millis>5000</blocking-timeout-millis> <idle-timeout-minutes>5</idle-timeout-minutes> </local-tx-datasource> </datasources>
cheers
L