首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >基于Spring的web应用程序在WAS Liberty上启动时失败

基于Spring的web应用程序在WAS Liberty上启动时失败
EN

Stack Overflow用户
提问于 2018-04-20 00:16:47
回答 1查看 3.7K关注 0票数 1

我正在编写一个简单的基于Spring的web应用程序,并将其部署到Websphere Liberty 8.5.5.9。部署失败,因为应用程序启动失败。console.log中的消息是

代码语言:javascript
运行
复制
[ERROR   ] CWWKZ0002E: An exception occurred while starting the application userSetting.
           The exception message was: com.ibm.ws.container.service.metadata.MetaDataException:
           com.ibm.wsspi.adaptable.module.UnableToAdaptException:
           com.ibm.ws.javaee.ddmodel.DDParser$ParseException: CWWKC2262E: The server is
           unable to process the 3.1 version and the http://xmlns.jcp.org/xml/ns/javaee namespace
           in the /META-INF/web-fragment.xml deployment descriptor on line 23.

消息的最后一部分现在有意义了,因为我在应用程序的Eclipse项目中没有/META-INF/WEB-INF,因为我使用Gradle:gradle clean build deploy进行部署。

我尝试了对项目的各种修改,无奈之下,我把它删减到只有以下源代码:

代码语言:javascript
运行
复制
@SpringBootApplication
public class UserSettingApplication {

  private static final LoggerUtils logger = new LoggerUtils( UserSettingApplication.class );

  public static void main(String[] args) {
    logger.debug( "Entering UserSettingApplication.main()" );
    SpringApplication.run(UserSettingApplication.class, args);
  }
}

你能建议我如何解决这个服务启动问题吗?

server.xml:

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">

    <!-- Enable features -->
    <featureManager>
        <feature>jsp-2.2</feature>
    </featureManager>
    <featureManager>
      <feature>adminCenter-1.0</feature>
    </featureManager>

   <!-- Define the host name for use by the collective.
        If the host name needs to be changed, the server should be
        removed from the collective and re-joined. -->
   <variable name="defaultHostName" value="localhost" />

    <!-- Define an Administrator and non-Administrator -->
   <basicRegistry id="basic">
      <user name="admin" password="********" />
      <user name="nonadmin" password="***********" />
   </basicRegistry>

   <!-- Assign 'admin' to Administrator -->
   <administrator-role>
      <user>admin</user>
   </administrator-role>

   <keyStore id="defaultKeyStore" password="*******" />

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint id="defaultHttpEndpoint"
                  host="*"
                  httpPort="9080"
                  httpsPort="9443" />

        <!-- Automatically expand WAR files and EAR files -->
        <applicationManager autoExpand="false"/>
</server>
EN

回答 1

Stack Overflow用户

发布于 2018-04-20 00:59:18

此错误似乎是由某些构建工具生成具有Servlet 3.1模式的web-fragment.xml引起的。

目前,您已经启用了默认情况下启用servlet-3.0jsp-2.2功能。

要解决这个问题,我建议从jsp-2.2升级到jsp-2.3 (这将引入servlet-3.1),或者添加<feature>webProfile-7.0</feature>以仅启用所有JavaEE7web profile特性(servlet、JPA、bean验证、cdi、jsf等)。

因此,您的新server.xml可能如下所示:

代码语言:javascript
运行
复制
<server description="new server">

    <!-- Enable features -->
    <featureManager>
      <feature>jsp-2.3</feature>
      <feature>adminCenter-1.0</feature>
    </featureManager>

<!-- rest of file unchanged.... -->
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49925765

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档