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

Problem in getting the datasource for mysql

 
Mike Thomson
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to get the mysql datasource from servlet.
I have configured the datasource in mysql-ds.xml as follows:


Then, I configured web.xml and jboss-web.xml as follows:




In servlet, I am trying to get the datasource as follows:


But I am getting the followin exception:


Please help on it. And alos, I have another doubt, when will the objects are registered with JNDI. During deployment time, will the jboss app. server register the objects with JNDI on referring web.xml and ejb-jar.xml?
[ January 03, 2009: Message edited by: Mike Thomson ]
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The jndi-name is incorrect here. It should point to the JNDI name of the datasource. So it should be:



In your servlet, you can then lookup the resource at java:comp/env/jdbc/test
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic