部署war:在类路径上没有检测到Spring WebApplicationInitializer类型

时间:2015-11-26 15:24:26

标签: java spring tomcat liferay

当我尝试在liferay中部署war文件时,我有一个奇怪的错误

РЅРѕСЏ 26, 2015 2:57:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\dev\liferay\liferay-portal-6.2-ce-ga4\tomcat-7.0.42\webapps\site-hook
РЅРѕСЏ 26, 2015 2:57:10 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath

我在日志中的全部内容。我正在使用tomcat 7.042和liferay 6.2 当我用maven建立我的钩子时,除了这条线之外它还不错

[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored 
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')

这是我的web.xml

<?xml version="1.0"?>

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

并在pom.xml中构建部分

<build>
    <plugins>
        <plugin>
            <groupId>com.liferay.maven.plugins</groupId>
            <artifactId>liferay-maven-plugin</artifactId>
            <configuration>
                <pluginType>hook</pluginType>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
        </plugin>
        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
        </plugin>
    </plugins>
</build>

问题出现在一小时前,但最近一切都很好。你能救我吗?

1 个答案:

答案 0 :(得分:0)

尝试在pom.xml中添加'maven-war-plugin'版本2.6