试图在旧JBoss上部署Spring应用程序

时间:2017-01-05 16:22:47

标签: java spring spring-mvc spring-boot jboss

日志消息并没有告诉我任何可以用来定位和解决问题的信息

域/服务器/应用服务器-的centos /日志/ server.log中

2017-01-05 16:13:16,221 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | DeploymentServiceListener constructor for deployment restapi.war]
2017-01-05 16:13:16,221 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | JBAS015876: Starting deployment of "restapi.war"
2017-01-05 16:13:18,089 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | JBAS015960: Class Path entry idb.jar in /content/restapi.war/WEB-INF/lib/xapool-1.5.0.jar  does not point to a valid jar for a Class-Path reference.
2017-01-05 16:13:18,089 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | JBAS015960: Class Path entry classes12.jar in /content/restapi.war/WEB-INF/lib/xapool-1.5.0.jar  does not point to a valid jar for a Class-Path reference.
2017-01-05 16:13:18,089 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | JBAS015960: Class Path entry jta-spec1_0_1.jar in /content/restapi.war/WEB-INF/lib/xapool-1.5.0.jar  does not point to a valid jar for a Class-Path reference.
2017-01-05 16:13:18,089 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | JBAS015960: Class Path entry log4j.jar in /content/restapi.war/WEB-INF/lib/xapool-1.5.0.jar  does not point to a valid jar for a Class-Path reference.
2017-01-05 16:13:18,089 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | JBAS015960: Class Path entry commons-logging.jar in /content/restapi.war/WEB-INF/lib/xapool-1.5.0.jar  does not point to a valid jar for a Class-Path reference.
2017-01-05 16:13:18,090 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | JBAS015960: Class Path entry p6psy.jar in /content/restapi.war/WEB-INF/lib/xapool-1.5.0.jar  does not point to a valid jar for a Class-Path reference.
2017-01-05 16:13:18,117 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-20)  | JBAS015893: Encountered invalid class name 'org.kxml2.io.KXmlParser,org.kxml2.io.KXmlSerializer' for service type 'org.xmlpull.v1.XmlPullParserFactory'
2017-01-05 16:13:18,252 WARN  [org.jboss.as.ee] (MSC service thread 1-9)  | JBAS011006: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.http.server.ServletServerHttpAsyncRequestControl
        at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606) [jboss-as-ee-7.1.2.Final.jar:7.1.2.Final]
        at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:83) [jboss-as-ee-7.1.2.Final.jar:7.1.2.Final]
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

2017-01-05 16:13:18,253 WARN  [org.jboss.as.ee] (MSC service thread 1-9)  | JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.web.context.request.async.StandardServletAsyncWebRequest
        at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606) [jboss-as-ee-7.1.2.Final.jar:7.1.2.Final]
        at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:83) [jboss-as-ee-7.1.2.Final.jar:7.1.2.Final]
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

2017-01-05 16:13:18,287 INFO  [org.jboss.as.osgi] (MSC service thread 1-15)  | JBAS011907: Register module: Module "deployment.restapi.war:main" from Service Module Loader
2017-01-05 16:13:18,520 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,446 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
2017-01-05 16:13:18,520 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,446 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
2017-01-05 16:13:18,520 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,446 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [vfs:/content/restapi.war/WEB-INF/lib/swagger-codegen-distribution-2.1.0-M1.jar/logback.xml]
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,456 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2bcadeba - URL [vfs:/content/restapi.war/WEB-INF/lib/swagger-codegen-distribution-2.1.0-M1.jar/logback.xml] is not of type file
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,477 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,479 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,487 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,516 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,516 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,516 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,517 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.wordnik] to DEBUG
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,517 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,517 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,518 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 16:13:18,519 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@7fb13d11 - Registering current configuration as safe fallback point
2017-01-05 16:13:18,521 INFO  [stdout] (MSC service thread 1-11)  | 
2017-01-05 16:13:18,949 INFO  [stdout] (MSC service thread 1-11)  | 
2017-01-05 16:13:18,949 INFO  [stdout] (MSC service thread 1-11)  |   .   ____          _            __ _ _
2017-01-05 16:13:18,949 INFO  [stdout] (MSC service thread 1-11)  |  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
2017-01-05 16:13:18,949 INFO  [stdout] (MSC service thread 1-11)  | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2017-01-05 16:13:18,949 INFO  [stdout] (MSC service thread 1-11)  |  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
2017-01-05 16:13:18,949 INFO  [stdout] (MSC service thread 1-11)  |   '  |____| .__|_| |_|_| |_\__, | / / / /
2017-01-05 16:13:18,949 INFO  [stdout] (MSC service thread 1-11)  |  =========|_|==============|___/=/_/_/_/
2017-01-05 16:13:18,952 INFO  [stdout] (MSC service thread 1-11)  |  :: Spring Boot ::        (v1.4.3.RELEASE)
2017-01-05 16:13:18,952 INFO  [stdout] (MSC service thread 1-11)  | 
2017-01-05 16:13:20,163 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-11)  | Context [/restapi] startup failed due to previous errors
2017-01-05 16:13:20,163 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-11)  | MSC00001: Failed to start service jboss.web.deployment.default-host./restapi: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./restapi: JBAS018040: Failed to start context
        at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:97)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

