无法使用IntelliJ部署Spring Boot爆炸工件

时间:2015-01-24 20:12:26

标签: java spring intellij-idea spring-boot

在工件部署期间出现错误。 C:\Program Files\Apache Software Foundation\Tomcat 7.0\logs\catalina.log没有任何信息。 IntelliJ的调试控制台中没有有用的信息,但是:

Connected to server
[2015-01-24 10:05:18,950] Artifact war exploded: Artifact is being deployed, please wait...
jaan 24, 2015 10:05:19 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\exploded\WEB-INF\lib\tomcat-embed-el-7.0.55.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class
jaan 24, 2015 10:05:23 PM org.apache.catalina.core.ApplicationContext log
INFO: Spring WebApplicationInitializers detected on classpath: [go.Application@2569b61e]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.1.6.RELEASE)

[2015-01-24 10:05:29,195] Artifact war exploded: Error during artifact deployment. See server log for details

我应该查看哪些日志?

1 个答案:

答案 0 :(得分:0)

您已经在战争文件中打包了嵌入式Tomcat,而您正在部署战争的Tomcat并不喜欢。您需要按提供的方式声明嵌入式Tomcat依赖项。如果你正在使用Maven,那将会是这样的:

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <!-- ... -->
    <packaging>war</packaging>
    <!-- ... -->
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- ... -->
    </dependencies>
</project>