0

Apache tomcat にインストールされたアプリケーションは正常に実行され、Bugzilla をインストールするために新しい Apache がインストールされました。Bugzilla は正常にインストールされ、動作しています。私の Apache Tomcat はポート 1891 で実行され、Bugzilla 用の Apache はポート 80 で実行されています。 Tomcat にインストールされたアプリケーションが動作を停止します。

私のアプリケーションは2つの操作を実行します1.挿入2.ポイント1に基づくその他の重い操作

Insertion のリクエストが来ると、アプリケーションは正常に動作し、挿入を行いますが、2 操作の実行に失敗し、次の例外が発生します。

    Hibernate: select vendor0_.vendor_coupon_id as vendor1_, vendor0_.name as name1_, vendor0_.heading as heading1_, vendor0_.artwork1 as artwork4_1_, vendor0_.artwork2 as artwork5_1_, vendor0_.redeem_doc as redeem6_1_, vendor0_.icon as icon1_, vendor0_.pkg_name as pkg8_1_, vendor0_.apk as apk1_, vendor0_.country as country1_, vendor0_.description as descrip11_1_ from vendor vendor0_ where vendor0_.country=?
org.hibernate.exception.GenericJDBCException: could not execute query
    at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
    at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    at org.hibernate.loader.Loader.doList(Loader.java:1565)
    at org.hibernate.loader.Loader.list(Loader.java:1545)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:840)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    at com.learning.controller.VendorCRUD.getVendorsForCountry(VendorCRUD.java:137)
    at com.avilyne.rest.resource.CouponBinding.UpdateCoupon(CouponBinding.java:50)
    at com.avilyne.rest.resource.CouponBinding.run(CouponBinding.java:44)
    at java.lang.Thread.run(Thread.java:724)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
    at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1269)
    at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1261)
    at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4246)
    at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4212)
    at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StmtAcquireTask.run(GooGooStatementCache.java:525)
    at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 75,824,749 milliseconds ago.  The last packet sent successfully to the server was 75,824,749 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3829)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2449)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2318)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:118)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1239)
    at org.hibernate.loader.Loader.doQuery(Loader.java:374)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
    at org.hibernate.loader.Loader.doList(Loader.java:1562)
    at org.hibernate.loader.Loader.list(Loader.java:1545)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:840)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    at com.learning.controller.VendorCRUD.getVendorById(VendorCRUD.java:153)
    at com.avilyne.rest.resource.VendorOffers.getOffers(VendorOffers.java:69)
    at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1483)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1414)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1363)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1353)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:414)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3810)
    ... 53 more

以下は私のHibernate構成ファイルです:

 <?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD     `3//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">` 
<hibernate-configuration> 
<session-factory> 
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> 
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/offers?autoReconnect=true</property> 
<property name="hibernate.connection.username">root</property> 
<property name="show_sql">true</property> 
<property name="connection.password">password</property> 
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.jdbc.batch_size">20</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> 
<property name="hbm2ddl.auto">update</property>
<property name="dynamic-update">true</property>
<mapping resource="person.hbm.xml"/>
<mapping resource="vendor.hbm.xml"/>
<mapping resource="coupons.hbm.xml"/>
<mapping resource="binding.hbm.xml"/>
<mapping resource="mperson.hbm.xml"/>
</session-factory> 
</hibernate-configuration>

bugzilla がインストールされている Apache を停止すると、Tomcat にインストールされた My アプリケーションが正常に動作します。

ログを見ると、挿入操作の後にデータベース接続が閉じられ、2 番目の操作が実行されないように思えます。接続がどのように閉じられるかわかりませんか? 両方のサーバー (bugzilla がインストールされた Apache とアプリケーションがインストールされた Tomcat) が同じ mysql サーバーを使用し、すべてが 4 Gb RAM と i5 を備えた ubuntu マシンで実行されていることを忘れていました。

4

0 に答える 0