2017-01-05 16:13:20,395 INFO  [org.jboss.as.server] (host-controller-connection-threads - 9)  | JBAS015870: Deploy of deployment "restapi.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./restapi" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./restapi: JBAS018040: Failed to start context"},"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"restapi.war\".jboss.security.jacc Missing[JBAS014861: <one or more transitive dependencies>]"]}
2017-01-05 16:13:20,395 INFO  [org.jboss.as.controller] (host-controller-connection-threads - 9)  | JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./restapi: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./restapi: JBAS018040: Failed to start context

2017-01-05 16:13:20,412 INFO  [org.jboss.as.osgi] (MSC service thread 1-5)  | JBAS011908: Unregister module: Module "deployment.restapi.war:main" from Service Module Loader
2017-01-05 16:13:20,470 WARN  [com.alicecallsbob.fas.oamp.extension.OampServiceImpl] (MSC service thread 1-5)  | no MBean found when undeploying restapi.war
2017-01-05 16:13:20,611 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5)  | JBAS015877: Stopped deployment restapi.war in 215ms

我的maven文件,我很确定项目不需要所有依赖项,比如底层4,但JBoss会抛出ClassNotFoundException。

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>hello</groupId>
    <artifactId>restapi</artifactId>
    <packaging>war</packaging>
    <version>0.1</version>
    <name>restapi</name>
    <url>http://maven.apache.org</url>

    <properties>
        <spring.version>4.3.5.RELEASE</spring.version>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.3.RELEASE</version>
    </parent>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>4.0.0-b01</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>4.3.5.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.7</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.22</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.8.5</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.5.0</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.8.5</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jpa</artifactId>
            <version>2.0.8</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-testing</artifactId>
            <version>5.2.6.Final</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jdbc-core</artifactId>
            <version>1.2.1.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <version>2.0.0.M1</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>1.8.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons-core</artifactId>
            <version>1.4.1.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>com.wordnik</groupId>
            <artifactId>swagger-codegen-distribution</artifactId>
            <version>2.1.0-M1</version>
        </dependency>

        <dependency>
            <groupId>org.jooq</groupId>
            <artifactId>jooq</artifactId>
            <version>3.6.2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-rest-webmvc</artifactId>
            <version>2.0.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.security.jacc</groupId>
            <artifactId>jboss-jacc-api_1.4_spec</artifactId>
            <version>1.0.3.Final</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <finalName>restapi</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <extensions>false</extensions>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>http://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>http://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>http://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>http://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>

应用程序属性:

spring.datasource.url=jdbc:mysql://127.0.0.1/database?autoReconnect=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=password
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

1 个答案:

答案 0 :(得分:0)

如果没有定义任何构造函数,则默认没有参数构造函数。如果你定义了一个构造函数,那么除非你明确定义它,否则就不会有无参数构造函数。

任何JBoss EAP发行版发行版都不附带Spring框架。 虽然您可以在应用程序中打包自己的Spring实现,但不建议这样做,因为JavaEE 6要求JBoss提供实现。如果您打包自己的Spring实现,那么它将被视为您的应用程序的一部分。

您必须在应用程序中打包弹簧库,并确保为此创建模块并在应用程序中使用它。

参考以下链接: https://developer.jboss.org/wiki/HowToCreateSingleSpringApplicationContextViaJBossModules