简体   繁体   English

Glassfish嵌入式JNDI模块作用域查找

[英]Glassfish embedded JNDI module scope lookup

I am trying to write JUnit tests by using an embedded glassfish server and EJB3. 我试图通过使用嵌入式glassfish服务器和EJB3编写JUnit测试。

I am using maven and my project has 3 modules, and in each of them I want to perform tests. 我正在使用maven,我的项目有3个模块,在每个模块中我都想执行测试。

The module I am currently trying to write tests for is called Backend. 我目前正在尝试为其编写测试的模块称为后端。

The problem is, that I require a "java:module/" scope for my jndi lookups in the test environment, but when I execute the test only "java:global/classes/" seems to exists. 问题是,在测试环境中,我的jndi查找需要“ java:module /”作用域,但是执行测试时,似乎仅存在“ java:global / classes /”。

Does anyone know how I can also execute module scope lookups in an embedded glassfish server? 有谁知道我也可以在嵌入式glassfish服务器中执行模块范围查找?

Some further infos: 一些进一步的信息:

  • Modul structure: 模组结构:
    • EJB Module (called Backend) EJB模块(称为后端)
    • WAR Module (called Frontend) WAR模块(称为前端)
    • JAR Module (utility things) JAR模块(实用工具)
  • POM test dependencies: POM测试依赖项:

     <dependency> <groupId>org.glassfish.main.extras</groupId> <artifactId>glassfish-embedded-all</artifactId> <version>3.1.2</version> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope> <type>jar</type> </dependency> 

好的,我通过使用Arquillian并将EAR归档部署为EnterpriseArchive来解决了这一问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM