wood burning stoves 2.0*
The moose likes JDBC and the fly likes InjectionException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "InjectionException" Watch "InjectionException" New topic
Author

InjectionException

Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
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

Joined: Sep 13, 2007
Posts: 2419
    
    7

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?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: InjectionException