Почему сервер wildfly, запущенный из плагина wildfly-maven-plugin, не выключается? - PullRequest
0 голосов
/ 06 ноября 2019

Я запускаю сервер wildfly из плагина wildfly-maven-plugin для выполнения интеграционных тестов. Время от времени сервер не выключается должным образом, и процесс Java не завершается. Я получаю:

WARN  [org.jboss.as.controller] (ServerService Thread Pool -- 24) JBAS014618: Graceful shutdown of the handler used for native management requests did not complete within [15000] ms but shutdown of the underlying communication channel is proceeding

Есть идеи, как это исправить?

BR,

Stefan

Я заглянул в журнал TRACE сервера,но не смог найти то, что мне помогло:

13:31:25,044 TRACE [org.jboss.as.naming] (MSC service thread 1-4) Unbound resource InAppClientContainer into naming store org.jboss.as.naming.ServiceBasedNamingStore@2dffc27b (service name service jboss.naming.context.java.module."webrules-1.0"."webrules-1.0".InAppClientContainer)
13:31:25,044 DEBUG [org.jboss.as.connector.logging] (MSC service thread 1-2) stopped ManagementRepositoryService service jboss.management_repository
13:31:25,044 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010418: Stopped Driver service with driver-name = h2
13:31:25,045 DEBUG [org.jboss.as.connector.deployment.registry] (MSC service thread 1-3) Stopping service service jboss.jdbc-driver.registry
13:31:25,098 TRACE [org.jboss.as.server.moduleservice] (MSC service thread 1-3) serviceStopping: Controller for service jboss.module.spec.service."deployment.webrules-1.0.war".main@498cd5bc
13:31:25,100 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment webrules-1.0.war (runtime-name: webrules-1.0.war) in 109ms
13:31:39,999 WARN  [org.jboss.as.controller] (ServerService Thread Pool -- 24) JBAS014618: Graceful shutdown of the handler used for native management requests did not complete within [15000] ms but shutdown of the underlying communication channel is proceeding
13:31:40,001 DEBUG [org.jboss.as.protocol] (ServerService Thread Pool -- 24) cancelled operation (598837789) attachment: (null) this: org.jboss.as.protocol.mgmt.ManagementChannelHandler@741283d0.

Это pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>de.mine</groupId>
    <artifactId>webrules</artifactId>
    <packaging>war</packaging>
    <version>1.0</version>
    <name>webrules</name>
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <servlet-api.version>4.0.1</servlet-api.version>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>2.0.1.Final</version>
                <configuration>
                                  <artifact>org.wildfly:wildfly-dist:8.2.1.Final:zip</artifact>
                                  <java-opts>
                                    <java-opt>-Dmyproperty=true</java-opt>
                                  </java-opts>
                  <modules-path>
                    <paths>
                    <path>/opt/OC/share/wildfly/module</path>
                    </paths>
                  </modules-path>
                                  <commands>
                                    <command>/subsystem=logging/file-handler=debug:add(level=TRACE,autoflush=true,file={"relative-to"=>"jboss.server.log.dir", "path"=>"debug.log"})</command>
                                    <command>/subsystem=logging/logger=org.jboss.as:add(level=TRACE,handlers=[debug])</command>
                                  </commands>
                </configuration>
                <executions>
                    <execution>
                        <id>start-wildfly</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                          <goal>start</goal>
                                                  <goal>execute-commands</goal>
                                                  <goal>deploy</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-wildfly</id>
                        <phase>post-integration-test</phase>
                        <goals>
                                                  <goal>shutdown</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>add-integration-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <!-- Configures the source directory of our integration tests -->
                            <sources>
                                <source>src/integration-test/java</source>
                            </sources>
                        </configuration>
                    </execution>
                    <!-- Add a new resource directory to our build -->
                    <execution>
                        <id>add-integration-test-resources</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>add-test-resource</goal>
                        </goals>
                        <configuration>
                            <!-- Configures the resource directory of our integration tests -->
                            <resources>
                                <!-- Placeholders that are found from the files located in the configured 
                                    resource directories are replaced with the property values found from the 
                                    profile specific configuration file. -->
                                <resource>
                                    <filtering>true</filtering>
                                    <directory>src/integration-test/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M3</version>
                <configuration>
                    <excludes>
                        <exclude>**/*IntegrationTest</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.0.0-M3</version>
                <configuration>
                    <includes>
                        <include>**/*IntegrationTest</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify</id>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <configuration>
                            <target>
                                <copy todir="../sa1/web-rules" overwrite="true">
                                    <fileset
                                        dir="target/${project.artifactId}-${project.version}"
                                        includes="**">
                                    </fileset>
                                </copy>
                                <copy todir="../sa2/web-rules" overwrite="true">
                                    <fileset
                                        dir="target/${project.artifactId}-${project.version}"
                                        includes="**">
                                    </fileset>
                                </copy>

                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.2.2</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Dependencies>com.hpe.cms.smscapp.webrules-beans</Dependencies>
                        </manifestEntries>
                    </archive>
                    <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servlet-api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.4.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.4.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.7</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>1.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.hpe.cms.smscapp</groupId>
            <artifactId>webrules-beans</artifactId>
            <version>1.2.8</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
...