• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

jboss+deployment exception

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hii,

I am using jboss-3.2.6. when i try to deploy the ear then the server gives the exception :

org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: resource-ref: jdbc/mySql has no valid JNDI binding. Check the jboss-web/resource-ref.)

I have tried so many settings , but all in vein.Added resource-ref element in jboss-web, still it gives the error.

Which are the xml files need to be edited??
Only mysql-ds.xml??or any other files??If anyone have any idea pls reply.

Thanks,
Sujith
 
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic