5 Replies Latest reply on Nov 27, 2012 8:45 AM by Pavel Bekkerman

    Mina/C3P0

    Newbie

      We've been backing Mina with a C3P0 connection pool since 5.3.  Up to 5.4.0-CR1 this worked fine, on switching to 5.4.0-Final we see it throwing an AbstractMethodException when it calls:

      com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setCharacterStream

       

      It appears that c3p0 doesn't implement the signature varient that the jbpm-mina integration code is calling for via hibernate.

       

      What was added between -CR1 and -Final, and does anyone have advice on how to put a connection pool back in?  E.g. alternatives to c3p0 that have been used in conjunction with Mina?

        • 1. Re: Mina/C3P0
          Maciej Swiderski Master

          Timothy, could you provide bit more details on your case and maybe complete stack trace to be able to understand it more. As far as I can tell there was no change that could impact this.

           

          HTH

          • 2. Re: Mina/C3P0
            Newbie

            Hi Maciej

             

            Here's the stack

             

            2012-11-26 10:24:36,964 1406614 [NioProcessor-1] DEBUG org.hibernate.SQL  - insert into I18NText (language, shortText, text) values (?, ?, ?)

            2012-11-26 10:24:36,967 1406617 [NioProcessor-1] DEBUG com.mchange.v2.c3p0.stmt.GooGooStatementCache  - checkinStatement(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 50; checked out: 0; num connections: 3; num keys: 50

            2012-11-26 10:24:36,967 1406617 [NioProcessor-1] WARN  org.apache.mina.filter.logging.LoggingFilter  - EXCEPTION :

            java.lang.AbstractMethodError: com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setCharacterStream(ILjava/io/Reader;J)V

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    at java.lang.reflect.Method.invoke(Method.java:601)

                    at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)

                    at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)

                    at $Proxy26.setCharacterStream(Unknown Source)

                    at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$3$1.doBind(ClobTypeDescriptor.java:83)

                    at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:92)

                    at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:280)

                    at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:275)

                    at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:57)

                    at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2747)

                    at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2722)

                    at org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2929)

                    at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)

                    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2936)

                    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3447)

                    at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:81)

                    at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)

                    at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:203)

                    at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:183)

                    at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:167)

                    at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:320)

                    at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:287)

                    at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:193)

                    at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:126)

                    at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:78)

                    at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:208)

                    at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:151)

                    at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:834)

                    at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:827)

                    at org.hibernate.engine.spi.EJB3CascadingAction$1.cascade(EJB3CascadingAction.java:52)

                    at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:383)

                    at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:326)

                    at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208)

                    at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:412)

                    at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:353)

                    at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:329)

                    at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208)

                    at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)

                    at org.hibernate.event.internal.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:448)

                    at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:293)

                    at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:193)

                    at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:126)

                    at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:78)

                    at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:208)

                    at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:151)

                    at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:78)

                    at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:843)

                    at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:818)

                    at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:822)

                    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:865)

                    at org.jbpm.task.service.persistence.TaskPersistenceManager.saveEntity(TaskPersistenceManager.java:220)

                    at org.jbpm.task.service.TaskServiceSession$1.doOperation(TaskServiceSession.java:191)

                    at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:1115)

                    at org.jbpm.task.service.TaskServiceSession.addTask(TaskServiceSession.java:189)

                    at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:151)

                    at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                    at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)

                    at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                    at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:177)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                    at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                    at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

                    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)

                    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)

                    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)

                    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)

                    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)

                    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                    at java.lang.Thread.run(Thread.java:722)

             

            As I say, this is only a problem with MySql + c3p0 + Hibernate.  With MySql + Hibernate this works.

            • 3. Re: Mina/C3P0
              Maciej Swiderski Master

              Looking at the stack trace looks like you are using hibernate 4 and seems like it calls method (setCharacterStream) that was introduced in java 1.6 maybe it is not supported by C3P0 or the version you use?

               

              HTH

              1 of 1 people found this helpful
              • 4. Re: Mina/C3P0
                Newbie

                Hi Maciej

                 

                Yes, I think you are right, c3p0 does not support this call even in the latest version.  However the query it is failing on was not in 5.4.0.CR1, it was changed due to the shortText field change which happened between 5.4.0.CR1 and 5.4.0.Final.

                 

                We will try DBCP 1.4, which I think should work.  I wanted to post here in case anyone had a recommendation for which pool to use, and in case anyone else hits this error.

                • 5. Re: Mina/C3P0
                  Pavel Bekkerman Newbie

                  I use Hibernate with c3p0.

                  I had exactly the same problem after an attempt to upgrade from Hibernate 4.1.3 to 4.1.8.

                  Downgrading back to 4.1.3 solved the problem.

                  c3p0 version in both cases is the same: 0.9.1.