Arquillian 无法为 Websphere 嵌入式容器加载 LoadableExtension

Arquillian can't load LoadableExtension for Websphere Embedded Container

我无法让 ArquillianWebsphere Embedded EJBContainer 一起顺利工作。 因为我不能使用 arquillian-was-embedded-8 Jar 文件(在公司 Maven 存储库和 Jenkins 中丢失)。

我尝试在我的 Junit 测试中加载 WebSphereExtension (LoadableExtension) 但没有成功。有人可以指出正确的解决方案吗?

我的第二个问题是,即使我在我的 IDE 本地加载这个 jar 文件,我也有 接口 (在我的 EJB 上)的问题。在这里看到同样的问题: [arquillian-was-embedded-8 runs but can't inject EJB. NullPointerException 我怎样才能避免这种情况?

我的 maven 依赖项:

 <dependency>
           <groupId>com.ibm.websphere</groupId>
           <artifactId>com.ibm.ws.ejb.embeddableContainer</artifactId>
           <version>8.0.0.11</version>
       <scope>test</scope>
    </dependency>       
<dependency>
           <groupId>com.ibm.websphere</groupId>
           <artifactId>endorsed_apis</artifactId>
           <version>8.0.0.11</version>
       <scope>test</scope>
    </dependency>       
<dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>1.1.4.Final</version>
            <type>pom</type>
            <scope>import</scope>
     </dependency>       
     <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-build</artifactId>
            <version>1.1.4.Final</version>
            <type>pom</type>
            <scope>import</scope>
     </dependency>       
 <dependency>
        <groupId>org.jboss.arquillian.container</groupId>
        <artifactId>arquillian-container-spi</artifactId>
    <version>1.1.4.Final</version>           
        <scope>test</scope>
     </dependency>                 
    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
    <version>1.1.4.Final</version>          
        <scope>test</scope>
    </dependency> 

Java6,Junit 4.12,IDELuna 4.4.2

提前谢谢你,我将不胜感激

我找到了解决方案。如果我使用它,我不需要构建工件 在 src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension (这是一个文件名) 内容 --> /path/to/WebSphereExtension

第二个问题我是这样解决的:

@EJB(mappedName = "java:global/test/MyEjbTest!com.home.coem.Processor")

处理器测试1;

Processor是接口名,MyEjbTest是实现bean!

希望对大家有所帮助