Finally found the problem.  It is in dbcp 1.2.2 version.
(see this bug https://issues.apache.org/jira/browse/DBCP-244)

The fix is to change dbcp version back to 1.2.1 (in POM).  Worked like a
champ for me after two days of screwing with various options.

Very hard to replicate on a db with any load as the wait_timeout doesn't
expire.  Stopping and starting the mysqld service did work for me as long as
I was the first to hit it.  Otherwise someone else would see the ugly stack
trace.

Ron


Ron Anderson wrote:
> 
> It will also fail after the mysql variable 'wait_timeout' expires which is
> defaulted to 8 hours.  So if no one access the app overnight, the first
> user to login in the morning has this error.  Will try changing this
> variable to verify. 
> 
> Have also been trying to catch the exception so users don't see an ugly
> stack trace but no luck so far.
> 
> Have tried catching it in the userDao, have put a global exception mapping
> in my struts.xml and have tried setting up exceptionMappings in my
> security.xml AuthenticationProcessingFilter but with no success.
> 
> struts.xml
> 
>         <global-exception-mappings>
>             <exception-mapping
>                 exception="org.springframework.dao.DataAccessException"
>                 result="dataAccessFailure" />
>             <exception-mapping
>                
> exception="org.springframework.transaction.CannotCreateTransactionException"
>                 result="dataAccessFailure" />
>             <exception-mapping
>                 exception="org.hibernate.TransactionException"
>                 result="dataAccessFailure" />
>         </global-exception-mappings>
> 
> security.xml AuthenticationProcessingFilter 
> 
>         <property name="exceptionMappings">
>             <props>
>                 <prop
> key="org.hibernate.TransactionException">/login.jsp?error=true</prop>
>                 <prop
> key="org.springframework.transaction.CannotCreateTransactionException">/login.jsp?error=true</prop>
>             </props>
>         </property>
> 
> Anyone have a work around for this or know how to catch the exception?
> 
> Ron
> 
> ----- Original Message ----
> From: Nathan Anderson <[EMAIL PROTECTED]>
> To: users@appfuse.dev.java.net
> Sent: Wednesday, December 5, 2007 1:25:50 PM
> Subject: Re: [appfuse-user] Could not open Hibernate Session for
> transaction; nested exception is
> 
> 
> I have an app that has this same problem running on:
>    mysql-server-5.0 5.0.45-1ubuntu3
> 
> You are right it appears to be at the first login attempt that it
>  fails, after that the app works normally.
> 
> I hate bugs that are so hard to test [since they take so long to
>  appear].
> 
> Nathan
> 
> 
> ----- "Matt Raible" <[EMAIL PROTECTED]> wrote:
>> Server version: 5.0.41-community MySQL Community Edition (GPL)
>> 
>> 
>> 
>> On Dec 5, 2007 , at 9:48 AM, Ron Anderson wrote:
>> 
>> 
>> 
>> 
>> Which mysql server version are the demo's running on? I'm using
>> 5.0.22.
>> 
>> 
>> ----- Original Message ----
>> From: Matt Raible < [EMAIL PROTECTED] >
>> To: users@appfuse.dev.java.net
>> Sent: Wednesday, December 5, 2007 9:44:17 AM
>> Subject: Re: [appfuse-user] Could not open Hibernate Session for
>> transaction; nested exception is
>> 
>> I haven't seen this problem on the AppFuse demos, but I'm still using
>> 5.0.5. I'd suggest hanging out in AppFuse's IRC - sometimes Mark
>> Matthews (MySQL JDBC Guy) is there. Doesn't look like he's there now,
>> but maybe later today .
>> 
>> You could try posting to the MySQL mailing list.
>> 
>> Matt
>> 
>> 
>> On Dec 5, 2007 , at 9:40 AM, Ron Anderson wrote:
>> 
>> >
>> > Has anyone solved this problem? I've upgraded to latest mysql
>> > connector
>> > 5.0.8 and have the same problem described here (and on some other
>> > posts
>> > related to this issue).
>> >
>> > The way to recreate it is to stop and restart mysqld. The first
>> > time you
>> > login, you'll see this error. It won't happen again after you
>> refresh
>> > and/or re-login.
>> >
>> > Ron
>> >
>> >
>> >
>> >
>> > kace wrote:
>> >>
>> >> Hi fellas,
>> >>
>> >> I just got this same error when I tried accessing my app. It's
>> >> been three
>> >> days since I last accessed it. Did you guys get this issue
>> resolved?
>> >>
>> >> I am using appfuse 2 final jsf.
>> >>
>> >> Thanks
>> >>
>> >> ..kace
>> >>
>> >> Ealden Escañan wrote:
>> >>>
>> >>> On 10/11/07 , Matt Raible < [EMAIL PROTECTED] > wrote:
>> >>>>
>> >>>> If you're using M5 (not 2.0 Final), you shouldn't have to change
>> >>>> anything. I was just suspicious that the changes I made might be
>> >>>> causing the problem. I haven't seen any issues on the demo site.
>> >>>
>> >>> The demo site might be accessed regularly so the problem might
>> >>> not be
>> >>> apparent there...
>> >>>
>> >>>> You might try upgrading to the latest MySQL driver (from
>> >>>> dev.mysql.com ).
>> >>>
>> >>> Alright. Will be trying 5.0.8 and 5.1.5.
>> >>>
>> >>> Also, what me and Sanath are experiencing looks to be the same as
>> >>> http://www.nabble.com/How-to-deal-with-potential-stale-
>> >>> connections-in-pool--tf4387600s2369.html#a13168040
>> >>>
>> >>> --
>> >>> Ealden Esto E. Escañan
>> >>> http://ealden.net
>> >>>
>> >>>
>> --------------------------------------------------------------------
>> >>> -
>> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >>> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> > --
>> > View this message in context: http://www.nabble.com/Could-not-open-
>> > Hibernate-Session-for-transaction--nested-exception-is-
>> > tf4592354s2369.html#a14176572
>> > Sent from the AppFuse - User mailing list archive at Nabble.com .
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Re%3A-Could-not-open-Hibernate-Session-for-transaction--nested-exception-is-tf4951286s2369.html#a14220132
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to