• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

An error occurred performing resource injection on managed bean testBean

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't seem to find what's wrong with testbean from stack trace

can anyone help?
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cannot tell just from this information with certainty, but it appears that you are attempting to inject a DBCP Connection into the Managed Bean and it looks like the Connection factory could not provide a valid Connection object. Most likely, either it attempted to create a new Connection and failed, or it attempted to pull an existing Connection that was broken - which usually happens when the Connection's network linkage times out.

If the connection has timed out, you need to add some extra directives to your Tomcat Connection Pool definition to ensure that the Pool Manager discards old broken Connections or keeps them alive. The exact directives required for this vary depending on the database, so read the Tomcat documentation.
 
Victor Ade
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:I cannot tell just from this information with certainty, but it appears that you are attempting to inject a DBCP Connection into the Managed Bean and it looks like the Connection factory could not provide a valid Connection object. Most likely, either it attempted to create a new Connection and failed, or it attempted to pull an existing Connection that was broken - which usually happens when the Connection's network linkage times out.

If the connection has timed out, you need to add some extra directives to your Tomcat Connection Pool definition to ensure that the Pool Manager discards old broken Connections or keeps them alive. The exact directives required for this vary depending on the database, so read the Tomcat documentation.


Solved this already sorry. I had two MYSQL connector jar files in tomcat lib. Remove the old one and all work fine now. Thanks Tim.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic