我有一个构建为Web应用程序(.war文件)的多线程应用程序。 Web应用程序的结构是,ServletContextListener
启动线程,并在服务器关闭时关闭它们。这个应用程序在JBoss-5.1.0生产服务器中很有魅力。如果在Wildfly-8.1.0中部署了相同的war文件,正如预期的那样ServletContextListener
调出所有线程,线程也会运行,但是在大约90-100分钟之后,Wildfly开始取消部署这个web应用程序。线程使用一个jar,它具有在Spring 4中编写的所有业务逻辑和其他数据库操作。我不确定是什么原因导致服务器触发关闭?在Wildfly-8中运行多线程应用程序是否需要任何特殊配置?我在server.log下面分享
....
2014-12-03 17:31:47,555 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)
2014-12-03 17:31:47,838 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010417: Started Driver service with driver-name = ojdbc6.jar
2014-12-03 17:31:47,849 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/OracleDS]
2014-12-03 17:31:49,029 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017534: Registered web context: /deliveryengine-1.0.0.SNAPSHOT
2014-12-03 17:31:50,591 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment fileprocessor-1.0.0.SNAPSHOT.war
2014-12-03 17:31:50,699 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-2) HV000001: Hibernate Validator 5.1.0.Final
2014-12-03 17:31:51,160 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.1)
2014-12-03 17:31:51,162 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: fileprocessor-1.0.0.SNAPSHOT.war
2014-12-03 17:31:51,252 INFO [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.1.2 (Final)
2014-12-03 17:31:51,280 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = fileprocessor-1.0.0.SNAPSHOT.war_org.postgresql.Driver_9_1
2014-12-03 17:31:51,281 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment fileprocessor-1.0.0.SNAPSHOT.war
2014-12-03 17:31:59,308 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017534: Registered web context: /fileprocessor-1.0.0.SNAPSHOT
2014-12-03 17:31:59,566 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "mysql-connector-java-5.1.5-bin.jar" (runtime-name : "mysql-connector-java-5.1.5-bin.jar")
2014-12-03 17:31:59,566 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "fileprocessor-1.0.0.SNAPSHOT.war" (runtime-name : "fileprocessor-1.0.0.SNAPSHOT.war")
2014-12-03 17:31:59,567 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "ojdbc6.jar" (runtime-name : "ojdbc6.jar")
2014-12-03 17:31:59,567 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "deliveryengine-1.0.0.SNAPSHOT.war" (runtime-name : "deliveryengine-1.0.0.SNAPSHOT.war")
2014-12-03 17:31:59,619 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9890/management
2014-12-03 17:31:59,620 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9890
2014-12-03 17:31:59,620 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.1.0.Final "Kenny" started in 17975ms - Started 442 of 513 services (117 services are lazy, passive or on-demand)
2014-12-03 19:12:57,343 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010418: Stopped Driver service with driver-name = fileprocessor-1.0.0.SNAPSHOT.war_org.postgresql.Driver_9_1
2014-12-03 19:12:57,347 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010409: Unbound data source [java:jboss/datasources/mysql_jndi]
2014-12-03 19:12:57,349 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010409: Unbound data source [java:jboss/datasources/OracleDS]
2014-12-03 19:12:57,433 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017535: Unregistered web context: /deliveryengine-1.0.0.SNAPSHOT
2014-12-03 19:12:57,486 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017535: Unregistered web context: /fileprocessor-1.0.0.SNAPSHOT
2014-12-03 19:12:57,560 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 55) IJ000615: Destroying active connection in pool: oracle-primary-jndi (org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@49b81466)
2014-12-03 19:12:57,618 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010418: Stopped Driver service with driver-name = mysql
2014-12-03 19:12:57,623 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010418: Stopped Driver service with driver-name = ojdbc6.jar
2014-12-03 19:12:57,632 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017532: Host default-host stopping
2014-12-03 19:12:57,726 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010409: Unbound data source [java:jboss/datasources/ExampleDS]
2014-12-03 19:12:57,739 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010418: Stopped Driver service with driver-name = h2
2014-12-03 19:12:57,742 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016009: Stopping weld service for deployment fileprocessor-1.0.0.SNAPSHOT.war
2014-12-03 19:12:57,772 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment mysql-connector-java-5.1.5-bin.jar (runtime-name: mysql-connector-java-5.1.5-bin.jar) in 372ms
2014-12-03 19:12:57,780 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment ojdbc6.jar (runtime-name: ojdbc6.jar) in 386ms
2014-12-03 19:12:57,922 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017521: Undertow HTTP listener default suspending
2014-12-03 19:12:57,924 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017520: Undertow HTTP listener default stopped, was bound to /0.0.0.0:8180
2014-12-03 19:12:57,949 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017506: Undertow 1.0.15.Final stopping
2014-12-03 19:12:57,981 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment deliveryengine-1.0.0.SNAPSHOT.war (runtime-name: deliveryengine-1.0.0.SNAPSHOT.war) in 644ms
2014-12-03 19:12:58,141 ERROR [stderr] (Thread-80) Exception in thread "Thread-80" Exception in thread "Thread-79" java.lang.NoClassDefFoundError: org/springframework/core/NestedExceptionUtils
2014-12-03 19:12:58,142 ERROR [stderr] (Thread-80) at org.springframework.core.NestedRuntimeException.<clinit>(NestedRuntimeException.java:45)
2014-12-03 19:12:58,143 ERROR [stderr] (Thread-80) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
2014-12-03 19:12:58,143 ERROR [stderr] (Thread-80) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
2014-12-03 19:12:58,143 ERROR [stderr] (Thread-80) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
2014-12-03 19:12:58,144 ERROR [stderr] (Thread-80) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
2014-12-03 19:12:58,144 ERROR [stderr] (Thread-80) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
2014-12-03 19:12:58,144 ERROR [stderr] (Thread-80) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
2014-12-03 19:12:58,145 ERROR [stderr] (Thread-80) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:470)
2014-12-03 19:12:58,180 ERROR [stderr] (Thread-80) at org.springframework.jdbc.support.SQLErrorCodesFactory.<init>(SQLErrorCodesFactory.java:124)
2014-12-03 19:12:58,181 ERROR [stderr] (Thread-80) at org.springframework.jdbc.support.SQLErrorCodesFactory.<clinit>(SQLErrorCodesFactory.java:68)
2014-12-03 19:12:58,181 ERROR [stderr] (Thread-80) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDatabaseProductName(SQLErrorCodeSQLExceptionTranslator.java:146)
2014-12-03 19:12:58,182 ERROR [stderr] (Thread-80) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:110)
2014-12-03 19:12:58,182 ERROR [stderr] (Thread-80) at com.<comp>.<proj>.service.JOOQToSpringExceptionTransformer.exception(JOOQToSpringExceptionTransformer.java:21)
2014-12-03 19:12:58,182 ERROR [stderr] (Thread-80) at org.jooq.impl.ExecuteListeners.exception(ExecuteListeners.java:227)
2014-12-03 19:12:58,183 ERROR [stderr] (Thread-80) at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:303)
2014-12-03 19:12:58,186 ERROR [stderr] (Thread-80) at org.jooq.impl.AbstractResultQuery.fetch(AbstractResultQuery.java:319)
2014-12-03 19:12:58,187 ERROR [stderr] (Thread-80) at org.jooq.impl.SelectImpl.fetch(SelectImpl.java:1024)
2014-12-03 19:12:58,187 ERROR [stderr] (Thread-80) at com.<comp>.<proj>.repository.impl.CampaignScheduleSplitRepositoryImpl.findCampingsForExecution(CampaignScheduleSplitRepositoryImpl.java:270)
2014-12-03 19:12:58,187 ERROR [stderr] (Thread-80) at com.<comp>.<proj>.services.impl.CampaignScheduleSplitServiceImpl.getQueuedCampaigns(CampaignScheduleSplitServiceImpl.java:55)
2014-12-03 19:12:58,188 ERROR [stderr] (Thread-80) at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
2014-12-03 19:12:58,188 ERROR [stderr] (Thread-80) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2014-12-03 19:12:58,188 ERROR [stderr] (Thread-80) at java.lang.reflect.Method.invoke(Unknown Source)
2014-12-03 19:12:58,189 ERROR [stderr] (Thread-80) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
2014-12-03 19:12:58,193 ERROR [stderr] (Thread-80) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
2014-12-03 19:12:58,194 ERROR [stderr] (Thread-80) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
2014-12-03 19:12:58,195 ERROR [stderr] (Thread-80) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
2014-12-03 19:12:58,195 ERROR [stderr] (Thread-80) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
2014-12-03 19:12:58,196 ERROR [stderr] (Thread-80) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
2014-12-03 19:12:58,197 ERROR [stderr] (Thread-80) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
2014-12-03 19:12:58,197 ERROR [stderr] (Thread-80) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
2014-12-03 19:12:58,204 ERROR [stderr] (Thread-80) at com.sun.proxy.$Proxy67.getQueuedCampaigns(Unknown Source)
2014-12-03 19:12:58,204 ERROR [stderr] (Thread-80) at com.<comp>.<proj>.fileprocessor.poller.Poller.run(Poller.java:65)
2014-12-03 19:12:58,247 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment fileprocessor-1.0.0.SNAPSHOT.war (runtime-name: fileprocessor-1.0.0.SNAPSHOT.war) in 852ms
2014-12-03 19:12:58,251 ERROR [stderr] (Thread-80) Caused by: java.lang.ClassNotFoundException: org.springframework.core.NestedExceptionUtils from [Module "deployment.fileprocessor-1.0.0.SNAPSHOT.war:main" from Service Module Loader]
2014-12-03 19:12:58,256 ERROR [stderr] (Thread-80) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
2014-12-03 19:12:58,257 INFO [org.jboss.as] (MSC service thread 1-3) JBAS015950: WildFly 8.1.0.Final "Kenny" stopped in 778ms