gpt4 book ai didi

google-app-engine - Java GAE maven配置问题?只是另一个验证错误

转载 作者:行者123 更新时间:2023-12-01 05:55:39 25 4
gpt4 key购买 nike

我的项目在 Google 服务器上运行得非常好,但我收到了一个VerifyError:

java.lang.VerifyError: (class: org/restlet/ext/servlet/ServerServlet, 
method: createServer
signature: (Ljavax/servlet/http/HttpServletRequest;)
Lorg/restlet/engine/http/HttpServerHelper;)
Incompatible object argument for function call

最佳答案

通过大量的反复试验,我发现我使用了错误的 Scala 版本。我从 2.7.7 降级到 2.7.6,一切正常。至于为什么,我不知道。也许是 Lift 互操作。

生成的 pom.xml(简短版本):

<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/maven v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- The Basics -->
<groupId>com.beecourt</groupId>
<artifactId>site2</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<properties>
<gae.version>1.3.4</gae.version>
<gae.alternate>1.3.3.1</gae.alternate>
<restlet.version>2.0-RC4</restlet.version>

<!-- this was 2.7.6 -->
<scala.version>2.7.6</scala.version>

<project_charset>UTF-8</project_charset>
</properties>

<dependencies>
...
<!-- customized -->
<dependency>
<groupId>net.liftweb</groupId>
<artifactId>lift-util</artifactId>
<version>1.1-M8</version>
</dependency>
<dependency>
<groupId>org.restlet.gae</groupId>
<artifactId>org.restlet</artifactId>
<version>${restlet.version}</version>
</dependency>
<dependency>
<groupId>org.restlet.gae</groupId>
<artifactId>org.restlet.ext.servlet</artifactId>
<version>${restlet.version}</version>
</dependency>

<!-- file upload -->
<dependency>
<groupId>org.restlet</groupId>
<artifactId>org.restlet.ext.fileupload</artifactId>
<version>2.0-M3</version>
</dependency>
<dependency>
<groupId>com.noelios.restlet</groupId>
<artifactId>restlet</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>

<!-- testing -->
<dependency>
<groupId>org.scala-tools.testing</groupId>
<artifactId>specs</artifactId>
<version>1.6.2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>

<!-- Build Settings -->
<build>
<finalName>site2</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<directory>src/test/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<outputEncoding>${project_charset}</outputEncoding>
<inputEncoding>${project_charset}</inputEncoding>
</configuration>
</plugin>
<plugin>
<groupId>net.kindleit</groupId>
<artifactId>maven-gae-plugin</artifactId>
<version>0.5.9</version>
<configuration>
<port>8080</port>
</configuration>
</plugin>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
<arg>-target:jvm-1.5</arg>
</args>
</configuration>
</plugin>
</plugins>
</build>
<repositories>...
</repositories>
<pluginRepositories>...
</pluginRepositories>
</project>

关于google-app-engine - Java GAE maven配置问题?只是另一个验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3094790/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com