Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InjectionException

 
Chetan Raju
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
Not sure whether this is the right place to post this topic..

I have deployed a servlet on Sun Java System App Server 9.1. The code snippet for the problem area is


code:
--------------------------------------------------------------------------------



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



I am getting a
code:
--------------------------------------------------------------------------------

com.sun.enterprise.InjectionException: Exception attempting to inject Res-Ref-Env-Property: servlets.GreetingServlet/myDB@javax.sql.DataSource@ resolved as: jndi: servlets.GreetingServlet/myDB@res principal: null@mail: null

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



I am trying to connect to a MySQL database instance. I have also configured the web.xml for the resource which is a DataSource

code:
--------------------------------------------------------------------------------

myDB myDB javax.sql.DataSource

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



What could be the problem ? Can anyone help ?

[Formated code - dave]
[ August 07, 2008: Message edited by: David O'Meara ]
 
K. Tsang
Bartender
Posts: 3348
12
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the JNDI name for the database defined in Sun App Server JDBC section? Have you use the traditional JDBC connection (using Driver class) to see if the connection really work?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic