Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

InjectionException  RSS feed

 
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 ]
 
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • 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
Boost this thread!