gpt4 book ai didi

JavaEE Arquillian 和 JBoss 8.0.0beta 1 :

转载 作者:行者123 更新时间:2023-12-01 13:51:00 25 4
gpt4 key购买 nike

我正在尝试从 JBoss AS 7.2.0 迁移到 Wildfly 8.0.0beta1。

我自己的项目和所有测试在 7.2.0 上运行良好。但在 8.0.0beta1 上,项目本身正在运行,但在远程服务器上运行时,Arquillian 测试当前会抛出 IllegalArgumentException(未找到 ArquillianServletRunner):

java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.
at org.jboss.arquillian.protocol.servlet.ServletUtil.determineBaseURI(ServletUtil.java:64)
at org.jboss.arquillian.protocol.servlet.ServletURIHandler.locateTestServlet(ServletURIHandler.java:60)
[...]

当使用 JBoss Central > Java EE EAR 项目(几乎反射(reflect)了我的项目结构)通过 Eclipse 创建新项目时,我遇到了相同的异常。

也许修复这个新的、几乎空白的一般项目上的错误会有所帮助。

也许问题是 Arquillian Container 版本错误等?但是当更改它时,我收到其他错误(例如 NoClassDefinition HTTPHandshake...)

最佳答案

几天前我就解决了这个问题。解决办法如下:

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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test.net</groupId>
<artifactId>ArqTest</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.junit>4.11</version.junit>
<version.arquillian>1.1.1.Final</version.arquillian>
<version.wildfly.as>8.0.0.Beta1</version.wildfly.as>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-version</artifactId>
<version>${version.wildfly.as}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.2.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${version.arquillian}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-bom</artifactId>
<version>${version.arquillian}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<finalName>arquillian-tutorial</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jbossas-managed-wildfly-8</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- <testFailureIgnore>true</testFailureIgnore> -->
<systemPropertyVariables>
<arquillian.launch>jbossas-managed-wildfly-8</arquillian.launch>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-spec-api</artifactId>
<version>8.0.0.Beta1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-protocol-jmx</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-common</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

以及托管容器的 arquillian.xml:

<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<defaultProtocol type="Servlet 3.0" />

<container qualifier="jbossas-managed-wildfly-8">
<configuration>
<property name="jbossHome">D:\workspace\wildfly-8.0.0.Beta1</property>
<property name="serverConfig">standalone.xml</property>
</configuration>
</container>
</arquillian>

关于JavaEE Arquillian 和 JBoss 8.0.0beta 1 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19955337/

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