我正在编写一个简单的基于Spring的web应用程序,并将其部署到Websphere Liberty 8.5.5.9。部署失败,因为应用程序启动失败。console.log中的消息是
[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进行部署。
我尝试了对项目的各种修改,无奈之下,我把它删减到只有以下源代码:
@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:
<?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>发布于 2018-04-20 00:59:18
此错误似乎是由某些构建工具生成具有Servlet 3.1模式的web-fragment.xml引起的。
目前,您已经启用了默认情况下启用servlet-3.0的jsp-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可能如下所示:
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.3</feature>
<feature>adminCenter-1.0</feature>
</featureManager>
<!-- rest of file unchanged.... -->https://stackoverflow.com/questions/49925765
复制相似问题