Tomcat资源不可用Java Web App AWS Beanstalk

时间:2016-10-12 12:15:56

标签: java spring maven tomcat vaadin

我正在使用连接到PostgreSQL数据库的Vaadin框架运行一个spring项目,并在webapp中显示数据。我使用this guide开始,基本上只添加了一些Vaadin组件。当执行mvn构建并随后执行.jar文件时,我可以通过localhost:8080上的浏览器连接到我的Web应用程序,一切都按照预期的方式工作。

现在我想在AWS Web服务器上部署该应用程序。为此,我创建了一个AWS Elastic Beanstalk实例(配置:运行Tomcat 8 Java 8的64位Amazon Linux 2016.03 v2.2.0)。到现在为止还挺好。事实上,当我通过INstance提供的URL访问webapp时,我得到了一个" HTTP 404状态代码"和"未找到资源"。我期待这件事至少启动我的网络应用程序,然后通过错误,因为我没有改变数据库配置。然而,它似乎早已成为问题。我究竟做错了什么?我想这是Spring项目配置中的一部分,但对于EE开发来说还是新手......

这是我的pom.xml:

<?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">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>CompAS24</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>CompAS24</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.1.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<repositories>
    <repository>
        <id>vaadin-addons</id>
        <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>
</repositories>

<dependencies>

    <!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
    <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter</artifactId>
        <version>1.1.1</version>
    </dependency>

<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.4.1211</version>
</dependency>


<dependency>
        <groupId>com.vaadin.addon</groupId>
        <artifactId>vaadin-charts</artifactId>
        <version>3.2.0</version>
</dependency>


<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-spring-boot-starter</artifactId>
    <version>1.0.1</version>
</dependency>

<!--        
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <scope>runtime</scope>
</dependency>
-->     
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <!-- -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>

</dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-bom</artifactId>
            <version>7.7.3</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>

        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>7.7.3</version>
            <configuration>
                <extraJvmArgs>-Xmx2g -Xss1024k</extraJvmArgs>
                <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
                <draftCompile>false</draftCompile>
                <compileReport>false</compileReport>
                <style>OBF</style>
                <strict>true</strict>
                <runTarget>http://localhost:8080/simple</runTarget>
                <module>AppWidgetset</module>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>update-widgetset</goal>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>


    </plugins>
</build>

0 个答案:

没有答案