私のプロジェクトは初期段階にあり、休止状態に大きな問題があります。c3p0 0.9.1.2 で hibernate 4.1.8-Final を使用しています。
私は次のエンティティクラスを持っています:
@javax.persistence.Entity
@Table(name = "CUSTOMER")
public class Customer extends Entity {
@Transient
private static final long serialVersionUID = 3326144323537452197L;
private String customerId;
private String customerName;
private boolean active;
public Customer() {
super();
}
@NaturalId
@Column(name = "CUSTOMER_ID", nullable = false)
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
@Lob
@Column(name = "CUSTOMER_NAME", nullable = false)
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
@Column(name = "ACTIVE", nullable = false)
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
}
ご覧のとおり、customerName
に設定されていLob
ます。最初の保存操作で次のエラーが発生しました。
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] java.lang.AbstractMethodError: com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setCharacterStream(ILjava/io/Reader;J)V
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] at java.lang.reflect.Method.invoke(Method.java:601)
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] at $Proxy240.setCharacterStream(Unknown Source)
2012-12-15 01:37:25,670 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$3$1.doBind(ClobTypeDescriptor.java:83)
2012-12-15 01:37:25,685 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:92)
2012-12-15 01:37:25,685 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:280)
2012-12-15 01:37:25,685 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:275)
2012-12-15 01:37:25,701 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:57)
2012-12-15 01:37:25,701 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2747)
2012-12-15 01:37:25,701 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2722)
2012-12-15 01:37:25,701 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2929)
2012-12-15 01:37:25,701 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
2012-12-15 01:37:25,716 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2936)
2012-12-15 01:37:25,716 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3447)
2012-12-15 01:37:25,716 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:81)
2012-12-15 01:37:25,716 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)
2012-12-15 01:37:25,716 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:203)
2012-12-15 01:37:25,732 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:183)
2012-12-15 01:37:25,732 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:167)
2012-12-15 01:37:25,732 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:320)
2012-12-15 01:37:25,732 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:287)
2012-12-15 01:37:25,748 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:193)
2012-12-15 01:37:25,748 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:126)
2012-12-15 01:37:25,748 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:204)
2012-12-15 01:37:25,748 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:55)
2012-12-15 01:37:25,748 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:189)
2012-12-15 01:37:25,763 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:49)
2012-12-15 01:37:25,763 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
2012-12-15 01:37:25,763 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:756)
2012-12-15 01:37:25,763 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.internal.SessionImpl.save(SessionImpl.java:748)
2012-12-15 01:37:25,779 ERROR [com.edfx.adb.web.controller.AdminController] at org.hibernate.internal.SessionImpl.save(SessionImpl.java:744)
2012-12-15 01:37:25,779 ERROR [com.edfx.adb.web.controller.AdminController] at com.edfx.adb.dao.base.BaseDao.save(BaseDao.java:21)
2012-12-15 01:37:25,779 ERROR [com.edfx.adb.web.controller.AdminController] at com.edfx.adb.service.CustomerService.addNewCustomer(CustomerService.java:26)
2012-12-15 01:37:25,779 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-12-15 01:37:25,779 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2012-12-15 01:37:25,794 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2012-12-15 01:37:25,794 ERROR [com.edfx.adb.web.controller.AdminController] at java.lang.reflect.Method.invoke(Method.java:601)
2012-12-15 01:37:25,794 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
2012-12-15 01:37:25,794 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
2012-12-15 01:37:25,794 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
2012-12-15 01:37:25,794 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
2012-12-15 01:37:25,810 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
2012-12-15 01:37:25,810 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
2012-12-15 01:37:25,810 ERROR [com.edfx.adb.web.controller.AdminController] at $Proxy236.addNewCustomer(Unknown Source)
2012-12-15 01:37:25,810 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-12-15 01:37:25,810 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2012-12-15 01:37:25,826 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2012-12-15 01:37:25,826 ERROR [com.edfx.adb.web.controller.AdminController] at java.lang.reflect.Method.invoke(Method.java:601)
2012-12-15 01:37:25,826 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
2012-12-15 01:37:25,841 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
2012-12-15 01:37:25,841 ERROR [com.edfx.adb.web.controller.AdminController] at $Proxy237.addNewCustomer(Unknown Source)
2012-12-15 01:37:25,841 ERROR [com.edfx.adb.web.controller.AdminController] at com.edfx.adb.web.controller.AdminController.saveCustomer(AdminController.java:25)
2012-12-15 01:37:25,841 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-12-15 01:37:25,841 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2012-12-15 01:37:25,841 ERROR [com.edfx.adb.web.controller.AdminController] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2012-12-15 01:37:25,857 ERROR [com.edfx.adb.web.controller.AdminController] at java.lang.reflect.Method.invoke(Method.java:601)
2012-12-15 01:37:25,857 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.el.parser.AstValue.invoke(AstValue.java:262)
2012-12-15 01:37:25,857 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
2012-12-15 01:37:25,857 ERROR [com.edfx.adb.web.controller.AdminController] at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
2012-12-15 01:37:25,857 ERROR [com.edfx.adb.web.controller.AdminController] at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
2012-12-15 01:37:25,872 ERROR [com.edfx.adb.web.controller.AdminController] at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
2012-12-15 01:37:25,872 ERROR [com.edfx.adb.web.controller.AdminController] at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
2012-12-15 01:37:25,872 ERROR [com.edfx.adb.web.controller.AdminController] at javax.faces.component.UICommand.broadcast(UICommand.java:300)
2012-12-15 01:37:25,872 ERROR [com.edfx.adb.web.controller.AdminController] at javax.faces.component.UIData.broadcast(UIData.java:1093)
2012-12-15 01:37:25,872 ERROR [com.edfx.adb.web.controller.AdminController] at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
2012-12-15 01:37:25,888 ERROR [com.edfx.adb.web.controller.AdminController] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
2012-12-15 01:37:25,888 ERROR [com.edfx.adb.web.controller.AdminController] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
2012-12-15 01:37:25,888 ERROR [com.edfx.adb.web.controller.AdminController] at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
2012-12-15 01:37:25,904 ERROR [com.edfx.adb.web.controller.AdminController] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
2012-12-15 01:37:25,904 ERROR [com.edfx.adb.web.controller.AdminController] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
2012-12-15 01:37:25,904 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
2012-12-15 01:37:25,904 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
2012-12-15 01:37:25,904 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119)
2012-12-15 01:37:25,919 ERROR [com.edfx.adb.web.controller.AdminController] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
2012-12-15 01:37:25,919 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
2012-12-15 01:37:25,919 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
2012-12-15 01:37:25,919 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
2012-12-15 01:37:25,935 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
2012-12-15 01:37:25,935 ERROR [com.edfx.adb.web.controller.AdminController] at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
2012-12-15 01:37:25,935 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
2012-12-15 01:37:25,935 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2012-12-15 01:37:25,935 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2012-12-15 01:37:25,950 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
2012-12-15 01:37:25,950 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
2012-12-15 01:37:25,950 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
2012-12-15 01:37:25,950 ERROR [com.edfx.adb.web.controller.AdminController] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
2012-12-15 01:37:25,950 ERROR [com.edfx.adb.web.controller.AdminController] at java.lang.Thread.run(Thread.java:722)
簡単に言えば、エラーメッセージは次のとおりです。
java.lang.AbstractMethodError: com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setCharacterStream(ILjava/io/Reader;J)V
このエラーをグーグルで検索すると、最初のリンクで、休止状態の 4.1.3-Final にダウングレードすると問題を解決できることがわかりました。そして、それはうまくいきました。しかし、私の目的は、最新バージョンの休止状態を使用することです。休止状態には接続プールがあまりないことを読みました。接続プールが必要な場合の原因。サーバーからそのプールを取得します。
私の質問は、JBoss AS 7 で実行されている実稼働環境で、サードパーティの c3p0 を使用する必要があるかどうかです。そうでない場合は、c3p0 を削除できます。または、この問題の解決策はありますか?