Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java tomcat 8 war:未映射类_Java_Maven_Tomcat - Fatal编程技术网

Java tomcat 8 war:未映射类

Java tomcat 8 war:未映射类,java,maven,tomcat,Java,Maven,Tomcat,我正在尝试创建一个war文件,并将其推送到我的tomcat8 Web服务器。 问题是,tomcat在尝试访问webapp时抛出以下错误: java.io.FileNotFoundException: /var/lib/tomcat8/webapps/tdc-stress-test-2.0-Web.war!/WEB-INF/classes (No such file or directory) 然后是: java.lang.IllegalArgumentException: org.hibern

我正在尝试创建一个war文件,并将其推送到我的tomcat8 Web服务器。 问题是,tomcat在尝试访问webapp时抛出以下错误:

java.io.FileNotFoundException: /var/lib/tomcat8/webapps/tdc-stress-test-2.0-Web.war!/WEB-INF/classes (No such file or directory)
然后是:

java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Basedevice is not mapped [Select t from Basedevice t]
数据库位于我推送war文件的服务器上。persistence.xml配置为使用服务器上的数据库

如果我通过jetty::run local运行它,那么它就可以正常工作,但当我将它推送到服务器时就不行了

发生了什么事

创建战争的插件:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <!-- Exclude an unnecessary file generated by the GWT compiler. -->
                 <packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
            </configuration>
        </plugin>

org.apache.maven.plugins

最佳收视2017-03-31 12-42-18的筛选

您的战争可能没有按应有的方式包装。检查已部署war的内容,您还应该显示您的maven配置文件和用于创建war的目标。Hi@davidxxx。谢谢,我已经更新了问题。:)你的战争可能没有按它应该的样子包装。检查已部署war的内容,您还应该显示您的maven配置文件和用于创建war的目标。Hi@davidxxx。谢谢,我已经更新了问题。:)
<?xml version="1.0" encoding="UTF-8"?>
<groupId>tdc.otva.stress</groupId>
<artifactId>tdc-stress-test</artifactId>
<packaging>war</packaging>
<version>2.0-Web</version>
<name>tdc-stress-test</name>

<prerequisites>
    <maven>3</maven>
</prerequisites>

<properties>
    <vaadin.version>7.7.4</vaadin.version>
    <vaadin.plugin.version>7.7.4</vaadin.plugin.version>
    <jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <!-- If there are no local customisations, this can also be "fetch" or "cdn" -->
    <vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>

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

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

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-server</artifactId>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-push</artifactId>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.2.1.Final</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.37</version>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client-compiled</artifactId>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>2.6.3</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.rxtx/rxtx -->
    <dependency>
        <groupId>org.rxtx</groupId>
        <artifactId>rxtx</artifactId>
        <version>2.1.7</version>
    </dependency>

    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-themes</artifactId>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <!-- Exclude an unnecessary file generated by the GWT compiler. -->
                 <packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>tomcat-maven-plugin</artifactId>
            <configuration>
                <url>http://xxxx.xxx.net:8080/manager/text</url>
                <username>admin</username>
                <password>admin123</password>
                <path>/HelloWorld</path>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin.plugin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>update-theme</goal>
                        <goal>update-widgetset</goal>
                        <goal>compile</goal>
                        <!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
                        <goal>compile-theme</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <version>3.0.0</version>
            <!-- Clean up also any pre-compiled themes -->
            <configuration>
                <filesets>
                    <fileset>
                        <directory>src/main/webapp/VAADIN/themes</directory>
                        <includes>
                            <include>**/styles.css</include>
                            <include>**/styles.scss.cache</include>
                        </includes>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>

        <!-- The Jetty plugin allows us to easily test the development build by
            running jetty:run on the command line. -->
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>${jetty.plugin.version}</version>
            <configuration>
                <scanIntervalSecScreenshot from 2017-03-31 12-42-18onds>2</scanIntervalSeconds>
            </configuration>
        </plugin>
    </plugins>
</build>

<profiles>
    <profile>
        <!-- Vaadin pre-release repositories -->
        <id>vaadin-prerelease</id>
        <activation>
            <activeByDefault>false</activeByDefault>
        </activation>

        <repositories>
            <repository>
                <id>vaadin-prereleases</id>
                <url>http://maven.vaadin.com/vaadin-prereleases</url>
            </repository>
            <repository>
                <id>vaadin-snapshots</id>
                <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>vaadin-prereleases</id>
                <url>http://maven.vaadin.com/vaadin-prereleases</url>
            </pluginRepository>
            <pluginRepository>
                <id>vaadin-snapshots</id>
                <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>