WildFly 8.1.0 | on shutdown JDBC driver stopped before deployment is stopped
net_hans Jun 23, 2016 8:38 AMHello,
I have the problem, that my WildFly stopped the JDBC before I can run my destroy-function.
12:41:06,330 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final 12:41:06,911 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final 12:41:07,008 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015899: WildFly 8.1.0.Final "Kenny" starting 12:41:09,724 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found TestWS.war in deployment directory. To trigger deployment create a file called TestWS.war.dodeploy 12:41:09,751 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http) 12:41:09,776 INFO [org.xnio] (MSC service thread 1-3) XNIO version 3.2.2.Final 12:41:09,790 INFO [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.2.2.Final 12:41:09,863 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique. 12:41:09,872 INFO [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem 12:41:09,882 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem 12:41:09,886 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors 12:41:09,887 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension 12:41:09,899 INFO [org.jboss.as.security] (MSC service thread 1-5) JBAS013170: Current PicketBox version=4.0.21.Beta1 12:41:09,915 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem. 12:41:09,963 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main] 12:41:09,983 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 12:41:10,029 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.0.15.Final starting 12:41:10,031 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017502: Undertow 1.0.15.Final starting 12:41:10,063 INFO [org.jboss.as.connector.logging] (MSC service thread 1-5) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.5.Final) 12:41:10,092 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) JBAS010417: Started Driver service with driver-name = h2 12:41:10,249 INFO [org.jboss.as.naming] (MSC service thread 1-8) JBAS011802: Starting Naming Service 12:41:10,260 INFO [org.jboss.as.mail.extension] (MSC service thread 1-5) JBAS015400: Bound mail session [java:jboss/mail/Default] 12:41:10,504 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.driver.OracleDriver (version 11.2) 12:41:10,534 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010417: Started Driver service with driver-name = oracle 12:41:10,657 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path C:\Users\T7857\JavaDev\wildfly-8.1.0.Final/welcome-content 12:41:11,130 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017525: Started server default-server. 12:41:11,197 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017531: Host default-host starting 12:41:11,230 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/mydatabase] 12:41:11,296 INFO [org.jboss.remoting] (MSC service thread 1-3) JBoss Remoting version 4.0.3.Final 12:41:11,302 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:/...] 12:41:11,304 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS] 12:41:11,305 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010400: Bound data source [java:/...] 12:41:11,307 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010400: Bound data source [java:/mydatabase] 12:41:11,357 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017519: Undertow HTTP listener default listening on localhost/127.0.0.1:8080 12:41:11,448 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory C:\Users\T7857\JavaDev\wildfly-8.1.0.Final\standalone\deployments 12:41:11,455 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "TestWS.war" (runtime-name: "TestWS.war") 12:41:12,142 INFO [org.jboss.ws.common.management] (MSC service thread 1-1) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.4.Final 12:41:12,286 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment TestWS.war 12:41:12,484 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-2) HV000001: Hibernate Validator 5.1.0.Final 12:41:12,649 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named TestInit in deployment unit deployment "TestWS.war" are as follows: java:global/TestWS/TestInit!test.TestInit java:app/TestWS/TestInit!test.TestInit java:module/TestInit!test.TestInit java:global/TestWS/TestInit java:app/TestWS/TestInit java:module/TestInit 12:41:12,897 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: TestWS.war 12:41:12,965 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-1) JBREM000200: Remote connection failed: java.io.IOException: Eine bestehende Verbindung wurde softwaregesteuert durch den Hostcomputer abgebrochen 12:41:12,994 INFO [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900: 2.1.2 (Final) 12:41:13,185 INFO [org.jboss.ws.cxf.metadata] (MSC service thread 1-2) JBWS024061: Adding service endpoint metadata: id=test.TestWs address=http://localhost:8080/TestWS/TestWs implementor=test.TestWs serviceName={http://test/}TestWsService portName={http://test/}TestWsPort annotationWsdlLocation=null wsdlLocationOverride=null mtomEnabled=false 12:41:13,597 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service {http://test/}TestWsService from class test.TestWs 12:41:14,821 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-2) Setting the server's publish address to be http://localhost:8080/TestWS/TestWs 12:41:15,444 INFO [org.jboss.ws.cxf.deployment] (MSC service thread 1-2) JBWS024074: WSDL published to: file:/C:/Users/T7857/JavaDev/wildfly-8.1.0.Final/standalone/data/wsdl/TestWS.war/TestWsService.wsdl 12:41:15,656 INFO [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016008: Starting weld service for deployment TestWS.war 12:41:15,652 INFO [org.jboss.as.webservices] (MSC service thread 1-7) JBAS015539: Starting service jboss.ws.endpoint."TestWS.war"."test.TestWs" 12:41:19,655 WARN [org.jboss.weld.Validator] (MSC service thread 1-4) WELD-001471: Interceptor method destroy defined on class test.TestInit is not defined according to the specification. It should not throw javax.naming.NamingException, which is a checked exception. 12:41:19,656 WARN [org.jboss.weld.Validator] (MSC service thread 1-4) WELD-001471: Interceptor method initialize defined on class test.TestInit is not defined according to the specification. It should not throw javax.naming.NamingException, which is a checked exception. 12:41:19,656 WARN [org.jboss.weld.Validator] (MSC service thread 1-4) WELD-001471: Interceptor method initialize defined on class test.TestInit is not defined according to the specification. It should not throw java.sql.SQLException, which is a checked exception. 12:41:19,792 INFO [stdout] (ServerService Thread Pool -- 51) start programm 12:41:20,443 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017534: Registered web context: /TestWS 12:41:20,490 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "TestWS.war" (runtime-name : "TestWS.war") 12:41:20,554 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management 12:41:20,555 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990 12:41:20,555 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.1.0.Final "Kenny" started in 14769ms - Started 318 of 371 services (91 services are lazy, passive or on-demand) 12:42:59,418 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010409: Unbound data source [java:/TEN_G_GABI_III] 12:42:59,418 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010409: Unbound data source [java:/TEN_SYSCONTROL] 12:42:59,418 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010409: Unbound data source [java:/TEN_S_NETZ_2011] 12:42:59,419 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010409: Unbound data source [java:/TEN_G_GABI_III_TEST] 12:42:59,425 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017535: Unregistered web context: /TestWS 12:42:59,431 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 56) IJ000615: Destroying active connection in pool: TEN_G_GABI_III_TestSystem (org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@296af724) 12:42:59,444 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) JBAS010418: Stopped Driver service with driver-name = oracle 12:42:59,457 INFO [org.jboss.as.webservices] (MSC service thread 1-4) JBAS015540: Stopping service jboss.ws.endpoint."TestWS.war"."test.TestWs" 12:42:59,459 INFO [stdout] (ServerService Thread Pool -- 57) end programm 12:42:59,460 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) JBAS017532: Host default-host stopping 12:42:59,471 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016009: Stopping weld service for deployment TestWS.war 12:42:59,469 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010409: Unbound data source [java:jboss/datasources/ExampleDS] 12:42:59,474 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) JBAS010418: Stopped Driver service with driver-name = h2 12:42:59,559 INFO [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017521: Undertow HTTP listener default suspending 12:42:59,566 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment TestWS.war (runtime-name: TestWS.war) in 210ms 12:42:59,568 INFO [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017520: Undertow HTTP listener default stopped, was bound to localhost/127.0.0.1:8080 12:42:59,570 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017506: Undertow 1.0.15.Final stopping 12:42:59,578 INFO [org.jboss.as] (MSC service thread 1-4) JBAS015950: WildFly 8.1.0.Final "Kenny" stopped in 221ms Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
At line 82 you can see that the oracle driver is stopped before my deployment run the stop function (line 84 - 86). In my full application I need a jdbc connection in my stop function.
My test sourcecode for the start and destroy function is:
package test; import java.sql.Connection; import java.sql.SQLException; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.ejb.Singleton; import javax.ejb.Startup; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; @Startup @Singleton public class TestInit { public InitialContext ctx; @PostConstruct public void initialize() throws NamingException, SQLException{ System.out.println("start programm"); this.ctx = new InitialContext(); DataSource ds = (DataSource) this.ctx.lookup("java:/mydatabase"); Connection con = ds.getConnection(); //... con.close(); } @PreDestroy public void destroy() throws NamingException, SQLException{ System.out.println("end programm"); this.ctx.close(); DataSource ds = (DataSource) this.ctx.lookup("java:/mydatabase"); Connection con = ds.getConnection(); //... con.close(); } }
Can somebody help me please?