File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jboss- Mssql configuration porblem

 
mehul savalia
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am configuring our application on joss-3.2.5.
We are using Ms Sql database.
I have done up to following steps for configuration of Jdbc.

1)msbase.jar,msutil.jar,mssqlserver.jar jar C:\jboss-3.2.5\jboss-3.2.5\server\default\lib dir.
2)Enter following detail in mssql-ds.xml file and copy it in C:\jboss-3.2.5\jboss-3.2.5\server\default\deploy dir.

<datasources>
<local-tx-datasource>
<jndi-name>dmsdb</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://databaseserv:1433;DatabaseName=dmsdb</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
<password>5q154</password>
<!-- sql to call when connection is created -->
<new-connection-sql>SELECT COUNT(*) FROM sysusers WHERE 1 = -1</new-connection-sql>
<max-pool-size>2147483647</max-pool-size>
<idle-timeout-minutes>20</idle-timeout-minutes>

</local-tx-datasource>

</datasources>
3. I have modified the files from \jboss\server\default\config directory

a) standardjaws.xml
<jaws>
<datasource>java:/dmsdb</datasource>

<type-mapping>MS SQLSERVER2000</type-mapping>
<debug>false</debug>

b) standardjbosscmp-jdbc.xml

<defaults>
<datasource>java:/dmsdb</datasource>
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>

4. I have added the following xml info in login-config.xml file from \jboss\server\default\config

<application-policy name = "MSSQLDbRealm">
<authentication>
<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">sa</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=dmsdb</module-option>
</login-module>
</authentication>
</application-policy>

5. now i am gettin connection by lookup in jndi tree

ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("dmsdb");
now i am getting error message like this

An error was encountered whilst connecting to the database. Please try again later..An
error was encountered whilst connecting to the database. Please try again later.
.dmsdb not bound
 
cb poo
Ranch Hand
Posts: 67
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get solution from this forum as below, forgot what is the url:-

try put following code in between <datasources> tab.

<mbean code="org.jboss.naming.NamingAlias" name="jboss.jmx:alias=dmsdb">
<attribute name="FromName">dmsdb</attribute>
<attribute name="ToName">java:/dmsdb</attribute>
</mbean>
 
mehul savalia
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your Reply.

I have added
<mbean code="org.jboss.naming.NamingAlias" name="jboss.jmx:alias=dmsdb">
<attribute name="FromName">dmsdb</attribute>
<attribute name="ToName">java:/dmsdb</attribute>
</mbean>

in my mssql-ds.xml under <datasource> tag.
But its not working its still gives me an error
10:59:24,392 ERROR [LogInterceptor] Unexpected Error:
java.lang.OutOfMemoryError
10:59:24,392 ERROR [LoginServlet] LoginRemoteException caught...Unexpected Error; nested exception is:
java.lang.OutOfMemoryError

Now my mssql-ds is lilke this


<datasources>
<local-tx-datasource>
<jndi-name>dmsdb</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://INDIADEV01:1433;DatabaseName=dmsdb</connection-url>



<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
<password>5q154</password>
<!-- sql to call when connection is created -->
<new-connection-sql>SELECT COUNT(*) FROM sysusers WHERE 1 = -1</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>
-->
<max-pool-size>2147483647</max-pool-size>
<idle-timeout-minutes>20</idle-timeout-minutes>

</local-tx-datasource>
<mbean code="org.jboss.naming.NamingAlias" name="jboss.jmx:alias=dmsdb">
<attribute name="FromName">dmsdb</attribute>
<attribute name="ToName">java:/dmsdb</attribute>
</mbean>

</datasources>
 
Vilpesh Mistry
Ranch Hand
Posts: 62
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi mehul,
u are making small mistake

why do use 'sa' as the password in login-config.xml file
when u have used <password>5q154</password>
in mssql-ds.xml file

please use '5q154' as the password in login-config.xml file.
mostly this should solve the problem

best of luck

 
mehul savalia
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya Thanks that was mistake I change it, but it doesnt resovle the problem .
Problem is still there.
[ August 20, 2004: Message edited by: mehul savalia ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic