• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error during deploy; - nested throwable:(javax .naming. NamingException:

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am trying to run my application on JBoss with mysql and i get the following error -
Error during deploy; - nested throwable: (javax.naming.NamingException: resource-ref:
jdbc/mySql has no valid JNDI binding. Check the jboss-web/resource-ref.)

My mysql-ds.xml file is as follows
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/mySql</jndi-name>
<connection-url>jdbc:mysql://172.25.40.126:3306/dashboard</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>dbuser</password>
</local-tx-datasource>
</datasources>

Tried many things ut not working. Pls help!!!
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well,if I'm not mistaken,you need to modified the standardjaws.xml,standardjbosscmp-jdbc.xml and login-config.xml.This files are located inside the conf folder.

Maybe with example, it will be easier for you to understand.
---------------------------------------------------------------------------
My mysql-ds.xml(which is created and put it inside the deploy folder):

<datasource>
<local-tx-datasource>
<jndi-name>MySqlDS</jndi-name>
<connection-url>jdbc:mysql://localhost/icbm</connection-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<user-name></user-name>
<password></password>
<security-domain>MysqlDbRealm</security-domain>
</local-tx-datasource>
</datasource>

---------------------------------------------------------------------------
Then,u need to make some changes to the standardjaws.xml:
All you need to do is changes the current <datasource>x</datasource>
and the <type-mapping>y</type-mapping>...where x = jndi-name inside the mysql-ds.xml and the y = db type that you're using.For this, is using MySql.

<jaws>
<datasource>java:/MySqlDS</datasource>
<type-mapping>mySql</type-mapping>
<debug>false</debug>

<default-entity>
<create-table>true</create-table>
<remove-table>false</remove-table>
<tuned-updates>true</tuned-updates>
<read-only>false</read-only>
....
.....
.....
</jaws>
---------------------------------------------------------------------------
Then,u need to make some changes to the standardjbossccmp.xml:
What are the things that you need to change?Well,will be exactly the same as above.

<jbosscmp-jdbc>

<defaults>
<datasource>java:/MySqlDS</datasource>
<datasource-mapping>mySql</datasource-mapping>

<create-table>true</create-table>
<remove-table>false</remove-table>
<read-only>false</read-only>
<read-time-out>300000</read-time-out>
<row-locking>false</row-locking>
...
...
...
----------------------------------------------------------------------------
Then, you need to add this few lines to your login-config.xml, which will tell the jboss to look/used the correct datasource for different applications that you have deployed in JBOSS.
<application-policy name = "MySqlDbRealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName"></module-option>
<module-option name = "password"></module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
</login-module>
</authentication>
</application-policy>

----------------------------------------------------------------------------

P/s:Sorry for my bad English and hopes this will help you to deploy your application.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic