aspose file tools*
The moose likes JBoss/WildFly and the fly likes Error during deploy; - nested throwable:(javax .naming. NamingException: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Error during deploy; - nested throwable:(javax .naming. NamingException:" Watch "Error during deploy; - nested throwable:(javax .naming. NamingException:" New topic
Author

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

Anita Lobo
Greenhorn

Joined: Oct 23, 2004
Posts: 1
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!!!
Chiaw Huat Lee
Greenhorn

Joined: Oct 24, 2004
Posts: 15
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error during deploy; - nested throwable:(javax .naming. NamingException: