• Post Reply Bookmark Topic Watch Topic
  • New Topic

An error occurred performing resource injection on managed bean testBean

 
Victor Ade
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't seem to find what's wrong with testbean from stack trace

can anyone help?
 
Tim Holloway
Bartender
Posts: 18469
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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: 36
  • Mark post as helpful
  • send pies
  • 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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!